CurvePath.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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:Curve] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. An abstract base class further extending [page:Curve]. A CurvePath is simply an array of connected curves,
  14. but retains the api of a curve.
  15. </div>
  16. <h2>Constructor</h2>
  17. <h3>[name]()</h3>
  18. <div>
  19. The constructor take no parameters.
  20. </div>
  21. <h2>Properties</h2>
  22. <h3>[property:array curves]</h3>
  23. <div>
  24. The array of [page:Curve]s
  25. </div>
  26. <h3>[property:array bends]</h3>
  27. <div>
  28. An array of [page:Curve]s used to transform and bend the curve using [page:CurvePath.getWrapPoints].
  29. </div>
  30. <h3>[property:boolean autoClose]</h3>
  31. <div>
  32. Whether or not to automatically close the path.
  33. </div>
  34. <h2>Methods</h2>
  35. <h3>[method:Array getWrapPoints]([page:Array vertices], [page:Curve curve])</h3>
  36. <div>
  37. vertices -- An array of [page:Vector2]s to modify<br />
  38. curve -- An array of 2d [page:Curve]s
  39. </div>
  40. <div>
  41. Modifies the array of vertices by warping it by the curve. The curve parameter also accepts objects with similar
  42. interfaces such as [page:CurvePath], [page:Path], [page:SplineCurve], etc. Returns the original vertices after
  43. modification.
  44. </div>
  45. <h3>[method:null addWrapPath]([page:Curve curve])</h3>
  46. <div>
  47. curve -- A [page:Curve] or object with a similar interface.
  48. </div>
  49. <div>
  50. Pushes a curve onto the bends array.
  51. </div>
  52. <h3>[method:Geometry createGeometry]([page:Vector3 points])</h3>
  53. <div>
  54. points -- An array of [page:Vector3]s
  55. </div>
  56. <div>
  57. Creates a geometry from points
  58. </div>
  59. <h3>[method:Geometry createPointsGeometry]([page:Integer divisions])</h3>
  60. <div>
  61. divisions -- How many segments to create with [page:Vector3]s. Defaults to 12.
  62. </div>
  63. <div>
  64. Creates a [page:Geometry] object comprised of [page:Vector3]s
  65. </div>
  66. <h3>[method:Geometry createSpacedPointsGeometry]([page:Integer divisions])</h3>
  67. <div>
  68. divisions -- How many segments to create with [page:Vector3]s. Defaults to 12.
  69. </div>
  70. <div>
  71. Creates a [page:Geometry] object comprised of [page:Vector3]s that are equidistant.
  72. </div>
  73. <h3>[method:null add]([page:Curve curve])</h3>
  74. <div>
  75. curve -- The [page:Curve curve] to add
  76. </div>
  77. <div>
  78. Pushes a curve onto the curves array.
  79. </div>
  80. <h3>[method:null closePath]()</h3>
  81. <div>
  82. Adds a curve to close the path.
  83. </div>
  84. <h3>[method:Object getBoundingBox]()</h3>
  85. <div>
  86. Returns an object with the keys minX, minY, maxX, maxY, (if 3d: maxZ, minZ)
  87. </div>
  88. <h3>[method:Float getCurveLengths]()</h3>
  89. <div>
  90. Adds together the length of the curves
  91. </div>
  92. <h3>[method:Array getTransformedPoints]([page:Integer segments], [page:Array bends])</h3>
  93. <div>
  94. segments -- The number of segments to create using the getPoints()<br />
  95. bends -- (optional) An array of [page:Curve]s used to transform the points. Defaults to this.bends if blank.
  96. </div>
  97. <div>
  98. Uses this CurvePath to generate a series of points transformed by the curves in the bends array. Returns an
  99. array of [page:Vector2]s.
  100. </div>
  101. <h3>[method:Array getTransformedSpacedPoints]([page:Integer segments], [page:Array bends])</h3>
  102. <div>
  103. segments -- The number of segments to create using the getPoints()<br />
  104. bends -- (optional) Defaults to this.bends if blank. An array of [page:Curve]s used to transform the points.
  105. </div>
  106. <div>
  107. Uses this CurvePath to generate a series equidistant points that are then transformed by the curves in the bends.
  108. Returns an array of [page:Vector2]s.
  109. </div>
  110. <h2>Source</h2>
  111. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  112. </body>
  113. </html>