12
12
13
13
< h1 > [name]</ h1 >
14
14
15
- < div class ="desc "> Creates extruded geometry from a path shape</ div >
15
+ < div class ="desc "> Creates extruded geometry from a path shape.</ div >
16
+
17
+ < iframe id ="scene " src ="scenes/geometry-browser.html#ExtrudeGeometry "> </ iframe >
18
+
19
+ < script >
20
+
21
+ // iOS iframe auto-resize workaround
22
+
23
+ if ( / ( i P a d | i P h o n e | i P o d ) / g. test ( navigator . userAgent ) ) {
24
+
25
+ var scene = document . getElementById ( 'scene' ) ;
26
+
27
+ scene . style . width = getComputedStyle ( scene ) . width ;
28
+ scene . style . height = getComputedStyle ( scene ) . height ;
29
+ scene . setAttribute ( 'scrolling' , 'no' ) ;
30
+
31
+ }
32
+
33
+ </ script >
34
+
35
+ < h2 > Example</ h2 >
36
+
37
+
38
+ < code >
39
+ var length = 12, width = 8;
40
+
41
+ var shape = new THREE.Shape();
42
+ shape.moveTo( 0,0 );
43
+ shape.lineTo( 0, width );
44
+ shape.lineTo( length, width );
45
+ shape.lineTo( length, 0 );
46
+ shape.lineTo( 0, 0 );
47
+
48
+ var extrudeSettings = {
49
+ steps: 2,
50
+ amount: 16,
51
+ bevelEnabled: true,
52
+ bevelThickness: 1,
53
+ bevelSize: 1,
54
+ bevelSegments: 1
55
+ };
56
+
57
+ var geometry = new THREE.ExtrudeGeometry( shape, data );
58
+ var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
59
+ var mesh = new THREE.Mesh( geometry, material ) ;
60
+ scene.add( mesh );
61
+ </ code >
16
62
17
63
18
64
< h2 > Constructor</ h2 >
@@ -23,20 +69,20 @@ <h3>[name]([page:Array shapes], [page:Object options])</h3>
23
69
shapes — Shape or an array of shapes. < br />
24
70
options — Object that can contain the following parameters.
25
71
26
- < ul >
27
- < li > curveSegments — int. number of points on the curves</ li >
28
- < li > steps — int. number of points used for subdividing segements of extrude spline</ li >
29
- < li > amount — int. Depth to extrude the shape</ li >
30
- < li > bevelEnabled — bool. turn on bevel</ li >
31
- < li > bevelThickness — float. how deep into the original shape bevel goes</ li >
32
- < li > bevelSize — float. how far from shape outline is bevel</ li >
33
- < li > bevelSegments — int. number of bevel layers</ li >
34
- < li > extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if ( frames aren't defined)</ li >
35
- < li > frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</ li >
36
- < li > material — int. material index for front and back faces</ li >
37
- < li > extrudeMaterial — int. material index for extrusion and beveled faces</ li >
38
- < li > UVGenerator — Object. object that provides UV generator functions</ li >
39
- </ ul >
72
+ < ul >
73
+ < li > curveSegments — int. number of points on the curves</ li >
74
+ < li > steps — int. number of points used for subdividing segements of extrude spline</ li >
75
+ < li > amount — int. Depth to extrude the shape</ li >
76
+ < li > bevelEnabled — bool. turn on bevel</ li >
77
+ < li > bevelThickness — float. how deep into the original shape bevel goes</ li >
78
+ < li > bevelSize — float. how far from shape outline is bevel</ li >
79
+ < li > bevelSegments — int. number of bevel layers</ li >
80
+ < li > extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if frames aren't defined)</ li >
81
+ < li > frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</ li >
82
+ < li > material — int. material index for front and back faces</ li >
83
+ < li > extrudeMaterial — int. material index for extrusion and beveled faces</ li >
84
+ < li > UVGenerator — Object. object that provides UV generator functions</ li >
85
+ </ ul >
40
86
41
87
</ div >
42
88
< div >
@@ -53,42 +99,42 @@ <h3>[method:null addShapeList]([page:Array shapes], [page:Object options])</h3>
53
99
< div >
54
100
shapes — An Array of shapes to add. < br />
55
101
options — Object that can contain the following parameters.
56
- < ul >
57
- < li > curveSegments — int. number of points on the curves</ li >
58
- < li > steps — int. number of points used for subdividing segements of extrude spline</ li >
59
- < li > amount — int. Depth to extrude the shape</ li >
60
- < li > bevelEnabled — bool. turn on bevel</ li >
61
- < li > bevelThickness — float. how deep into the original shape bevel goes</ li >
62
- < li > bevelSize — float. how far from shape outline is bevel</ li >
63
- < li > bevelSegments — int. number of bevel layers</ li >
64
- < li > extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if (frames aren't defined)</ li >
65
- < li > frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</ li >
66
- < li > material — int. material index for front and back faces</ li >
67
- < li > extrudeMaterial — int. material index for extrusion and beveled faces</ li >
68
- < li > UVGenerator — Object. object that provides UV generator functions</ li >
69
- </ ul >
70
- </ div >
102
+ < ul >
103
+ < li > curveSegments — int. number of points on the curves</ li >
104
+ < li > steps — int. number of points used for subdividing segements of extrude spline</ li >
105
+ < li > amount — int. Depth to extrude the shape</ li >
106
+ < li > bevelEnabled — bool. turn on bevel</ li >
107
+ < li > bevelThickness — float. how deep into the original shape bevel goes</ li >
108
+ < li > bevelSize — float. how far from shape outline is bevel</ li >
109
+ < li > bevelSegments — int. number of bevel layers</ li >
110
+ < li > extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if (frames aren't defined)</ li >
111
+ < li > frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</ li >
112
+ < li > material — int. material index for front and back faces</ li >
113
+ < li > extrudeMaterial — int. material index for extrusion and beveled faces</ li >
114
+ < li > UVGenerator — Object. object that provides UV generator functions</ li >
115
+ </ ul >
116
+ </ div >
71
117
< div > Adds the shapes to the list to extrude.</ div >
72
118
73
119
< h3 > [method:null addShape]([page:Shape shape], [page:Object options])</ h3 >
74
120
< div >
75
121
shape — A shape to add. < br />
76
122
options — Object that can contain the following parameters.
77
- < ul >
78
- < li > curveSegments — int. number of points on the curves</ li >
79
- < li > steps — int. number of points used for subdividing segements of extrude spline</ li >
80
- < li > amount — int. Depth to extrude the shape</ li >
81
- < li > bevelEnabled — bool. turn on bevel</ li >
82
- < li > bevelThickness — float. how deep into the original shape bevel goes</ li >
83
- < li > bevelSize — float. how far from shape outline is bevel</ li >
84
- < li > bevelSegments — int. number of bevel layers</ li >
85
- < li > extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if (frames aren't defined)</ li >
86
- < li > frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</ li >
87
- < li > material — int. material index for front and back faces</ li >
88
- < li > extrudeMaterial — int. material index for extrusion and beveled faces</ li >
89
- < li > UVGenerator — Object. object that provides UV generator functions</ li >
90
- </ ul >
91
- </ div >
123
+ < ul >
124
+ < li > curveSegments — int. number of points on the curves</ li >
125
+ < li > steps — int. number of points used for subdividing segements of extrude spline</ li >
126
+ < li > amount — int. Depth to extrude the shape</ li >
127
+ < li > bevelEnabled — bool. turn on bevel</ li >
128
+ < li > bevelThickness — float. how deep into the original shape bevel goes</ li >
129
+ < li > bevelSize — float. how far from shape outline is bevel</ li >
130
+ < li > bevelSegments — int. number of bevel layers</ li >
131
+ < li > extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if (frames aren't defined)</ li >
132
+ < li > frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</ li >
133
+ < li > material — int. material index for front and back faces</ li >
134
+ < li > extrudeMaterial — int. material index for extrusion and beveled faces</ li >
135
+ < li > UVGenerator — Object. object that provides UV generator functions</ li >
136
+ </ ul >
137
+ </ div >
92
138
< div > Add the shape to the list to extrude.</ div >
93
139
94
140
0 commit comments