ShapePath.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. </p>
  14. <h2>예제</h2>
  15. <p>
  16. [example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2]
  17. </p>
  18. <h2>생성자</h2>
  19. <h3>[name]( )</h3>
  20. <p>
  21. 새 ShapePath를 만듭니다. [page:Path]와 달리, 점들이 ShapePath로 전달되지 않으며 생성 이후에 작동되게 설계되었습니다.
  22. </p>
  23. <h2>프로퍼티</h2>
  24. <h3>[property:Array subPaths]</h3>
  25. <p>
  26. [page:Path]들의 배열입니다.
  27. </p>
  28. <h3>[property:Array currentPath]</h3>
  29. <p>
  30. 현재 생성된 [page:Path]입니다.
  31. </p>
  32. <h3>[property:Color color]</h3>
  33. <p>shape의 [page:Color]이며, 기본값은 흰 색입니다(0xffffff).</p>
  34. <h2>메서드</h2>
  35. <h3>[method:this moveTo]( [param:Float x], [param:Float y] )</h3>
  36. <p>
  37. 새 [page:Path]를 시작하고 해당 [page:Path]에 [page:Path.moveTo]( x, y )를 호출합니다.
  38. [page:ShapePath.currentPath currentPath] 점도 해당 [page:Path]에 호출합니다.
  39. </p>
  40. <h3>[method:this lineTo]( [param:Float x], [param:Float y] )</h3>
  41. <p>[page:ShapePath.currentPath currentPath]의 오프셋에서 X 및 Y로 선을 생성하고 오프셋을 X와 Y로 업데이트합니다.</p>
  42. <h3>[method:this quadraticCurveTo]( [param:Float cpX], [param:Float cpY], [param:Float x], [param:Float y] )</h3>
  43. <p>[page:ShapePath.currentPath currentPath]의 오프셋에서 조절점 cpX 와 cpY 및 x 와 y로 이차곡선을 만들고 [page:ShapePath.currentPath currentPath]의 오프셋을 x 와 y로 업데이트합니다.</p>
  44. <h3>[method:this bezierCurveTo]( [param:Float cp1X], [param:Float cp1Y], [param:Float cp2X], [param:Float cp2Y], [param:Float x], [param:Float y] )</h3>
  45. <p>[page:ShapePath.currentPath currentPath]의 오프셋에서 조절점 cpX 와 cpY 및 x 와 y로 베지어곡선을 만들고 [page:ShapePath.currentPath currentPath]의 오프셋을 x 와 y로 업데이트합니다.</p>
  46. <h3>[method:this splineThru] ( [param:Array points] ) </h3>
  47. <p>points - [page:Vector2]들의 배열</p>
  48. <p>[page:ShapePath.currentPath currentPath] 위에 새 [page:SplineCurve]를 연결합니다.</p>
  49. <h3>[method:Array toShapes]( [param:Boolean isCCW], [param:Boolean noHoles] )</h3>
  50. <p>
  51. isCCW -- solids와 holes가 생성되는 방식을 변경합니다<br/>
  52. noHoles -- holes를 생성할지 안 할지를 설정합니다.
  53. </p>
  54. <p>
  55. [page:ShapePath.subPaths subPaths] 배열을 Shapes 배열로 변환합니다. 기본값으로 solid shapes는 시계방향(CW)이고 holes는 반시계방향(CCW)입니다.
  56. isCCW가 true면, 이 값들이 반대가 됩니다.
  57. noHoles 파라미터가 true면 모든 path들은 solid shapes로 설정되고 isCCW는 무시됩니다.
  58. <br/>
  59. </p>
  60. <h2>소스코드</h2>
  61. <p>
  62. [link:https://github.com/mrdoob/three.js/blob/master/src/extras/core/ShapePath.js src/extras/core/ShapePath.js]
  63. </p>
  64. </body>
  65. </html>