[name]

This class is used to convert 이 클래스는 연속된 shape들을 [page:Path] 배열로 바꾸는데에 사용되며, 일례로 SVG shape를 path로 바꾸는 것이 있습니다.(아래 예제를 확인하세요).

예제

[example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2]

생성자

[name]( )

새 ShapePath를 만듭니다. [page:Path]와 달리, 점들이 ShapePath로 전달되지 않으며 생성 이후에 작동되게 설계되었습니다.

프로퍼티

[property:Array subPaths]

[page:Path]들의 배열입니다.

[property:Array currentPath]

현재 생성된 [page:Path]입니다.

[property:Color color]

shape의 [page:Color]이며, 기본값은 흰 색입니다(0xffffff).

메서드

[method:this moveTo]( [param:Float x], [param:Float y] )

새 [page:Path]를 시작하고 해당 [page:Path]에 [page:Path.moveTo]( x, y )를 호출합니다. [page:ShapePath.currentPath currentPath] 점도 해당 [page:Path]에 호출합니다.

[method:this lineTo]( [param:Float x], [param:Float y] )

[page:ShapePath.currentPath currentPath]의 오프셋에서 X 및 Y로 선을 생성하고 오프셋을 X와 Y로 업데이트합니다.

[method:this quadraticCurveTo]( [param:Float cpX], [param:Float cpY], [param:Float x], [param:Float y] )

[page:ShapePath.currentPath currentPath]의 오프셋에서 조절점 cpX 와 cpY 및 x 와 y로 이차곡선을 만들고 [page:ShapePath.currentPath currentPath]의 오프셋을 x 와 y로 업데이트합니다.

[method:this bezierCurveTo]( [param:Float cp1X], [param:Float cp1Y], [param:Float cp2X], [param:Float cp2Y], [param:Float x], [param:Float y] )

[page:ShapePath.currentPath currentPath]의 오프셋에서 조절점 cpX 와 cpY 및 x 와 y로 베지어곡선을 만들고 [page:ShapePath.currentPath currentPath]의 오프셋을 x 와 y로 업데이트합니다.

[method:this splineThru] ( [param:Array points] )

points - [page:Vector2]들의 배열

[page:ShapePath.currentPath currentPath] 위에 새 [page:SplineCurve]를 연결합니다.

[method:Array toShapes]( [param:Boolean isCCW], [param:Boolean noHoles] )

isCCW -- solids와 holes가 생성되는 방식을 변경합니다
noHoles -- holes를 생성할지 안 할지를 설정합니다.

[page:ShapePath.subPaths subPaths] 배열을 Shapes 배열로 변환합니다. 기본값으로 solid shapes는 시계방향(CW)이고 holes는 반시계방향(CCW)입니다. isCCW가 true면, 이 값들이 반대가 됩니다. noHoles 파라미터가 true면 모든 path들은 solid shapes로 설정되고 isCCW는 무시됩니다.

소스코드

[link:https://github.com/mrdoob/three.js/blob/master/src/extras/core/ShapePath.js src/extras/core/ShapePath.js]