Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
e42806c7
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e42806c7
编写于
10月 18, 2017
作者:
M
Mr.doob
提交者:
GitHub
10月 18, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12406 from Mugen87/curve2
CurvePath: Remove factory methods
上级
ca6a0cd3
391c8074
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
116 addition
and
120 deletion
+116
-120
docs/api/core/BufferGeometry.html
docs/api/core/BufferGeometry.html
+3
-0
docs/api/core/Geometry.html
docs/api/core/Geometry.html
+3
-0
docs/api/extras/core/CurvePath.html
docs/api/extras/core/CurvePath.html
+0
-23
docs/api/extras/curves/CatmullRomCurve3.html
docs/api/extras/curves/CatmullRomCurve3.html
+2
-2
docs/api/extras/curves/CubicBezierCurve.html
docs/api/extras/curves/CubicBezierCurve.html
+2
-2
docs/api/extras/curves/CubicBezierCurve3.html
docs/api/extras/curves/CubicBezierCurve3.html
+2
-2
docs/api/extras/curves/EllipseCurve.html
docs/api/extras/curves/EllipseCurve.html
+3
-2
docs/api/extras/curves/QuadraticBezierCurve.html
docs/api/extras/curves/QuadraticBezierCurve.html
+2
-2
docs/api/extras/curves/QuadraticBezierCurve3.html
docs/api/extras/curves/QuadraticBezierCurve3.html
+2
-2
docs/api/extras/curves/SplineCurve.html
docs/api/extras/curves/SplineCurve.html
+2
-2
editor/js/libs/tern-threejs/threejs.js
editor/js/libs/tern-threejs/threejs.js
+0
-32
examples/canvas_geometry_shapes.html
examples/canvas_geometry_shapes.html
+2
-2
examples/webgl_geometry_shapes.html
examples/webgl_geometry_shapes.html
+10
-6
examples/webgl_geometry_text_shapes.html
examples/webgl_geometry_text_shapes.html
+5
-4
src/Three.Legacy.js
src/Three.Legacy.js
+46
-0
src/core/BufferGeometry.js
src/core/BufferGeometry.js
+17
-0
src/core/Geometry.js
src/core/Geometry.js
+15
-0
src/extras/core/CurvePath.js
src/extras/core/CurvePath.js
+0
-39
未找到文件。
docs/api/core/BufferGeometry.html
浏览文件 @
e42806c7
...
@@ -316,6 +316,9 @@
...
@@ -316,6 +316,9 @@
<h3>
[method:BufferGeometry setFromObject] ( [page:Object3D object] )
</h3>
<h3>
[method:BufferGeometry setFromObject] ( [page:Object3D object] )
</h3>
<div>
Sets the attributes for this BufferGeometry from an [page:Object3D].
</div>
<div>
Sets the attributes for this BufferGeometry from an [page:Object3D].
</div>
<h3>
[method:BufferGeometry setFromPoints] ( [page:Array points] )
</h3>
<div>
Sets the attributes for this BufferGeometry from an array of points.
</div>
<h3>
[method:Object toJSON]()
</h3>
<h3>
[method:Object toJSON]()
</h3>
<div>
Returns a JSON object representation of the BufferGeometry.
</div>
<div>
Returns a JSON object representation of the BufferGeometry.
</div>
...
...
docs/api/core/Geometry.html
浏览文件 @
e42806c7
...
@@ -315,6 +315,9 @@
...
@@ -315,6 +315,9 @@
Use [page:Object3D.rotation] for typical real-time mesh rotation.
Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
</div>
<h3>
[method:Geometry setFromPoints] ( [page:Array points] )
</h3>
<div>
Sets the vertices for this Geometry from an array of points.
</div>
<h3>
[method:null sortFacesByMaterialIndex] ( )
</h3>
<h3>
[method:null sortFacesByMaterialIndex] ( )
</h3>
<div>
<div>
Sorts the faces array according to material index. For complex geometries with several materials,
Sorts the faces array according to material index. For complex geometries with several materials,
...
...
docs/api/extras/core/CurvePath.html
浏览文件 @
e42806c7
...
@@ -49,29 +49,6 @@
...
@@ -49,29 +49,6 @@
<h3>
[method:null closePath]()
</h3>
<h3>
[method:null closePath]()
</h3>
<div>
Adds a [page:LineCurve lineCurve] to close the path.
</div>
<div>
Adds a [page:LineCurve lineCurve] to close the path.
</div>
<h3>
[method:Geometry createGeometry]( [page:Vector3 points] )
</h3>
<div>
points -- An array of [page:Vector3 Vector3s]
<br
/><br
/>
Creates a geometry from points
</div>
<h3>
[method:Geometry createPointsGeometry]( [page:Integer divisions] )
</h3>
<div>
divisions -- How many segments to create. Defaults to *12*.
<br
/><br
/>
Creates a [page:Geometry] object comprised of [page:Vector3 Vector3s], for example
to be used with [page:Line] or [page:Points]. Uses [page:Curve.getPoints]() for the division.
</div>
<h3>
[method:Geometry createSpacedPointsGeometry]( [page:Integer divisions] )
</h3>
<div>
divisions -- How many segments to create. Defaults to *12*.
<br
/><br
/>
Creates a [page:Geometry] object comprised of [page:Vector3]s that are equidistant, for example
to be used with [page:Line] or [page:Points]. Uses [page:Curve.getSpacedPoints]() for the division.
</div>
<h3>
[method:Float getCurveLengths]()
</h3>
<h3>
[method:Float getCurveLengths]()
</h3>
<div>
Adds together the lengths of the curves in the [page:.curves] array.
</div>
<div>
Adds together the lengths of the curves in the [page:.curves] array.
</div>
...
...
docs/api/extras/curves/CatmullRomCurve3.html
浏览文件 @
e42806c7
...
@@ -27,8 +27,8 @@ var curve = new THREE.CatmullRomCurve3( [
...
@@ -27,8 +27,8 @@ var curve = new THREE.CatmullRomCurve3( [
new THREE.Vector3( 10, 0, 10 )
new THREE.Vector3( 10, 0, 10 )
] );
] );
var
geometry = new THREE.Geometry(
);
var
points = curve.getPoints( 50
);
geometry.vertices = curve.getPoints( 50
);
var geometry = new THREE.BufferGeometry().setFromPoints( points
);
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
...
...
docs/api/extras/curves/CubicBezierCurve.html
浏览文件 @
e42806c7
...
@@ -28,9 +28,9 @@ var curve = new THREE.CubicBezierCurve(
...
@@ -28,9 +28,9 @@ var curve = new THREE.CubicBezierCurve(
new THREE.Vector2( 10, 0 )
new THREE.Vector2( 10, 0 )
);
);
var path = new THREE.Path( curve.getPoints( 50 ) );
var points = curve.getPoints( 50 );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var geometry = path.createPointsGeometry( 50 );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
// Create the final object to add to the scene
...
...
docs/api/extras/curves/CubicBezierCurve3.html
浏览文件 @
e42806c7
...
@@ -28,8 +28,8 @@ var curve = new THREE.CubicBezierCurve3(
...
@@ -28,8 +28,8 @@ var curve = new THREE.CubicBezierCurve3(
new THREE.Vector3( 10, 0, 0 )
new THREE.Vector3( 10, 0, 0 )
);
);
var
geometry = new THREE.Geometry(
);
var
points = curve.getPoints( 50
);
geometry.vertices = curve.getPoints( 50
);
var geometry = new THREE.BufferGeometry().setFromPoints( points
);
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
...
...
docs/api/extras/curves/EllipseCurve.html
浏览文件 @
e42806c7
...
@@ -28,8 +28,9 @@ var curve = new THREE.EllipseCurve(
...
@@ -28,8 +28,9 @@ var curve = new THREE.EllipseCurve(
0 // aRotation
0 // aRotation
);
);
var path = new THREE.Path( curve.getPoints( 50 ) );
var points = curve.getPoints( 50 );
var geometry = path.createPointsGeometry( 50 );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
// Create the final object to add to the scene
...
...
docs/api/extras/curves/QuadraticBezierCurve.html
浏览文件 @
e42806c7
...
@@ -27,9 +27,9 @@ var curve = new THREE.QuadraticBezierCurve(
...
@@ -27,9 +27,9 @@ var curve = new THREE.QuadraticBezierCurve(
new THREE.Vector2( 10, 0 )
new THREE.Vector2( 10, 0 )
);
);
var path = new THREE.Path( curve.getPoints( 50 ) );
var points = curve.getPoints( 50 );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var geometry = path.createPointsGeometry( 50 );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
//Create the final object to add to the scene
//Create the final object to add to the scene
...
...
docs/api/extras/curves/QuadraticBezierCurve3.html
浏览文件 @
e42806c7
...
@@ -27,8 +27,8 @@ var curve = new THREE.QuadraticBezierCurve3(
...
@@ -27,8 +27,8 @@ var curve = new THREE.QuadraticBezierCurve3(
new THREE.Vector3( 10, 0, 0 )
new THREE.Vector3( 10, 0, 0 )
);
);
var
geometry = new THREE.Geometry(
);
var
points = curve.getPoints( 50
);
geometry.vertices = curve.getPoints( 50
);
var geometry = new THREE.BufferGeometry().setFromPoints( points
);
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
...
...
docs/api/extras/curves/SplineCurve.html
浏览文件 @
e42806c7
...
@@ -29,9 +29,9 @@ var curve = new THREE.SplineCurve( [
...
@@ -29,9 +29,9 @@ var curve = new THREE.SplineCurve( [
new THREE.Vector2( 10, 0 )
new THREE.Vector2( 10, 0 )
] );
] );
var path = new THREE.Path( curve.getPoints( 50 ) );
var points = curve.getPoints( 50 );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var geometry = path.createPointsGeometry( 50 );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
// Create the final object to add to the scene
...
...
editor/js/libs/tern-threejs/threejs.js
浏览文件 @
e42806c7
...
@@ -924,34 +924,10 @@
...
@@ -924,34 +924,10 @@
"
!type
"
:
"
boolean
"
,
"
!type
"
:
"
boolean
"
,
"
!doc
"
:
"
todo
"
"
!doc
"
:
"
todo
"
},
},
"
getWrapPoints
"
:
{
"
!type
"
:
"
fn(oldPts: todo, path: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
createPointsGeometry
"
:
{
"
!type
"
:
"
fn(divisions: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
addWrapPath
"
:
{
"
!type
"
:
"
fn(bendpath: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
createGeometry
"
:
{
"
!type
"
:
"
fn(points: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
add
"
:
{
"
add
"
:
{
"
!type
"
:
"
fn(curve: todo) -> todo
"
,
"
!type
"
:
"
fn(curve: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
"
!doc
"
:
"
todo
"
},
},
"
getTransformedSpacedPoints
"
:
{
"
!type
"
:
"
fn(segments: todo, bends: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
createSpacedPointsGeometry
"
:
{
"
!type
"
:
"
fn(divisions: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
closePath
"
:
{
"
closePath
"
:
{
"
!type
"
:
"
fn() -> todo
"
,
"
!type
"
:
"
fn() -> todo
"
,
"
!doc
"
:
"
todo
"
"
!doc
"
:
"
todo
"
...
@@ -963,14 +939,6 @@
...
@@ -963,14 +939,6 @@
"
getCurveLengths
"
:
{
"
getCurveLengths
"
:
{
"
!type
"
:
"
fn() -> todo
"
,
"
!type
"
:
"
fn() -> todo
"
,
"
!doc
"
:
"
todo
"
"
!doc
"
:
"
todo
"
},
"
getTransformedPoints
"
:
{
"
!type
"
:
"
fn(segments: todo, bends: todo) -> todo
"
,
"
!doc
"
:
"
todo
"
},
"
checkConnection
"
:
{
"
!type
"
:
"
fn() -> todo
"
,
"
!doc
"
:
"
todo
"
}
}
},
},
"
!doc
"
:
"
todo
"
,
"
!doc
"
:
"
todo
"
,
...
...
examples/canvas_geometry_shapes.html
浏览文件 @
e42806c7
...
@@ -82,8 +82,8 @@
...
@@ -82,8 +82,8 @@
// line
// line
var
geometry
=
shape
.
createPointsGeometry
();
var
points
=
shape
.
getPoints
();
geometry
.
vertices
.
push
(
geometry
.
vertices
[
0
].
clone
()
);
var
geometry
=
new
THREE
.
Geometry
().
setFromPoints
(
points
);
var
material
=
new
THREE
.
LineBasicMaterial
(
{
linewidth
:
10
,
color
:
0x333333
,
transparent
:
true
}
);
var
material
=
new
THREE
.
LineBasicMaterial
(
{
linewidth
:
10
,
color
:
0x333333
,
transparent
:
true
}
);
...
...
examples/webgl_geometry_shapes.html
浏览文件 @
e42806c7
...
@@ -114,12 +114,16 @@
...
@@ -114,12 +114,16 @@
// lines
// lines
shape
.
autoClose
=
true
;
shape
.
autoClose
=
true
;
var
points
=
shape
.
createPointsGeometry
();
var
spacedPoints
=
shape
.
createSpacedPointsGeometry
(
50
);
var
points
=
shape
.
getPoints
();
var
spacedPoints
=
shape
.
getSpacedPoints
(
50
);
var
geometryPoints
=
new
THREE
.
BufferGeometry
().
setFromPoints
(
points
);
var
geometrySpacedPoints
=
new
THREE
.
BufferGeometry
().
setFromPoints
(
spacedPoints
);
// solid line
// solid line
var
line
=
new
THREE
.
Line
(
p
oints
,
new
THREE
.
LineBasicMaterial
(
{
color
:
color
,
linewidth
:
3
}
)
);
var
line
=
new
THREE
.
Line
(
geometryP
oints
,
new
THREE
.
LineBasicMaterial
(
{
color
:
color
,
linewidth
:
3
}
)
);
line
.
position
.
set
(
x
,
y
,
z
-
25
);
line
.
position
.
set
(
x
,
y
,
z
-
25
);
line
.
rotation
.
set
(
rx
,
ry
,
rz
);
line
.
rotation
.
set
(
rx
,
ry
,
rz
);
line
.
scale
.
set
(
s
,
s
,
s
);
line
.
scale
.
set
(
s
,
s
,
s
);
...
@@ -127,7 +131,7 @@
...
@@ -127,7 +131,7 @@
// line from equidistance sampled points
// line from equidistance sampled points
var
line
=
new
THREE
.
Line
(
s
pacedPoints
,
new
THREE
.
LineBasicMaterial
(
{
color
:
color
,
linewidth
:
3
}
)
);
var
line
=
new
THREE
.
Line
(
geometryS
pacedPoints
,
new
THREE
.
LineBasicMaterial
(
{
color
:
color
,
linewidth
:
3
}
)
);
line
.
position
.
set
(
x
,
y
,
z
+
25
);
line
.
position
.
set
(
x
,
y
,
z
+
25
);
line
.
rotation
.
set
(
rx
,
ry
,
rz
);
line
.
rotation
.
set
(
rx
,
ry
,
rz
);
line
.
scale
.
set
(
s
,
s
,
s
);
line
.
scale
.
set
(
s
,
s
,
s
);
...
@@ -135,7 +139,7 @@
...
@@ -135,7 +139,7 @@
// vertices from real points
// vertices from real points
var
particles
=
new
THREE
.
Points
(
p
oints
,
new
THREE
.
PointsMaterial
(
{
color
:
color
,
size
:
4
}
)
);
var
particles
=
new
THREE
.
Points
(
geometryP
oints
,
new
THREE
.
PointsMaterial
(
{
color
:
color
,
size
:
4
}
)
);
particles
.
position
.
set
(
x
,
y
,
z
+
75
);
particles
.
position
.
set
(
x
,
y
,
z
+
75
);
particles
.
rotation
.
set
(
rx
,
ry
,
rz
);
particles
.
rotation
.
set
(
rx
,
ry
,
rz
);
particles
.
scale
.
set
(
s
,
s
,
s
);
particles
.
scale
.
set
(
s
,
s
,
s
);
...
@@ -143,7 +147,7 @@
...
@@ -143,7 +147,7 @@
// equidistance sampled points
// equidistance sampled points
var
particles
=
new
THREE
.
Points
(
s
pacedPoints
,
new
THREE
.
PointsMaterial
(
{
color
:
color
,
size
:
4
}
)
);
var
particles
=
new
THREE
.
Points
(
geometryS
pacedPoints
,
new
THREE
.
PointsMaterial
(
{
color
:
color
,
size
:
4
}
)
);
particles
.
position
.
set
(
x
,
y
,
z
+
125
);
particles
.
position
.
set
(
x
,
y
,
z
+
125
);
particles
.
rotation
.
set
(
rx
,
ry
,
rz
);
particles
.
rotation
.
set
(
rx
,
ry
,
rz
);
particles
.
scale
.
set
(
s
,
s
,
s
);
particles
.
scale
.
set
(
s
,
s
,
s
);
...
...
examples/webgl_geometry_text_shapes.html
浏览文件 @
e42806c7
...
@@ -116,11 +116,12 @@
...
@@ -116,11 +116,12 @@
var
shape
=
shapes
[
i
];
var
shape
=
shapes
[
i
];
var
lineGeometry
=
shape
.
createPointsGeometry
();
var
points
=
shape
.
getPoints
();
var
geometry
=
new
THREE
.
BufferGeometry
().
setFromPoints
(
points
);
geometry
.
translate
(
xMid
,
0
,
0
);
lineGeometry
.
translate
(
xMid
,
0
,
0
);
var
lineMesh
=
new
THREE
.
Line
(
geometry
,
matDark
);
var
lineMesh
=
new
THREE
.
Line
(
lineGeometry
,
matDark
);
lineText
.
add
(
lineMesh
);
lineText
.
add
(
lineMesh
);
}
}
...
...
src/Three.Legacy.js
浏览文件 @
e42806c7
...
@@ -24,6 +24,7 @@ import { Geometry } from './core/Geometry.js';
...
@@ -24,6 +24,7 @@ import { Geometry } from './core/Geometry.js';
import
{
Object3D
}
from
'
./core/Object3D.js
'
;
import
{
Object3D
}
from
'
./core/Object3D.js
'
;
import
{
Uniform
}
from
'
./core/Uniform.js
'
;
import
{
Uniform
}
from
'
./core/Uniform.js
'
;
import
{
Curve
}
from
'
./extras/core/Curve.js
'
;
import
{
Curve
}
from
'
./extras/core/Curve.js
'
;
import
{
CurvePath
}
from
'
./extras/core/CurvePath.js
'
;
import
{
CatmullRomCurve3
}
from
'
./extras/curves/CatmullRomCurve3.js
'
;
import
{
CatmullRomCurve3
}
from
'
./extras/curves/CatmullRomCurve3.js
'
;
import
{
AxesHelper
}
from
'
./helpers/AxesHelper.js
'
;
import
{
AxesHelper
}
from
'
./helpers/AxesHelper.js
'
;
import
{
BoxHelper
}
from
'
./helpers/BoxHelper.js
'
;
import
{
BoxHelper
}
from
'
./helpers/BoxHelper.js
'
;
...
@@ -242,6 +243,51 @@ Curve.create = function ( construct, getPoint ) {
...
@@ -242,6 +243,51 @@ Curve.create = function ( construct, getPoint ) {
//
//
Object
.
assign
(
CurvePath
.
prototype
,
{
createPointsGeometry
:
function
(
divisions
)
{
console
.
warn
(
'
THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.
'
);
// generate geometry from path points (for Line or Points objects)
var
pts
=
this
.
getPoints
(
divisions
);
return
this
.
createGeometry
(
pts
);
},
createSpacedPointsGeometry
:
function
(
divisions
)
{
console
.
warn
(
'
THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.
'
);
// generate geometry from equidistant sampling along the path
var
pts
=
this
.
getSpacedPoints
(
divisions
);
return
this
.
createGeometry
(
pts
);
},
createGeometry
:
function
(
points
)
{
console
.
warn
(
'
THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.
'
);
var
geometry
=
new
Geometry
();
for
(
var
i
=
0
,
l
=
points
.
length
;
i
<
l
;
i
++
)
{
var
point
=
points
[
i
];
geometry
.
vertices
.
push
(
new
Vector3
(
point
.
x
,
point
.
y
,
point
.
z
||
0
)
);
}
return
geometry
;
}
}
);
//
export
function
ClosedSplineCurve3
(
points
)
{
export
function
ClosedSplineCurve3
(
points
)
{
console
.
warn
(
'
THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.
'
);
console
.
warn
(
'
THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.
'
);
...
...
src/core/BufferGeometry.js
浏览文件 @
e42806c7
...
@@ -334,6 +334,23 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
...
@@ -334,6 +334,23 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
},
},
setFromPoints
:
function
(
points
)
{
var
position
=
[];
for
(
var
i
=
0
,
l
=
points
.
length
;
i
<
l
;
i
++
)
{
var
point
=
points
[
i
];
position
.
push
(
point
.
x
,
point
.
y
,
point
.
z
||
0
);
}
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
position
,
3
)
);
return
this
;
},
updateFromObject
:
function
(
object
)
{
updateFromObject
:
function
(
object
)
{
var
geometry
=
object
.
geometry
;
var
geometry
=
object
.
geometry
;
...
...
src/core/Geometry.js
浏览文件 @
e42806c7
...
@@ -921,6 +921,21 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
...
@@ -921,6 +921,21 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
},
},
setFromPoints
:
function
(
points
)
{
this
.
vertices
=
[];
for
(
var
i
=
0
,
l
=
points
.
length
;
i
<
l
;
i
++
)
{
var
point
=
points
[
i
];
this
.
vertices
.
push
(
new
Vector3
(
point
.
x
,
point
.
y
,
point
.
z
||
0
)
);
}
return
this
;
},
sortFacesByMaterialIndex
:
function
()
{
sortFacesByMaterialIndex
:
function
()
{
var
faces
=
this
.
faces
;
var
faces
=
this
.
faces
;
...
...
src/extras/core/CurvePath.js
浏览文件 @
e42806c7
import
{
Curve
}
from
'
./Curve.js
'
;
import
{
Curve
}
from
'
./Curve.js
'
;
import
{
Vector3
}
from
'
../../math/Vector3.js
'
;
import
{
Geometry
}
from
'
../../core/Geometry.js
'
;
import
{
LineCurve
}
from
'
../curves/LineCurve.js
'
;
import
{
LineCurve
}
from
'
../curves/LineCurve.js
'
;
/**
/**
...
@@ -198,43 +196,6 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {
...
@@ -198,43 +196,6 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {
return
points
;
return
points
;
},
/**************************************************************
* Create Geometries Helpers
**************************************************************/
/// Generate geometry from path points (for Line or Points objects)
createPointsGeometry
:
function
(
divisions
)
{
var
pts
=
this
.
getPoints
(
divisions
);
return
this
.
createGeometry
(
pts
);
},
// Generate geometry from equidistant sampling along the path
createSpacedPointsGeometry
:
function
(
divisions
)
{
var
pts
=
this
.
getSpacedPoints
(
divisions
);
return
this
.
createGeometry
(
pts
);
},
createGeometry
:
function
(
points
)
{
var
geometry
=
new
Geometry
();
for
(
var
i
=
0
,
l
=
points
.
length
;
i
<
l
;
i
++
)
{
var
point
=
points
[
i
];
geometry
.
vertices
.
push
(
new
Vector3
(
point
.
x
,
point
.
y
,
point
.
z
||
0
)
);
}
return
geometry
;
}
}
}
);
}
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录