ShapePath.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html lang="ko">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. This class is used to convert 이 클래스는 연속된 shape들을 [page:Path] 배열로 바꾸는데에 사용되며, 일례로 SVG shape를 path로 바꾸는 것이 있습니다.(아래 예제를 확인하세요).
  13. [page:Font]에서 내부적으로 JSON 포맷의 폰드를 path 시리즈로 만드는 데에 사용됩니다.
  14. </p>
  15. <h2>예제</h2>
  16. <p>
  17. [example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2]
  18. </p>
  19. <h2>생성자</h2>
  20. <h3>[name]( )</h3>
  21. <p>
  22. 새 ShapePath를 만듭니다. [page:Path]와 달리, 점들이 ShapePath로 전달되지 않으며 생성 이후에 작동되게 설계되었습니다.
  23. </p>
  24. <h2>프로퍼티</h2>
  25. <h3>[property:Array subPaths]</h3>
  26. <p>
  27. [page:Path]들의 배열입니다.
  28. </p>
  29. <h3>[property:Array currentPath]</h3>
  30. <p>
  31. 현재 생성된 [page:Path]입니다.
  32. </p>
  33. <h3>[property:Color color]</h3>
  34. <p>shape의 [page:Color]이며, 기본값은 흰 색입니다(0xffffff).</p>
  35. <h2>메서드</h2>
  36. <h3>[method:this moveTo]( [param:Float x], [param:Float y] )</h3>
  37. <p>
  38. 새 [page:Path]를 시작하고 해당 [page:Path]에 [page:Path.moveTo]( x, y )를 호출합니다.
  39. [page:ShapePath.currentPath currentPath] 점도 해당 [page:Path]에 호출합니다.
  40. </p>
  41. <h3>[method:this lineTo]( [param:Float x], [param:Float y] )</h3>
  42. <p>[page:ShapePath.currentPath currentPath]의 오프셋에서 X 및 Y로 선을 생성하고 오프셋을 X와 Y로 업데이트합니다.</p>
  43. <h3>[method:this quadraticCurveTo]( [param:Float cpX], [param:Float cpY], [param:Float x], [param:Float y] )</h3>
  44. <p>[page:ShapePath.currentPath currentPath]의 오프셋에서 조절점 cpX 와 cpY 및 x 와 y로 이차곡선을 만들고 [page:ShapePath.currentPath currentPath]의 오프셋을 x 와 y로 업데이트합니다.</p>
  45. <h3>[method:this bezierCurveTo]( [param:Float cp1X], [param:Float cp1Y], [param:Float cp2X], [param:Float cp2Y], [param:Float x], [param:Float y] )</h3>
  46. <p>[page:ShapePath.currentPath currentPath]의 오프셋에서 조절점 cpX 와 cpY 및 x 와 y로 베지어곡선을 만들고 [page:ShapePath.currentPath currentPath]의 오프셋을 x 와 y로 업데이트합니다.</p>
  47. <h3>[method:this splineThru] ( [param:Array points] ) </h3>
  48. <p>points - [page:Vector2]들의 배열</p>
  49. <p>[page:ShapePath.currentPath currentPath] 위에 새 [page:SplineCurve]를 연결합니다.</p>
  50. <h3>[method:Array toShapes]( [param:Boolean isCCW], [param:Boolean noHoles] )</h3>
  51. <p>
  52. isCCW -- solids와 holes가 생성되는 방식을 변경합니다<br/>
  53. noHoles -- holes를 생성할지 안 할지를 설정합니다.
  54. </p>
  55. <p>
  56. [page:ShapePath.subPaths subPaths] 배열을 Shapes 배열로 변환합니다. 기본값으로 solid shapes는 시계방향(CW)이고 holes는 반시계방향(CCW)입니다.
  57. isCCW가 true면, 이 값들이 반대가 됩니다.
  58. noHoles 파라미터가 true면 모든 path들은 solid shapes로 설정되고 isCCW는 무시됩니다.
  59. <br/>
  60. </p>
  61. <h2>소스코드</h2>
  62. <p>
  63. [link:https://github.com/mrdoob/three.js/blob/master/src/extras/core/ShapePath.js src/extras/core/ShapePath.js]
  64. </p>
  65. </body>
  66. </html>