Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
4aa7ac81
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,发现更多精彩内容 >>
未验证
提交
4aa7ac81
编写于
4月 28, 2018
作者:
M
Mr.doob
提交者:
GitHub
4月 28, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13949 from Mugen87/dev4
ExtrudeGeometry: Renamed option "amount" to "depth".
上级
aeb19018
050f80f9
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
31 addition
and
51 deletion
+31
-51
docs/api/geometries/ExtrudeBufferGeometry.html
docs/api/geometries/ExtrudeBufferGeometry.html
+2
-2
docs/api/geometries/ExtrudeGeometry.html
docs/api/geometries/ExtrudeGeometry.html
+2
-2
docs/scenes/js/geometry.js
docs/scenes/js/geometry.js
+4
-4
examples/webgl_buffergeometry_constructed_from_geometry.html
examples/webgl_buffergeometry_constructed_from_geometry.html
+1
-1
examples/webgl_geometry_extrude_shapes.html
examples/webgl_geometry_extrude_shapes.html
+1
-1
examples/webgl_geometry_extrude_shapes2.html
examples/webgl_geometry_extrude_shapes2.html
+5
-5
examples/webgl_geometry_shapes.html
examples/webgl_geometry_shapes.html
+1
-1
src/geometries/ExtrudeGeometry.js
src/geometries/ExtrudeGeometry.js
+14
-5
src/geometries/TextGeometry.js
src/geometries/TextGeometry.js
+1
-1
test/unit/src/geometries/ExtrudeGeometry.tests.js
test/unit/src/geometries/ExtrudeGeometry.tests.js
+0
-29
未找到文件。
docs/api/geometries/ExtrudeBufferGeometry.html
浏览文件 @
4aa7ac81
...
...
@@ -47,7 +47,7 @@
var extrudeSettings = {
steps: 2,
amount
: 16,
depth
: 16,
bevelEnabled: true,
bevelThickness: 1,
bevelSize: 1,
...
...
@@ -72,7 +72,7 @@
<ul>
<li>
curveSegments — int. Number of points on the curves. Default is 12.
</li>
<li>
steps — int. Number of points used for subdividing segments along the depth of the extruded spline. Default is 1.
</li>
<li>
amount
— float. Depth to extrude the shape. Default is 100.
</li>
<li>
depth
— float. Depth to extrude the shape. Default is 100.
</li>
<li>
bevelEnabled — bool. Apply beveling to the shape. Default is true.
</li>
<li>
bevelThickness — float. How deep into the original shape the bevel goes. Default is 6.
</li>
<li>
bevelSize — float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 2.
</li>
...
...
docs/api/geometries/ExtrudeGeometry.html
浏览文件 @
4aa7ac81
...
...
@@ -47,7 +47,7 @@
var extrudeSettings = {
steps: 2,
amount
: 16,
depth
: 16,
bevelEnabled: true,
bevelThickness: 1,
bevelSize: 1,
...
...
@@ -72,7 +72,7 @@
<ul>
<li>
curveSegments — int. Number of points on the curves. Default is 12.
</li>
<li>
steps — int. Number of points used for subdividing segments along the depth of the extruded spline. Default is 1.
</li>
<li>
amount
— float. Depth to extrude the shape. Default is 100.
</li>
<li>
depth
— float. Depth to extrude the shape. Default is 100.
</li>
<li>
bevelEnabled — bool. Apply beveling to the shape. Default is true.
</li>
<li>
bevelThickness — float. How deep into the original shape the bevel goes. Default is 6.
</li>
<li>
bevelSize — float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 2.
</li>
...
...
docs/scenes/js/geometry.js
浏览文件 @
4aa7ac81
...
...
@@ -1264,7 +1264,7 @@ var guis = {
var
data
=
{
steps
:
2
,
amount
:
16
,
depth
:
16
,
bevelEnabled
:
true
,
bevelThickness
:
1
,
bevelSize
:
1
,
...
...
@@ -1292,7 +1292,7 @@ var guis = {
var
folder
=
gui
.
addFolder
(
'
THREE.ExtrudeGeometry
'
);
folder
.
add
(
data
,
'
steps
'
,
1
,
10
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
amount
'
,
1
,
20
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
depth
'
,
1
,
20
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelThickness
'
,
1
,
5
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelSize
'
,
1
,
5
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelSegments
'
,
1
,
5
).
step
(
1
).
onChange
(
generateGeometry
);
...
...
@@ -1305,7 +1305,7 @@ var guis = {
var
data
=
{
steps
:
2
,
amount
:
16
,
depth
:
16
,
bevelEnabled
:
true
,
bevelThickness
:
1
,
bevelSize
:
1
,
...
...
@@ -1333,7 +1333,7 @@ var guis = {
var
folder
=
gui
.
addFolder
(
'
THREE.ExtrudeBufferGeometry
'
);
folder
.
add
(
data
,
'
steps
'
,
1
,
10
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
amount
'
,
1
,
20
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
depth
'
,
1
,
20
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelThickness
'
,
1
,
5
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelSize
'
,
1
,
5
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelSegments
'
,
1
,
5
).
step
(
1
).
onChange
(
generateGeometry
);
...
...
examples/webgl_buffergeometry_constructed_from_geometry.html
浏览文件 @
4aa7ac81
...
...
@@ -93,7 +93,7 @@
heartShape
.
bezierCurveTo
(
x
+
35
,
y
,
x
+
25
,
y
+
25
,
x
+
25
,
y
+
25
);
var
extrudeSettings
=
{
amount
:
16
,
depth
:
16
,
bevelEnabled
:
true
,
bevelSegments
:
1
,
steps
:
2
,
...
...
examples/webgl_geometry_extrude_shapes.html
浏览文件 @
4aa7ac81
...
...
@@ -157,7 +157,7 @@
var
materials
=
[
material
,
material2
];
var
extrudeSettings
=
{
amount
:
20
,
depth
:
20
,
steps
:
1
,
bevelEnabled
:
true
,
bevelThickness
:
2
,
...
...
examples/webgl_geometry_extrude_shapes2.html
浏览文件 @
4aa7ac81
...
...
@@ -351,7 +351,7 @@
var
addGeoObject
=
function
(
group
,
svgObject
)
{
var
paths
=
svgObject
.
paths
;
var
amounts
=
svgObject
.
amount
s
;
var
depths
=
svgObject
.
depth
s
;
var
colors
=
svgObject
.
colors
;
var
center
=
svgObject
.
center
;
...
...
@@ -363,20 +363,20 @@
color
:
color
,
emissive
:
color
}
);
var
amount
=
amount
s
[
i
];
var
depth
=
depth
s
[
i
];
var
simpleShapes
=
path
.
toShapes
(
true
);
for
(
var
j
=
0
;
j
<
simpleShapes
.
length
;
j
++
)
{
var
simpleShape
=
simpleShapes
[
j
];
var
shape3d
=
new
THREE
.
ExtrudeBufferGeometry
(
simpleShape
,
{
amount
:
amount
,
depth
:
depth
,
bevelEnabled
:
false
}
);
var
mesh
=
new
THREE
.
Mesh
(
shape3d
,
material
);
mesh
.
rotation
.
x
=
Math
.
PI
;
mesh
.
translateZ
(
-
amount
-
1
);
mesh
.
translateZ
(
-
depth
-
1
);
mesh
.
translateX
(
-
center
.
x
);
mesh
.
translateY
(
-
center
.
y
);
...
...
@@ -492,7 +492,7 @@
"
L368.1217,110.4867 L366.5152,109.2554 L361.9554,112.3435 L358.1163,117.8678 L361.7218,120.2192
"
+
"
L360.7261,126.3232 L362.8064,125.5221 Z
"
];
obj
.
amount
s
=
[
19
,
20
,
21
];
obj
.
depth
s
=
[
19
,
20
,
21
];
obj
.
colors
=
[
0xC07000
,
0xC08000
,
0xC0A000
];
obj
.
center
=
{
x
:
365
,
y
:
125
};
...
...
examples/webgl_geometry_shapes.html
浏览文件 @
4aa7ac81
...
...
@@ -342,7 +342,7 @@
splineShape
.
moveTo
(
0
,
0
);
splineShape
.
splineThru
(
splinepts
);
var
extrudeSettings
=
{
amount
:
8
,
bevelEnabled
:
true
,
bevelSegments
:
2
,
steps
:
2
,
bevelSize
:
1
,
bevelThickness
:
1
};
var
extrudeSettings
=
{
depth
:
8
,
bevelEnabled
:
true
,
bevelSegments
:
2
,
steps
:
2
,
bevelSize
:
1
,
bevelThickness
:
1
};
// addShape( shape, color, x, y, z, rx, ry,rz, s );
...
...
src/geometries/ExtrudeGeometry.js
浏览文件 @
4aa7ac81
...
...
@@ -7,7 +7,7 @@
*
* curveSegments: <int>, // number of points on the curves
* steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
*
amount
: <float>, // Depth to extrude the shape
*
depth
: <float>, // Depth to extrude the shape
*
* bevelEnabled: <bool>, // turn on bevel
* bevelThickness: <float>, // how deep into the original shape bevel goes
...
...
@@ -93,7 +93,7 @@ function ExtrudeBufferGeometry( shapes, options ) {
var
curveSegments
=
options
.
curveSegments
!==
undefined
?
options
.
curveSegments
:
12
;
var
steps
=
options
.
steps
!==
undefined
?
options
.
steps
:
1
;
var
amount
=
options
.
amount
!==
undefined
?
options
.
amount
:
100
;
var
depth
=
options
.
depth
!==
undefined
?
options
.
depth
:
100
;
var
bevelEnabled
=
options
.
bevelEnabled
!==
undefined
?
options
.
bevelEnabled
:
true
;
var
bevelThickness
=
options
.
bevelThickness
!==
undefined
?
options
.
bevelThickness
:
6
;
...
...
@@ -104,6 +104,15 @@ function ExtrudeBufferGeometry( shapes, options ) {
var
uvgen
=
options
.
UVGenerator
!==
undefined
?
options
.
UVGenerator
:
WorldUVGenerator
;
// deprecated options
if
(
options
.
amount
!==
undefined
)
{
console
.
warn
(
'
THREE.ExtrudeBufferGeometry: amount has been renamed to depth.
'
);
depth
=
options
.
amount
;
}
//
var
extrudePts
,
extrudeByPath
=
false
;
...
...
@@ -444,7 +453,7 @@ function ExtrudeBufferGeometry( shapes, options ) {
if
(
!
extrudeByPath
)
{
v
(
vert
.
x
,
vert
.
y
,
amount
/
steps
*
s
);
v
(
vert
.
x
,
vert
.
y
,
depth
/
steps
*
s
);
}
else
{
...
...
@@ -478,7 +487,7 @@ function ExtrudeBufferGeometry( shapes, options ) {
for
(
i
=
0
,
il
=
contour
.
length
;
i
<
il
;
i
++
)
{
vert
=
scalePt2
(
contour
[
i
],
contourMovements
[
i
],
bs
);
v
(
vert
.
x
,
vert
.
y
,
amount
+
z
);
v
(
vert
.
x
,
vert
.
y
,
depth
+
z
);
}
...
...
@@ -495,7 +504,7 @@ function ExtrudeBufferGeometry( shapes, options ) {
if
(
!
extrudeByPath
)
{
v
(
vert
.
x
,
vert
.
y
,
amount
+
z
);
v
(
vert
.
x
,
vert
.
y
,
depth
+
z
);
}
else
{
...
...
src/geometries/TextGeometry.js
浏览文件 @
4aa7ac81
...
...
@@ -60,7 +60,7 @@ function TextBufferGeometry( text, parameters ) {
// translate parameters to ExtrudeGeometry API
parameters
.
amount
=
parameters
.
height
!==
undefined
?
parameters
.
height
:
50
;
parameters
.
depth
=
parameters
.
height
!==
undefined
?
parameters
.
height
:
50
;
// defaults
...
...
test/unit/src/geometries/ExtrudeGeometry.tests.js
浏览文件 @
4aa7ac81
...
...
@@ -41,35 +41,6 @@ export default QUnit.module( 'Geometries', () => {
}
);
// STATIC STUFF
QUnit
.
todo
(
"
WorldUVGenerator.generateTopUV
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
QUnit
.
todo
(
"
WorldUVGenerator.generateSideWallUV
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
// OTHERS
QUnit
.
todo
(
"
getArrays
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
QUnit
.
todo
(
"
addShapeList
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
QUnit
.
todo
(
"
addShape
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
}
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录