Curve.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html>
  2. <html lang="en">
  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. An abstract base class for creating a [name] object that contains methods for interpolation.
  13. For an array of [name]s see [page:CurvePath].
  14. </p>
  15. <h2>Constructor</h2>
  16. <h3>[name]()</h3>
  17. <p>
  18. This constructor creates a new [name].
  19. </p>
  20. <h2>Properties</h2>
  21. <h3>[property:Integer arcLengthDivisions]</h3>
  22. <p>This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via [page:.getLengths].
  23. To ensure precision when using methods like [page:.getSpacedPoints], it is recommended to increase [page:.arcLengthDivisions] if the curve is very large. Default is 200.</p>
  24. <h2>Methods</h2>
  25. <h3>[method:Vector getPoint]( [param:Float t], [param:Vector optionalTarget] )</h3>
  26. <p>
  27. [page:Float t] - A position on the curve. Must be in the range [ 0, 1 ]. <br>
  28. [page:Vector optionalTarget] — (optional) If specified, the result will be copied into this Vector,
  29. otherwise a new Vector will be created. <br /><br />
  30. Returns a vector for a given position on the curve.
  31. </p>
  32. <h3>[method:Vector getPointAt]( [param:Float u], [param:Vector optionalTarget] )</h3>
  33. <p>
  34. [page:Float u] - A position on the curve according to the arc length. Must be in the range [ 0, 1 ]. <br>
  35. [page:Vector optionalTarget] — (optional) If specified, the result will be copied into this Vector,
  36. otherwise a new Vector will be created. <br /><br />
  37. Returns a vector for a given position on the curve according to the arc length.
  38. </p>
  39. <h3>[method:Array getPoints]( [param:Integer divisions] )</h3>
  40. <p>
  41. divisions -- number of pieces to divide the curve into. Default is *5*.<br /><br />
  42. Returns a set of divisions + 1 points using getPoint( t ).
  43. </p>
  44. <h3>[method:Array getSpacedPoints]( [param:Integer divisions] )</h3>
  45. <p>
  46. divisions -- number of pieces to divide the curve into. Default is *5*.<br /><br />
  47. Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
  48. </p>
  49. <h3>[method:Float getLength]()</h3>
  50. <p>Get total curve arc length.</p>
  51. <h3>[method:Array getLengths]( [param:Integer divisions] )</h3>
  52. <p>Get list of cumulative segment lengths.</p>
  53. <h3>[method:null updateArcLengths]()</h3>
  54. <p>Update the cumlative segment distance cache.</p>
  55. <h3>[method:Float getUtoTmapping]( [param:Float u], [param:Float distance] )</h3>
  56. <p>
  57. Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ).
  58. u and t can then be used to give you points which are equidistant from the ends of the curve,
  59. using [page:.getPoint].
  60. </p>
  61. <h3>[method:Vector getTangent]( [param:Float t], [param:Vector optionalTarget] )</h3>
  62. <p>
  63. [page:Float t] - A position on the curve. Must be in the range [ 0, 1 ]. <br>
  64. [page:Vector optionalTarget] — (optional) If specified, the result will be copied into this Vector,
  65. otherwise a new Vector will be created. <br /><br />
  66. Returns a unit vector tangent at t. If the derived curve does not implement its
  67. tangent derivation, two points a small delta apart will be used to find its gradient
  68. which seems to give a reasonable approximation.
  69. </p>
  70. <h3>[method:Vector getTangentAt]( [param:Float u], [param:Vector optionalTarget] )</h3>
  71. <p>
  72. [page:Float u] - A position on the curve according to the arc length. Must be in the range [ 0, 1 ]. <br>
  73. [page:Vector optionalTarget] — (optional) If specified, the result will be copied into this Vector,
  74. otherwise a new Vector will be created. <br /><br />
  75. Returns tangent at a point which is equidistant to the ends of the curve from the
  76. point given in [page:.getTangent].
  77. </p>
  78. <h3>[method:Object computeFrenetFrames]( [param:Integer segments], [param:Boolean closed] )</h3>
  79. <p>
  80. Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry] or [page:ExtrudeGeometry].
  81. </p>
  82. <h3>[method:Curve clone]()</h3>
  83. <p>Creates a clone of this instance.</p>
  84. <h3>[method:Curve copy]( [param:Curve source] )</h3>
  85. <p>Copies another [name] object to this instance.</p>
  86. <h3>[method:Object toJSON]()</h3>
  87. <p>Returns a JSON object representation of this instance.</p>
  88. <h3>[method:Curve fromJSON]( [param:Object json] )</h3>
  89. <p>Copies the data from the given JSON object to this instance.</p>
  90. <h2>Source</h2>
  91. <p>
  92. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  93. </p>
  94. </body>
  95. </html>