CurvePath.html 3.8 KB

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