Skip to content

Commit 7d6e500

Browse files
committed
Merge pull request mrdoob#5491 from TatumCreative/docs-curves2
Completed curve docs
2 parents 0b05efd + 218b427 commit 7d6e500

11 files changed

Lines changed: 185 additions & 98 deletions

docs/api/extras/core/Curve.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<h1>[name]</h1>
1111

1212
<div class="desc">An extensible curve object which contains methods for interpolation.</div>
13-
13+
14+
<h2>Examples</h2>
15+
16+
<h3>[example:webgl_geometry_extrude_splines geometry / extrude / splines ]
1417

1518
<h2>Constructor</h2>
1619

docs/api/extras/curves/ClosedSplineCurve3.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,27 @@ <h2>Example</h2>
1717

1818
<code>
1919
//Create a closed wavey loop
20-
var curve = new THREE.ClosedSplineCurve3([
21-
new THREE.Vector3(-10, 0, 10),
22-
new THREE.Vector3(-5, 5, 5),
23-
new THREE.Vector3( 0, 0, 0),
24-
new THREE.Vector3( 5, -5, 5),
25-
new THREE.Vector3(10, 0, 10)
26-
]);
20+
var curve = new THREE.ClosedSplineCurve3( [
21+
new THREE.Vector3( -10, 0, 10 ),
22+
new THREE.Vector3( -5, 5, 5 ),
23+
new THREE.Vector3( 0, 0, 0 ),
24+
new THREE.Vector3( 5, -5, 5 ),
25+
new THREE.Vector3( 10, 0, 10 )
26+
] );
2727

2828
var geometry = new THREE.Geometry();
29-
geometry.vertices = curve.getPoints(50);
29+
geometry.vertices = curve.getPoints( 50 );
3030

31-
var material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
31+
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
3232
</code>
3333

34+
<h3>[example:webgl_geometry_extrude_splines geometry / extrude / splines] (choose SampleClosedSpline)</h3>
35+
36+
3437
<h2>Constructor</h2>
3538

3639

37-
<h3>[name]([page:Array points])</h3>
40+
<h3>[name]( [page:Array points] )</h3>
3841
<div>points – An array of [page:Vector3] points</div>
3942

4043

docs/api/extras/curves/CubicBezierCurve.html

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,54 @@
1111

1212
<h1>[name]</h1>
1313

14-
<div class="desc">todo</div>
14+
<div class="desc">
15+
Create a smooth 2d <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg" target="_blank">cubic bezier curve</a>.
16+
</div>
1517

1618
<h2>Example</h2>
1719

18-
<code>todo</code>
20+
<code>
21+
var curve = new THREE.CubicBezierCurve(
22+
new THREE.Vector3( -10, 0, 0 ),
23+
new THREE.Vector3( -5, 15, 0 ),
24+
new THREE.Vector3( 20, 15, 0 ),
25+
new THREE.Vector3( 10, 0, 0 )
26+
);
1927

20-
<h2>Constructor</h2>
28+
var path = new THREE.Path( curve.getPoints( 50 ) );
2129

30+
var geometry = path.createPointsGeometry( 50 );
31+
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
2232

23-
<h3>todo</h3>
24-
<div></div>
33+
// Create the final Object3d to add to the scene
34+
var curveObject = new THREE.Line( geometry, material );
35+
</code>
2536

37+
<h2>Constructor</h2>
2638

27-
<h2>Properties</h2>
2839

29-
<h3>todo</h3>
40+
<h3>[name] ( [page:Vector2 v0], [page:Vector2 v1], [page:Vector2 v2], [page:Vector2 v3] )</h3>
3041
<div>
31-
todo
32-
</div>
42+
[page:Vector2 v0] – The starting point<br/>
43+
[page:Vector2 v1] – The first control point<br/>
44+
[page:Vector2 v2] – The second control point<br/>
45+
[page:Vector2 v3] – The ending point<br/>
46+
</div>
47+
48+
<h2>Properties</h2>
49+
50+
<h3>[property:Vector2 v0]</h3>
51+
52+
<h3>[property:Vector2 v1]</h3>
53+
54+
<h3>[property:Vector2 v2]</h3>
55+
56+
<h3>[property:Vector2 v3]</h3>
3357

3458

3559
<h2>Methods</h2>
3660

37-
38-
<h3>todo</h3>
39-
<div>todo</div>
40-
<div>
41-
todo
42-
</div>
61+
<h3>See [page:Curve] for inherited methods</h3>
4362

4463
<h2>Source</h2>
4564

docs/api/extras/curves/CubicBezierCurve3.html

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,55 @@
1111

1212
<h1>[name]</h1>
1313

14-
<div class="desc">todo</div>
14+
<div class="desc">
15+
Create a smooth 3d <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg" target="_blank">cubic bezier curve</a>.
16+
</div>
1517

1618
<h2>Example</h2>
1719

18-
<code>todo</code>
20+
<code>
21+
var curve = new THREE.CubicBezierCurve3(
22+
new THREE.Vector3( -10, 0, 0 ),
23+
new THREE.Vector3( -5, 15, 0 ),
24+
new THREE.Vector3( 20, 15, 0 ),
25+
new THREE.Vector3( 10, 0, 0 )
26+
);
1927

20-
<h2>Constructor</h2>
28+
var geometry = new THREE.Geometry();
29+
geometry.vertices = curve.getPoints( 50 );
2130

31+
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
2232

23-
<h3>todo</h3>
24-
<div></div>
33+
// Create the final Object3d to add to the scene
34+
var curveObject = new THREE.Line( geometry, material );
2535

36+
</code>
2637

27-
<h2>Properties</h2>
38+
<h2>Constructor</h2>
2839

29-
<h3>todo</h3>
30-
<div>
31-
todo
32-
</div>
3340

41+
<h3>[name]( [page:Vector3 v0], [page:Vector3 v1], [page:Vector3 v2], [page:Vector3 v3] )</h3>
42+
<div>
43+
[page:Vector3 v0] – The starting point<br/>
44+
[page:Vector3 v1] – The first control point<br/>
45+
[page:Vector3 v2] – The second control point<br/>
46+
[page:Vector3 v3] – The ending point<br/>
47+
</div>
3448

35-
<h2>Methods</h2>
49+
<h2>Properties</h2>
50+
51+
<h3>[property:Vector3 v0]</h3>
52+
53+
<h3>[property:Vector3 v1]</h3>
54+
55+
<h3>[property:Vector3 v2]</h3>
56+
57+
<h3>[property:Vector3 v3]</h3>
3658

3759

38-
<h3>todo</h3>
39-
<div>todo</div>
40-
<div>
41-
todo
42-
</div>
60+
<h2>Methods</h2>
4361

62+
<h3>See [page:Curve] for inherited methods</h3>
4463
<h2>Source</h2>
4564

4665
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

docs/api/extras/curves/EllipseCurve.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ <h2>Example</h2>
2323
false // aClockwise
2424
);
2525

26-
var path = new THREE.Path( curve.getPoints(50) );
26+
var path = new THREE.Path( curve.getPoints( 50 ) );
2727
var geometry = path.createPointsGeometry( 50 );
28-
var material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
28+
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
2929

30-
//Create the final Object3d to add to the scene
30+
// Create the final Object3d to add to the scene
3131
var ellipse = new THREE.Line( geometry, material );
3232
</code>
3333

3434
<h2>Constructor</h2>
3535

3636

37-
<h3>[name]([page:Float aX], [page:Float aY], [page:Float xRadius], [page:Float yRadius], [page:Radians aStartAngle], [page:Radians aEndAngle], [page:Boolean aClockwise])</h3>
37+
<h3>[name]( [page:Float aX], [page:Float aY], [page:Float xRadius], [page:Float yRadius], [page:Radians aStartAngle], [page:Radians aEndAngle], [page:Boolean aClockwise] )</h3>
3838
<div>
3939
aX – The X center of the ellipse<br/>
4040
aY – The Y center of the ellipse<br/>

docs/api/extras/curves/LineCurve.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1>[name]</h1>
1616
<h2>Constructor</h2>
1717

1818

19-
<h3>[name]([page:Vector2 v1], [page:Vector2 v2])</h3>
19+
<h3>[name]( [page:Vector2 v1], [page:Vector2 v2] )</h3>
2020
<div>
2121
v1 – The start point<br/>
2222
v2 - The end point

docs/api/extras/curves/LineCurve3.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1>[name]</h1>
1616
<h2>Constructor</h2>
1717

1818

19-
<h3>[name]([page:Vector3 v1], [page:Vector3 v2])</h3>
19+
<h3>[name]( [page:Vector3 v1], [page:Vector3 v2] )</h3>
2020
<div>
2121
v1 – The start point<br/>
2222
v2 - The end point

docs/api/extras/curves/QuadraticBezierCurve.html

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,54 @@
1111

1212
<h1>[name]</h1>
1313

14-
<div class="desc">todo</div>
14+
<div class="desc">
15+
Create a smooth 2d <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif" target="_blank">quadratic bezier curve</a>.
16+
</div>
1517

1618
<h2>Example</h2>
1719

18-
<code>todo</code>
20+
<code>
21+
var curve = new THREE.QuadraticBezierCurve(
22+
new THREE.Vector3( -10, 0, 0 ),
23+
new THREE.Vector3( 20, 15, 0 ),
24+
new THREE.Vector3( 10, 0, 0 )
25+
);
26+
27+
var path = new THREE.Path( curve.getPoints( 50 ) );
28+
29+
var geometry = path.createPointsGeometry( 50 );
30+
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
31+
32+
//Create the final Object3d to add to the scene
33+
var curveObject = new THREE.Line( geometry, material );
34+
</code>
1935

2036
<h2>Constructor</h2>
2137

2238

23-
<h3>todo</h3>
24-
<div></div>
39+
<h3>[name]( [page:Vector2 v0], [page:Vector2 v1], [page:Vector2 v2] )</h3>
40+
<div>
41+
[page:Vector2 v0] – The starting point<br/>
42+
[page:Vector2 v1] – The middle control point<br/>
43+
[page:Vector2 v2] – The ending point<br/>
44+
</div>
2545

2646

2747
<h2>Properties</h2>
2848

29-
<h3>todo</h3>
30-
<div>
31-
todo
32-
</div>
49+
50+
<h3>[property:Vector2 v0]</h3>
51+
52+
<h3>[property:Vector2 v1]</h3>
53+
54+
<h3>[property:Vector2 v2]</h3>
3355

3456

3557
<h2>Methods</h2>
3658

3759

38-
<h3>todo</h3>
39-
<div>todo</div>
40-
<div>
41-
todo
42-
</div>
43-
60+
<h3>See [page:Curve] for inherited methods</h3>
61+
4462
<h2>Source</h2>
4563

4664
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

docs/api/extras/curves/QuadraticBezierCurve3.html

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,53 @@
1111

1212
<h1>[name]</h1>
1313

14-
<div class="desc">todo</div>
14+
<div class="desc">
15+
Create a smooth 3d <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif" target="_blank">quadratic bezier curve</a>.
16+
</div>
1517

1618
<h2>Example</h2>
1719

18-
<code>todo</code>
20+
<code>
21+
var curve = new THREE.QuadraticBezierCurve3(
22+
new THREE.Vector3( -10, 0, 0 ),
23+
new THREE.Vector3( 20, 15, 0 ),
24+
new THREE.Vector3( 10, 0, 0 )
25+
);
1926

20-
<h2>Constructor</h2>
27+
var geometry = new THREE.Geometry();
28+
geometry.vertices = curve.getPoints( 50 );
2129

30+
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
2231

23-
<h3>todo</h3>
24-
<div></div>
32+
// Create the final Object3d to add to the scene
33+
var curveObject = new THREE.Line( geometry, material );
34+
</code>
2535

36+
<h2>Constructor</h2>
2637

27-
<h2>Properties</h2>
2838

29-
<h3>todo</h3>
39+
<h3>[name]( [page:Vector3 v0], [page:Vector3 v1], [page:Vector3 v2] )</h3>
3040
<div>
31-
todo
32-
</div>
41+
[page:Vector3 v0] – The starting point<br/>
42+
[page:Vector3 v1] – The middle control point<br/>
43+
[page:Vector3 v2] – The ending point<br/>
44+
</div>
45+
46+
47+
48+
<h2>Properties</h2>
49+
50+
<h3>[property:Vector3 v0]</h3>
51+
52+
<h3>[property:Vector3 v1]</h3>
53+
54+
<h3>[property:Vector3 v2]</h3>
3355

3456

3557
<h2>Methods</h2>
3658

3759

38-
<h3>todo</h3>
39-
<div>todo</div>
40-
<div>
41-
todo
42-
</div>
60+
<h3>See [page:Curve] for inherited methods</h3>
4361

4462
<h2>Source</h2>
4563

0 commit comments

Comments
 (0)