Path.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:CurvePath] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. A 2d path representation, comprising of points, lines, and cubes, similar to the html5 2d canvas api.
  14. It extends [page:CurvePath].
  15. </div>
  16. <h2>Constructor</h2>
  17. <h3>[name]([page:Array points])</h3>
  18. <div>
  19. points -- array of Vector2
  20. </div>
  21. <div>
  22. Creates a Path from the points. The first vector defines the offset. After that the lines get defined.
  23. </div>
  24. <h2>Properties</h2>
  25. <h3>[property:array actions]</h3>
  26. <div>
  27. The possible actions that define the path.
  28. </div>
  29. <h2>Methods</h2>
  30. <h3>[method:null fromPoints]( [page:Array vector2s] )</h3>
  31. <div>
  32. Adds to the Path from the points. The first vector defines the offset. After that the lines get defined.
  33. </div>
  34. <h3>[method:null moveTo]( [page:Float x], [page:Float y] )</h3>
  35. <div>This moves the offset to x and y</div>
  36. <h3>[method:null lineTo]( [page:Float x], [page:Float y] )</h3>
  37. <div>This creates a line from the offset to X and Y and updates the offset to X and Y.</div>
  38. <h3>[method:null quadraticCurveTo]( [page:Float cpX], [page:Float cpY], [page:Float x], [page:Float y] )</h3>
  39. <div>This creates a quadratic curve from the offset to x and y with cpX and cpY as control point and updates the offset to x and y.</div>
  40. <h3>[method:null bezierCurveTo]( [page:Float cp1X], [page:Float cp1Y], [page:Float cp2X], [page:Float cp2Y], [page:Float x], [page:Float y] )</h3>
  41. <div>This creates a bezier curve from the last offset to x and y with cp1X, cp1Y and cp1X, cp1Y as control points and updates the offset to x and y.</div>
  42. <h3>[method:null splineThru] ( [page:Array points] ) </h3>
  43. <div>points - An array of [page:Vector2]s</div>
  44. <div>Connects a new [page:SplineCurve] onto the path.</div>
  45. <h3>[method:null arc]( [page:Float x], [page:Float y], [page:Float radius], [page:Float startAngle], [page:Float endAngle], [page:Float clockwise] )</h3>
  46. <div>
  47. x, y -- The center of the arc offset from the last call
  48. radius -- The radius of the arc
  49. startAngle -- The start angle in radians
  50. endAngle -- The end angle in radians
  51. clockwise -- Sweep the arc clockwise. Defaults to false
  52. </div>
  53. <div>Draw an arc offset from the last call</div>
  54. <h3>[method:null absarc]( [page:Float x], [page:Float y], [page:Float radius], [page:Float startAngle], [page:Float endAngle], [page:Float clockwise] )</h3>
  55. <div>
  56. x, y -- The absolute center of the arc
  57. radius -- The radius of the arc
  58. startAngle -- The start angle in radians
  59. endAngle -- The end angle in radians
  60. clockwise -- Sweep the arc clockwise. Defaults to false
  61. </div>
  62. <div>Draw an arc absolutely positioned</div>
  63. <h3>[method:null ellipse]( [page:Float x], [page:Float y], [page:Float xRadius], [page:Float yRadius], [page:Float startAngle], [page:Float endAngle], [page:Float clockwise] )</h3>
  64. <div>
  65. x, y -- The center of the ellipse offset from the last call
  66. xRadius -- The radius of the ellipse in the x axis
  67. yRadius -- The radius of the ellipse in the y axis
  68. startAngle -- The start angle in radians
  69. endAngle -- The end angle in radians
  70. clockwise -- Sweep the ellipse clockwise. Defaults to false
  71. </div>
  72. <div>Draw an ellipse offset from the last call</div>
  73. <h3>[method:null absellipse]( [page:Float x], [page:Float y], [page:Float xRadius], [page:Float yRadius], [page:Float startAngle], [page:Float endAngle], [page:Float clockwise] )</h3>
  74. <div>
  75. x, y -- The absolute center of the ellipse
  76. xRadius -- The radius of the ellipse in the x axis
  77. yRadius -- The radius of the ellipse in the y axis
  78. startAngle -- The start angle in radians
  79. endAngle -- The end angle in radians
  80. clockwise -- Sweep the ellipse clockwise. Defaults to false
  81. </div>
  82. <div>Draw an ellipse absolutely positioned</div>
  83. <h3>[method:Array toShapes]( [page:Boolean isCCW], [page:Boolean noHoles] )</h3>
  84. <div>
  85. isCCW -- Changes how solids and holes are generated<br/>
  86. noHoles -- Whether or not to generate holes
  87. </div>
  88. <div>
  89. Converts the Path into an array of Shapes. By default solid shapes are defined clockwise (CW) and holes are defined counterclockwise (CCW). If isCCW is set to true,
  90. then those are flipped. If the paramater noHoles is set to true then all paths are set as solid shapes and isCCW is ignored.
  91. <br/>
  92. </div>
  93. <h2>Source</h2>
  94. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  95. </body>
  96. </html>