Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
02961c58
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,发现更多精彩内容 >>
提交
02961c58
编写于
3月 28, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
b70137f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
8 deletion
+6
-8
build/three.js
build/three.js
+4
-6
build/three.min.js
build/three.min.js
+2
-2
未找到文件。
build/three.js
浏览文件 @
02961c58
...
...
@@ -30498,15 +30498,13 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
function toShapesNoHoles( inSubpaths ) {
var i, il;
var tmpPath, tmpShape;
var shapes = [];
for ( i = 0, il = inSubpaths.length; i < il; i ++ ) {
for (
var
i = 0, il = inSubpaths.length; i < il; i ++ ) {
tmpPath = inSubpaths[ i ];
var
tmpPath = inSubpaths[ i ];
tmpShape = new THREE.Shape();
var
tmpShape = new THREE.Shape();
tmpShape.actions = tmpPath.actions;
tmpShape.curves = tmpPath.curves;
...
...
@@ -30567,7 +30565,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
var subPaths = extractSubpaths( this.actions );
if ( subPaths.length == 0 ) return [];
if ( noHoles ) return toShapesNoHoles( subPaths );
if ( noHoles
=== true
) return toShapesNoHoles( subPaths );
var solid, tmpPath, tmpShape, shapes = [];
...
...
build/three.min.js
浏览文件 @
02961c58
...
...
@@ -587,8 +587,8 @@ THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return cons
u
=
g
.
y
):(
g
=
this
.
actions
[
d
-
1
].
args
,
r
=
g
[
g
.
length
-
2
],
u
=
g
[
g
.
length
-
1
]);
for
(
f
=
1
;
f
<=
a
;
f
++
)
s
=
f
/
a
,
g
=
THREE
.
Shape
.
Utils
.
b2
(
s
,
r
,
q
,
h
),
s
=
THREE
.
Shape
.
Utils
.
b2
(
s
,
u
,
p
,
k
),
c
.
push
(
new
THREE
.
Vector2
(
g
,
s
));
break
;
case
THREE
.
PathActions
.
BEZIER_CURVE_TO
:
h
=
f
[
4
];
k
=
f
[
5
];
q
=
f
[
0
];
p
=
f
[
1
];
l
=
f
[
2
];
n
=
f
[
3
];
0
<
c
.
length
?(
g
=
c
[
c
.
length
-
1
],
r
=
g
.
x
,
u
=
g
.
y
):(
g
=
this
.
actions
[
d
-
1
].
args
,
r
=
g
[
g
.
length
-
2
],
u
=
g
[
g
.
length
-
1
]);
for
(
f
=
1
;
f
<=
a
;
f
++
)
s
=
f
/
a
,
g
=
THREE
.
Shape
.
Utils
.
b3
(
s
,
r
,
q
,
l
,
h
),
s
=
THREE
.
Shape
.
Utils
.
b3
(
s
,
u
,
p
,
n
,
k
),
c
.
push
(
new
THREE
.
Vector2
(
g
,
s
));
break
;
case
THREE
.
PathActions
.
CSPLINE_THRU
:
g
=
this
.
actions
[
d
-
1
].
args
;
s
=
[
new
THREE
.
Vector2
(
g
[
g
.
length
-
2
],
g
[
g
.
length
-
1
])];
g
=
a
*
f
[
0
].
length
;
s
=
s
.
concat
(
f
[
0
]);
s
=
new
THREE
.
SplineCurve
(
s
);
for
(
f
=
1
;
f
<=
g
;
f
++
)
c
.
push
(
s
.
getPointAt
(
f
/
g
));
break
;
case
THREE
.
PathActions
.
ARC
:
h
=
f
[
0
];
k
=
f
[
1
];
p
=
f
[
2
];
l
=
f
[
3
];
g
=
f
[
4
];
q
=!!
f
[
5
];
r
=
g
-
l
;
u
=
2
*
a
;
for
(
f
=
1
;
f
<=
u
;
f
++
)
s
=
f
/
u
,
q
||
(
s
=
1
-
s
),
s
=
l
+
s
*
r
,
g
=
h
+
p
*
Math
.
cos
(
s
),
s
=
k
+
p
*
Math
.
sin
(
s
),
c
.
push
(
new
THREE
.
Vector2
(
g
,
s
));
break
;
case
THREE
.
PathActions
.
ELLIPSE
:
for
(
h
=
f
[
0
],
k
=
f
[
1
],
p
=
f
[
2
],
n
=
f
[
3
],
l
=
f
[
4
],
g
=
f
[
5
],
q
=!!
f
[
6
],
r
=
g
-
l
,
u
=
2
*
a
,
f
=
1
;
f
<=
u
;
f
++
)
s
=
f
/
u
,
q
||
(
s
=
1
-
s
),
s
=
l
+
s
*
r
,
g
=
h
+
p
*
Math
.
cos
(
s
),
s
=
k
+
n
*
Math
.
sin
(
s
),
c
.
push
(
new
THREE
.
Vector2
(
g
,
s
))}
d
=
c
[
c
.
length
-
1
];
1
E
-
10
>
Math
.
abs
(
d
.
x
-
c
[
0
].
x
)
&&
1
E
-
10
>
Math
.
abs
(
d
.
y
-
c
[
0
].
y
)
&&
c
.
splice
(
c
.
length
-
1
,
1
);
b
&&
c
.
push
(
c
[
0
]);
return
c
};
THREE
.
Path
.
prototype
.
toShapes
=
function
(
a
,
b
){
function
c
(
a
){
var
b
,
c
,
d
,
e
,
f
=
[];
b
=
0
;
for
(
c
=
a
.
length
;
b
<
c
;
b
++
)
d
=
a
[
b
],
e
=
new
THREE
.
Shape
,
e
.
actions
=
d
.
actions
,
e
.
curves
=
d
.
curves
,
f
.
push
(
e
);
return
f
}
function
d
(
a
,
b
){
for
(
var
c
=
b
.
length
,
d
=!
1
,
e
=
c
-
1
,
f
=
0
;
f
<
c
;
e
=
f
++
){
var
g
=
b
[
e
],
h
=
b
[
f
],
k
=
h
.
x
-
g
.
x
,
l
=
h
.
y
-
g
.
y
;
if
(
1
E
-
10
<
Math
.
abs
(
l
)){
if
(
0
>
l
&&
(
g
=
b
[
f
],
k
=-
k
,
h
=
b
[
e
],
l
=-
l
),
!
(
a
.
y
<
g
.
y
||
a
.
y
>
h
.
y
))
if
(
a
.
y
==
g
.
y
){
if
(
a
.
x
==
g
.
x
)
return
!
0
}
else
{
e
=
l
*
(
a
.
x
-
g
.
x
)
-
k
*
(
a
.
y
-
g
.
y
);
if
(
0
==
e
)
return
!
0
;
0
>
e
||
(
d
=!
d
)}}
else
if
(
a
.
y
==
g
.
y
&&
(
h
.
x
<=
a
.
x
&&
a
.
x
<=
g
.
x
||
g
.
x
<=
a
.
x
&&
a
.
x
<=
h
.
x
))
return
!
0
}
return
d
}
var
e
=
function
(
a
){
var
b
,
c
,
d
,
e
,
f
=
[],
g
=
new
THREE
.
Path
;
b
=
0
;
for
(
c
=
a
.
length
;
b
<
c
;
b
++
)
d
=
a
[
b
],
e
=
d
.
args
,
d
=
d
.
action
,
d
==
THREE
.
PathActions
.
MOVE_TO
&&
0
!=
g
.
actions
.
length
&&
(
f
.
push
(
g
),
g
=
new
THREE
.
Path
),
g
[
d
].
apply
(
g
,
e
);
0
!=
g
.
actions
.
length
&&
f
.
push
(
g
);
return
f
}(
this
.
actions
);
if
(
0
==
e
.
length
)
return
[];
if
(
b
)
return
c
(
e
);
var
f
,
g
,
h
,
k
=
[];
if
(
1
==
e
.
length
)
return
g
=
e
[
0
],
h
=
new
THREE
.
Shape
,
h
.
actions
=
g
.
actions
,
h
.
curves
=
g
.
curves
,
k
.
push
(
h
),
k
;
var
l
=!
THREE
.
Shape
.
Utils
.
isClockWise
(
e
[
0
].
getPoints
()),
l
=
a
?
!
l
:
l
;
THREE
.
Path
.
prototype
.
toShapes
=
function
(
a
,
b
){
function
c
(
a
){
for
(
var
b
=
[],
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
){
var
e
=
a
[
c
],
f
=
new
THREE
.
Shape
;
f
.
actions
=
e
.
actions
;
f
.
curves
=
e
.
curves
;
b
.
push
(
f
)}
return
b
}
function
d
(
a
,
b
){
for
(
var
c
=
b
.
length
,
d
=!
1
,
e
=
c
-
1
,
f
=
0
;
f
<
c
;
e
=
f
++
){
var
g
=
b
[
e
],
h
=
b
[
f
],
k
=
h
.
x
-
g
.
x
,
l
=
h
.
y
-
g
.
y
;
if
(
1
E
-
10
<
Math
.
abs
(
l
)){
if
(
0
>
l
&&
(
g
=
b
[
f
],
k
=-
k
,
h
=
b
[
e
],
l
=-
l
),
!
(
a
.
y
<
g
.
y
||
a
.
y
>
h
.
y
))
if
(
a
.
y
==
g
.
y
){
if
(
a
.
x
==
g
.
x
)
return
!
0
}
else
{
e
=
l
*
(
a
.
x
-
g
.
x
)
-
k
*
(
a
.
y
-
g
.
y
);
if
(
0
==
e
)
return
!
0
;
0
>
e
||
(
d
=!
d
)}}
else
if
(
a
.
y
==
g
.
y
&&
(
h
.
x
<=
a
.
x
&&
a
.
x
<=
g
.
x
||
g
.
x
<=
a
.
x
&&
a
.
x
<=
h
.
x
))
return
!
0
}
return
d
}
var
e
=
function
(
a
){
var
b
,
c
,
d
,
e
,
f
=
[],
g
=
new
THREE
.
Path
;
b
=
0
;
for
(
c
=
a
.
length
;
b
<
c
;
b
++
)
d
=
a
[
b
],
e
=
d
.
args
,
d
=
d
.
action
,
d
==
THREE
.
PathActions
.
MOVE_TO
&&
0
!=
g
.
actions
.
length
&&
(
f
.
push
(
g
),
g
=
new
THREE
.
Path
),
g
[
d
].
apply
(
g
,
e
);
0
!=
g
.
actions
.
length
&&
f
.
push
(
g
);
return
f
}(
this
.
actions
);
if
(
0
==
e
.
length
)
return
[];
if
(
!
0
===
b
)
return
c
(
e
);
var
f
,
g
,
h
,
k
=
[];
if
(
1
==
e
.
length
)
return
g
=
e
[
0
],
h
=
new
THREE
.
Shape
,
h
.
actions
=
g
.
actions
,
h
.
curves
=
g
.
curves
,
k
.
push
(
h
),
k
;
var
l
=!
THREE
.
Shape
.
Utils
.
isClockWise
(
e
[
0
].
getPoints
()),
l
=
a
?
!
l
:
l
;
h
=
[];
var
n
=
[],
q
=
[],
p
=
0
,
r
;
n
[
p
]
=
void
0
;
q
[
p
]
=
[];
var
u
,
s
;
u
=
0
;
for
(
s
=
e
.
length
;
u
<
s
;
u
++
)
g
=
e
[
u
],
r
=
g
.
getPoints
(),
f
=
THREE
.
Shape
.
Utils
.
isClockWise
(
r
),(
f
=
a
?
!
f
:
f
)?(
!
l
&&
n
[
p
]
&&
p
++
,
n
[
p
]
=
{
s
:
new
THREE
.
Shape
,
p
:
r
},
n
[
p
].
s
.
actions
=
g
.
actions
,
n
[
p
].
s
.
curves
=
g
.
curves
,
l
&&
p
++
,
q
[
p
]
=
[]):
q
[
p
].
push
({
h
:
g
,
p
:
r
[
0
]});
if
(
!
n
[
0
])
return
c
(
e
);
if
(
1
<
n
.
length
){
u
=!
1
;
s
=
[];
g
=
0
;
for
(
e
=
n
.
length
;
g
<
e
;
g
++
)
h
[
g
]
=
[];
g
=
0
;
for
(
e
=
n
.
length
;
g
<
e
;
g
++
)
for
(
f
=
q
[
g
],
l
=
0
;
l
<
f
.
length
;
l
++
){
p
=
f
[
l
];
r
=!
0
;
for
(
var
v
=
0
;
v
<
n
.
length
;
v
++
)
d
(
p
.
p
,
n
[
v
].
p
)
&&
(
g
!=
v
&&
s
.
push
({
froms
:
g
,
tos
:
v
,
hole
:
l
}),
r
?(
r
=!
1
,
h
[
v
].
push
(
p
)):
u
=!
0
);
r
&&
h
[
g
].
push
(
p
)}
0
<
s
.
length
&&
(
u
||
(
q
=
h
))}
u
=
0
;
for
(
s
=
n
.
length
;
u
<
s
;
u
++
)
for
(
h
=
n
[
u
].
s
,
k
.
push
(
h
),
g
=
q
[
u
],
e
=
0
,
f
=
g
.
length
;
e
<
f
;
e
++
)
h
.
holes
.
push
(
g
[
e
].
h
);
return
k
};
THREE
.
Shape
=
function
(){
THREE
.
Path
.
apply
(
this
,
arguments
);
this
.
holes
=
[]};
THREE
.
Shape
.
prototype
=
Object
.
create
(
THREE
.
Path
.
prototype
);
THREE
.
Shape
.
prototype
.
extrude
=
function
(
a
){
return
new
THREE
.
ExtrudeGeometry
(
this
,
a
)};
THREE
.
Shape
.
prototype
.
makeGeometry
=
function
(
a
){
return
new
THREE
.
ShapeGeometry
(
this
,
a
)};
THREE
.
Shape
.
prototype
.
getPointsHoles
=
function
(
a
){
var
b
,
c
=
this
.
holes
.
length
,
d
=
[];
for
(
b
=
0
;
b
<
c
;
b
++
)
d
[
b
]
=
this
.
holes
[
b
].
getTransformedPoints
(
a
,
this
.
bends
);
return
d
};
THREE
.
Shape
.
prototype
.
getSpacedPointsHoles
=
function
(
a
){
var
b
,
c
=
this
.
holes
.
length
,
d
=
[];
for
(
b
=
0
;
b
<
c
;
b
++
)
d
[
b
]
=
this
.
holes
[
b
].
getTransformedSpacedPoints
(
a
,
this
.
bends
);
return
d
};
THREE
.
Shape
.
prototype
.
extractAllPoints
=
function
(
a
){
return
{
shape
:
this
.
getTransformedPoints
(
a
),
holes
:
this
.
getPointsHoles
(
a
)}};
THREE
.
Shape
.
prototype
.
extractPoints
=
function
(
a
){
return
this
.
useSpacedPoints
?
this
.
extractAllSpacedPoints
(
a
):
this
.
extractAllPoints
(
a
)};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录