@@ -25,8 +25,10 @@ class TorusGeometry extends BufferGeometry {
2525 * @param {number } [radialSegments=12] - The number of radial segments.
2626 * @param {number } [tubularSegments=48] - The number of tubular segments.
2727 * @param {number } [arc=Math.PI*2] - Central angle in radians.
28+ * @param {number } [thetaStart=0] - Start of the tubular sweep in radians.
29+ * @param {number } [thetaLength=Math.PI*2] - Length of the tubular sweep in radians.
2830 */
29- constructor ( radius = 1 , tube = 0.4 , radialSegments = 12 , tubularSegments = 48 , arc = Math . PI * 2 ) {
31+ constructor ( radius = 1 , tube = 0.4 , radialSegments = 12 , tubularSegments = 48 , arc = Math . PI * 2 , thetaStart = 0 , thetaLength = Math . PI * 2 ) {
3032
3133 super ( ) ;
3234
@@ -44,7 +46,9 @@ class TorusGeometry extends BufferGeometry {
4446 tube : tube ,
4547 radialSegments : radialSegments ,
4648 tubularSegments : tubularSegments ,
47- arc : arc
49+ arc : arc ,
50+ thetaStart : thetaStart ,
51+ thetaLength : thetaLength ,
4852 } ;
4953
5054 radialSegments = Math . floor ( radialSegments ) ;
@@ -67,10 +71,11 @@ class TorusGeometry extends BufferGeometry {
6771
6872 for ( let j = 0 ; j <= radialSegments ; j ++ ) {
6973
74+ const v = thetaStart + ( j / radialSegments ) * thetaLength ;
75+
7076 for ( let i = 0 ; i <= tubularSegments ; i ++ ) {
7177
7278 const u = i / tubularSegments * arc ;
73- const v = j / radialSegments * Math . PI * 2 ;
7479
7580 // vertex
7681
0 commit comments