Curve.html 4.9 KB

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