Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
f7bdadbb
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,发现更多精彩内容 >>
提交
f7bdadbb
编写于
6月 09, 2011
作者:
Z
zz85
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
alternative slice - fixes B
上级
9acdcbb6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
76 addition
and
6 deletion
+76
-6
src/extras/geometries/Text.js
src/extras/geometries/Text.js
+76
-6
未找到文件。
src/extras/geometries/Text.js
浏览文件 @
f7bdadbb
...
...
@@ -363,24 +363,94 @@ THREE.FontUtils = {
}
prevShapeVert
=
(
shapeIndex
-
1
)
>=
0
?
shapeIndex
-
1
:
shape
.
length
-
1
;
nextShapeVert
=
(
shapeIndex
+
1
)
<
shape
.
length
?
shapeIndex
+
1
:
0
;
prevHoleVert
=
(
holeIndex
-
1
)
>=
0
?
holeIndex
-
1
:
hole
.
length
-
1
;
nextHoleVert
=
(
holeIndex
+
1
)
<
hole
.
length
?
holeIndex
+
1
:
0
;
prevHoleVert
=
(
holeIndex
-
1
)
>=
0
?
holeIndex
-
1
:
hole
.
length
-
1
;
nextHoleVert
=
(
holeIndex
+
1
)
<
hole
.
length
?
holeIndex
+
1
:
0
;
var
areaapts
=
[];
areaapts
.
push
(
hole
[
holeIndex
]
);
areaapts
.
push
(
shape
[
shapeIndex
]
);
areaapts
.
push
(
shape
[
prevShapeVert
]
);
var
areaa
=
this
.
Triangulate
.
area
(
areaapts
);
var
areabpts
=
[];
areabpts
.
push
(
hole
[
holeIndex
]
);
areabpts
.
push
(
hole
[
prevHoleVert
]
);
areabpts
.
push
(
shape
[
shapeIndex
]
);
var
areab
=
this
.
Triangulate
.
area
(
areabpts
);
var
shapeOffset
=
1
;
var
holeOffset
=
-
1
;
var
oldShapeIndex
=
shapeIndex
,
oldHoleIndex
=
holeIndex
;
shapeIndex
+=
shapeOffset
;
holeIndex
+=
holeOffset
;
if
(
shapeIndex
<
0
)
{
shapeIndex
+=
shape
.
length
;
}
shapeIndex
%=
shape
.
length
;
if
(
holeIndex
<
0
)
{
holeIndex
+=
hole
.
length
;
}
holeIndex
%=
shape
.
length
;
prevShapeVert
=
(
shapeIndex
-
1
)
>=
0
?
shapeIndex
-
1
:
shape
.
length
-
1
;
nextShapeVert
=
(
shapeIndex
+
1
)
<
shape
.
length
?
shapeIndex
+
1
:
0
;
prevHoleVert
=
(
holeIndex
-
1
)
>=
0
?
holeIndex
-
1
:
hole
.
length
-
1
;
nextHoleVert
=
(
holeIndex
+
1
)
<
hole
.
length
?
holeIndex
+
1
:
0
;
areaapts
=
[];
areaapts
.
push
(
hole
[
holeIndex
]
);
areaapts
.
push
(
shape
[
shapeIndex
]
);
areaapts
.
push
(
shape
[
prevShapeVert
]
);
var
areaa2
=
this
.
Triangulate
.
area
(
areaapts
);
areabpts
=
[];
areabpts
.
push
(
hole
[
holeIndex
]
);
areabpts
.
push
(
hole
[
prevHoleVert
]
);
areabpts
.
push
(
shape
[
shapeIndex
]
);
var
areab2
=
this
.
Triangulate
.
area
(
areabpts
);
if
(
(
areaa
+
areab
)
>
(
areaa2
+
areab2
)
)
{
shapeIndex
=
oldShapeIndex
;
holeIndex
=
oldHoleIndex
;
if
(
shapeIndex
<
0
)
{
shapeIndex
+=
shape
.
length
;
}
shapeIndex
%=
shape
.
length
;
if
(
holeIndex
<
0
)
{
holeIndex
+=
hole
.
length
;
}
holeIndex
%=
shape
.
length
;
prevShapeVert
=
(
shapeIndex
-
1
)
>=
0
?
shapeIndex
-
1
:
shape
.
length
-
1
;
nextShapeVert
=
(
shapeIndex
+
1
)
<
shape
.
length
?
shapeIndex
+
1
:
0
;
prevHoleVert
=
(
holeIndex
-
1
)
>=
0
?
holeIndex
-
1
:
hole
.
length
-
1
;
nextHoleVert
=
(
holeIndex
+
1
)
<
hole
.
length
?
holeIndex
+
1
:
0
;
}
tmpShape1
=
shape
.
slice
(
0
,
shapeIndex
);
tmpShape2
=
shape
.
slice
(
shapeIndex
);
tmpHole1
=
hole
.
slice
(
holeIndex
);
tmpHole2
=
hole
.
slice
(
0
,
holeIndex
);
verts
.
push
(
hole
[
holeIndex
]
);
verts
.
push
(
shape
[
shapeIndex
]
);
verts
.
push
(
shape
[
prevShapeVert
]
);
verts
.
push
(
hole
[
holeIndex
]
);
verts
.
push
(
hole
[
holeIndex
]
);
verts
.
push
(
hole
[
prevHoleVert
]
);
verts
.
push
(
shape
[
shapeIndex
]
);
shape
=
tmpShape1
.
concat
(
tmpHole1
).
concat
(
tmpHole2
).
concat
(
tmpShape2
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录