| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>NURBSUtils - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">NURBSUtils</h1>
- <section>
- <header>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">NURBSUtils</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
- <pre><code class="language-js">import * as NURBSUtils from 'three/addons/curves/NURBSUtils.js';</code></pre>
- <div class="container-overview">
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="~calcBSplineDerivatives" translate="no">.<a href="#~calcBSplineDerivatives">calcBSplineDerivatives</a><span class="signature">( p : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span>, P : <span class="param-type">Array.<<a href="Vector4.html">Vector4</a>></span>, u : <span class="param-type">number</span>, nd : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.<<a href="Vector4.html">Vector4</a>></span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The degree.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>P</strong>
- </td>
- <td class="description last">
- <p>The control points</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>nd</strong>
- </td>
- <td class="description last">
- <p>The number of derivatives.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> An array[d+1] with derivatives.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcBSplinePoint" translate="no">.<a href="#~calcBSplinePoint">calcBSplinePoint</a><span class="signature">( p : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span>, P : <span class="param-type">Array.<<a href="Vector4.html">Vector4</a>></span>, u : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Vector4.html">Vector4</a></span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The degree of the B-Spline.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>P</strong>
- </td>
- <td class="description last">
- <p>The control points</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The parametric point.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The point for given <code>u</code>.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcBasisFunctionDerivatives" translate="no">.<a href="#~calcBasisFunctionDerivatives">calcBasisFunctionDerivatives</a><span class="signature">( span : <span class="param-type">number</span>, u : <span class="param-type">number</span>, p : <span class="param-type">number</span>, n : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span> )</span><span class="type-signature"> : Array.<Array.<number>></span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>span</strong>
- </td>
- <td class="description last">
- <p>The span in which <code>u</code> lies.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The degree.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>n</strong>
- </td>
- <td class="description last">
- <p>number of derivatives to calculate</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The knot vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> An array[n+1][p+1] with basis functions derivatives.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcBasisFunctions" translate="no">.<a href="#~calcBasisFunctions">calcBasisFunctions</a><span class="signature">( span : <span class="param-type">number</span>, u : <span class="param-type">number</span>, p : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span> )</span><span class="type-signature"> : Array.<number></span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates basis functions. See The NURBS Book, page 70, algorithm A2.2.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>span</strong>
- </td>
- <td class="description last">
- <p>The span in which <code>u</code> lies.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The parametric value.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The degree.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The knot vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Array[p+1] with basis functions values.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcKoverI" translate="no">.<a href="#~calcKoverI">calcKoverI</a><span class="signature">( k : <span class="param-type">number</span>, i : <span class="param-type">number</span> )</span><span class="type-signature"> : number</span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates "K over I".</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>k</strong>
- </td>
- <td class="description last">
- <p>The K value.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>i</strong>
- </td>
- <td class="description last">
- <p>The I value.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> k!/(i!(k-i)!)</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcNURBSDerivatives" translate="no">.<a href="#~calcNURBSDerivatives">calcNURBSDerivatives</a><span class="signature">( p : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span>, P : <span class="param-type">Array.<<a href="Vector4.html">Vector4</a>></span>, u : <span class="param-type">number</span>, nd : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.<<a href="Vector3.html">Vector3</a>></span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The degree.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>P</strong>
- </td>
- <td class="description last">
- <p>The control points in homogeneous space.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>nd</strong>
- </td>
- <td class="description last">
- <p>The number of derivatives.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> array with derivatives for rational curve.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcRationalCurveDerivatives" translate="no">.<a href="#~calcRationalCurveDerivatives">calcRationalCurveDerivatives</a><span class="signature">( Pders : <span class="param-type">Array.<<a href="Vector4.html">Vector4</a>></span> )</span><span class="type-signature"> : Array.<<a href="Vector3.html">Vector3</a>></span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>Pders</strong>
- </td>
- <td class="description last">
- <p>Array with derivatives.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> An array with derivatives for rational curve.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="~calcSurfacePoint" translate="no">.<a href="#~calcSurfacePoint">calcSurfacePoint</a><span class="signature">( p : <span class="param-type">number</span>, q : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span>, V : <span class="param-type">Array.<number></span>, P : <span class="param-type">Array.<Array.<<a href="Vector4.html">Vector4</a>>></span>, u : <span class="param-type">number</span>, v : <span class="param-type">number</span>, target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates a rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The first degree of B-Spline surface.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>q</strong>
- </td>
- <td class="description last">
- <p>The second degree of B-Spline surface.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The first knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>V</strong>
- </td>
- <td class="description last">
- <p>The second knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>P</strong>
- </td>
- <td class="description last">
- <p>The control points in homogeneous space.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The first parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>v</strong>
- </td>
- <td class="description last">
- <p>The second parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>target</strong>
- </td>
- <td class="description last">
- <p>The target vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="~calcVolumePoint" translate="no">.<a href="#~calcVolumePoint">calcVolumePoint</a><span class="signature">( p : <span class="param-type">number</span>, q : <span class="param-type">number</span>, r : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span>, V : <span class="param-type">Array.<number></span>, W : <span class="param-type">Array.<number></span>, P : <span class="param-type">Array.<Array.<Array.<<a href="Vector4.html">Vector4</a>>>></span>, u : <span class="param-type">number</span>, v : <span class="param-type">number</span>, w : <span class="param-type">number</span>, target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Calculates a rational B-Spline volume point. See The NURBS Book, page 134, algorithm A4.3.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The first degree of B-Spline surface.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>q</strong>
- </td>
- <td class="description last">
- <p>The second degree of B-Spline surface.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>r</strong>
- </td>
- <td class="description last">
- <p>The third degree of B-Spline surface.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The first knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>V</strong>
- </td>
- <td class="description last">
- <p>The second knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>W</strong>
- </td>
- <td class="description last">
- <p>The third knot vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>P</strong>
- </td>
- <td class="description last">
- <p>The control points in homogeneous space.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The first parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>v</strong>
- </td>
- <td class="description last">
- <p>The second parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>w</strong>
- </td>
- <td class="description last">
- <p>The third parametric point.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>target</strong>
- </td>
- <td class="description last">
- <p>The target vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="~findSpan" translate="no">.<a href="#~findSpan">findSpan</a><span class="signature">( p : <span class="param-type">number</span>, u : <span class="param-type">number</span>, U : <span class="param-type">Array.<number></span> )</span><span class="type-signature"> : number</span> <span class="type-signature">(inner) </span></h3>
- <div class="method">
- <div class="description">
- <p>Finds knot vector span.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>p</strong>
- </td>
- <td class="description last">
- <p>The degree.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>u</strong>
- </td>
- <td class="description last">
- <p>The parametric value.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>U</strong>
- </td>
- <td class="description last">
- <p>The knot vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The span.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/curves/NURBSUtils.js" translate="no" target="_blank" rel="noopener">examples/jsm/curves/NURBSUtils.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|