Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
efbb018f
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,发现更多精彩内容 >>
提交
efbb018f
编写于
5月 29, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JSM: Added module and TS file for ConvexHull and ConvexGeometry.
上级
10ac56be
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1514 addition
and
0 deletion
+1514
-0
docs/manual/en/introduction/Import-via-modules.html
docs/manual/en/introduction/Import-via-modules.html
+2
-0
examples/jsm/geometries/ConvexGeometry.d.ts
examples/jsm/geometries/ConvexGeometry.d.ts
+13
-0
examples/jsm/geometries/ConvexGeometry.js
examples/jsm/geometries/ConvexGeometry.js
+79
-0
examples/jsm/math/ConvexHull.d.ts
examples/jsm/math/ConvexHull.d.ts
+93
-0
examples/jsm/math/ConvexHull.js
examples/jsm/math/ConvexHull.js
+1325
-0
utils/modularize.js
utils/modularize.js
+2
-0
未找到文件。
docs/manual/en/introduction/Import-via-modules.html
浏览文件 @
efbb018f
...
...
@@ -127,6 +127,7 @@
<li>
geometries
<ul>
<li>
BoxLineGeometry
</li>
<li>
ConvexGeometry
</li>
<li>
DecalGeometry
</li>
<li>
ParametricGeometries
</li>
<li>
TeapotBufferGeometry
</li>
...
...
@@ -164,6 +165,7 @@
<li>
math
<ul>
<li>
ColorConverter
</li>
<li>
ConvexHull
</li>
<li>
ImprovedNoise
</li>
<li>
Lut
</li>
<li>
SimplexNoise
</li>
...
...
examples/jsm/geometries/ConvexGeometry.d.ts
0 → 100644
浏览文件 @
efbb018f
import
{
BufferGeometry
,
Geometry
,
Vector3
}
from
'
../../../src/Three
'
;
export
class
ConvexGeometry
extends
Geometry
{
constructor
(
points
:
Vector3
[]);
}
export
class
ConvexBufferGeometry
extends
BufferGeometry
{
constructor
(
points
:
Vector3
[]);
}
examples/jsm/geometries/ConvexGeometry.js
0 → 100644
浏览文件 @
efbb018f
/**
* @author Mugen87 / https://github.com/Mugen87
*/
import
{
BufferGeometry
,
Float32BufferAttribute
,
Geometry
}
from
"
../../../build/three.module.js
"
;
import
{
ConvexHull
}
from
"
../math/ConvexHull.js
"
;
// ConvexGeometry
var
ConvexGeometry
=
function
(
points
)
{
Geometry
.
call
(
this
);
this
.
fromBufferGeometry
(
new
ConvexBufferGeometry
(
points
)
);
this
.
mergeVertices
();
};
ConvexGeometry
.
prototype
=
Object
.
create
(
Geometry
.
prototype
);
ConvexGeometry
.
prototype
.
constructor
=
ConvexGeometry
;
// ConvexBufferGeometry
var
ConvexBufferGeometry
=
function
(
points
)
{
BufferGeometry
.
call
(
this
);
// buffers
var
vertices
=
[];
var
normals
=
[];
if
(
ConvexHull
===
undefined
)
{
console
.
error
(
'
THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on ConvexHull
'
);
}
var
convexHull
=
new
ConvexHull
().
setFromPoints
(
points
);
// generate vertices and normals
var
faces
=
convexHull
.
faces
;
for
(
var
i
=
0
;
i
<
faces
.
length
;
i
++
)
{
var
face
=
faces
[
i
];
var
edge
=
face
.
edge
;
// we move along a doubly-connected edge list to access all face points (see HalfEdge docs)
do
{
var
point
=
edge
.
head
().
point
;
vertices
.
push
(
point
.
x
,
point
.
y
,
point
.
z
);
normals
.
push
(
face
.
normal
.
x
,
face
.
normal
.
y
,
face
.
normal
.
z
);
edge
=
edge
.
next
;
}
while
(
edge
!==
face
.
edge
);
}
// build geometry
this
.
addAttribute
(
'
position
'
,
new
Float32BufferAttribute
(
vertices
,
3
)
);
this
.
addAttribute
(
'
normal
'
,
new
Float32BufferAttribute
(
normals
,
3
)
);
};
ConvexBufferGeometry
.
prototype
=
Object
.
create
(
BufferGeometry
.
prototype
);
ConvexBufferGeometry
.
prototype
.
constructor
=
ConvexBufferGeometry
;
export
{
ConvexGeometry
,
ConvexBufferGeometry
};
examples/jsm/math/ConvexHull.d.ts
0 → 100644
浏览文件 @
efbb018f
import
{
Object3D
,
Ray
,
Vector3
}
from
'
../../../src/Three
'
;
declare
class
Face
{
constructor
();
normal
:
Vector3
;
midpoint
:
Vector3
;
area
:
number
;
constant
:
number
;
outside
:
VertexNode
;
mark
:
number
;
edge
:
HalfEdge
;
static
create
(
a
:
VertexNode
,
b
:
VertexNode
,
c
:
VertexNode
):
Face
;
compute
():
this
;
getEdge
(
i
:
number
):
HalfEdge
;
}
declare
class
HalfEdge
{
constructor
(
vertex
:
VertexNode
,
face
:
Face
);
vertex
:
VertexNode
;
prev
:
HalfEdge
;
next
:
HalfEdge
;
twin
:
HalfEdge
;
face
:
Face
;
head
():
VertexNode
;
length
():
number
;
lengthSquared
():
number
;
setTwin
(
edge
:
HalfEdge
):
this
;
tail
():
VertexNode
;
}
declare
class
VertexNode
{
constructor
(
point
:
Vector3
);
point
:
Vector3
;
prev
:
VertexNode
;
next
:
VertexNode
;
face
:
Face
;
}
declare
class
VertexList
{
constructor
();
head
:
VertexNode
;
tail
:
VertexNode
;
append
(
vertex
:
VertexNode
):
this
;
appendChain
(
vertex
:
VertexNode
):
this
;
clear
():
this
;
first
():
VertexNode
;
insertAfter
(
target
:
VertexNode
,
vertex
:
VertexNode
):
this
;
insertBefore
(
target
:
VertexNode
,
vertex
:
VertexNode
):
this
;
isEmpty
():
boolean
;
last
():
VertexNode
;
remove
(
vertex
:
VertexNode
):
this
;
removeSubList
(
a
:
VertexNode
,
b
:
VertexNode
):
this
;
}
export
class
ConvexHull
{
constructor
();
tolerance
:
number
;
faces
:
Face
[];
newFaces
:
Face
[];
assigned
:
VertexList
;
unassigned
:
VertexList
;
vertices
:
VertexNode
[];
addAdjoiningFace
(
eyeVertex
:
VertexNode
,
horizonEdge
:
HalfEdge
):
HalfEdge
;
addNewFaces
(
eyeVertex
:
VertexNode
,
horizon
:
HalfEdge
[]):
this
;
addVertexToFace
(
vertex
:
VertexNode
,
face
:
Face
):
this
;
addVertexToHull
(
eyeVertex
:
VertexNode
):
this
;
cleanup
():
this
;
compute
():
this
;
computeExtremes
():
object
;
computeHorizon
(
eyePoint
:
Vector3
,
crossEdge
:
HalfEdge
,
face
:
Face
,
horizon
:
HalfEdge
[]):
this
;
computeInitialHull
():
this
;
containsPoint
(
point
:
Vector3
):
boolean
;
deleteFaceVertices
(
face
:
Face
,
absorbingFace
:
Face
):
this
;
intersectRay
(
ray
:
Ray
,
target
:
Vector3
):
Vector3
|
null
;
intersectsRay
(
ray
:
Ray
):
boolean
;
makeEmpty
():
this
;
nextVertexToAdd
():
VertexNode
|
undefined
;
reindexFaces
():
this
;
removeAllVerticesFromFace
(
face
:
Face
):
VertexNode
|
undefined
;
removeVertexFromFace
(
vertex
:
VertexNode
,
face
:
Face
):
this
;
resolveUnassignedPoints
(
newFaces
:
Face
[]):
this
;
setFromPoints
(
points
:
Vector3
[]):
this
;
setFromObject
(
object
:
Object3D
):
this
;
}
examples/jsm/math/ConvexHull.js
0 → 100644
浏览文件 @
efbb018f
此差异已折叠。
点击以展开。
utils/modularize.js
浏览文件 @
efbb018f
...
...
@@ -43,6 +43,7 @@ var files = [
{
path
:
'
exporters/TypedGeometryExporter.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
geometries/BoxLineGeometry.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
geometries/ConvexGeometry.js
'
,
dependencies
:
[
{
name
:
'
ConvexHull
'
,
path
:
'
math/ConvexHull.js
'
}
],
ignoreList
:
[]
},
{
path
:
'
geometries/DecalGeometry.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
geometries/ParametricGeometries.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
geometries/TeapotBufferGeometry.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
...
...
@@ -74,6 +75,7 @@ var files = [
{
path
:
'
loaders/VRMLLoader.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
math/ColorConverter.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
math/ConvexHull.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
math/ImprovedNoise.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
math/Lut.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
{
path
:
'
math/SimplexNoise.js
'
,
dependencies
:
[],
ignoreList
:
[]
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录