|
@@ -13,10 +13,20 @@ import {
|
|
|
* https://prideout.net/blog/old/blog/index.html@p=44.html
|
|
* https://prideout.net/blog/old/blog/index.html@p=44.html
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-// GrannyKnot
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Granny Knot curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class GrannyKnot extends Curve {
|
|
class GrannyKnot extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -33,18 +43,39 @@ class GrannyKnot extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// HeartCurve
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A heart curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class HeartCurve extends Curve {
|
|
class HeartCurve extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new heart curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=5] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 5 ) {
|
|
constructor( scale = 5 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 5
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -61,18 +92,39 @@ class HeartCurve extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Viviani's Curve
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Viviani curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class VivianiCurve extends Curve {
|
|
class VivianiCurve extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Viviani curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=70] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 70 ) {
|
|
constructor( scale = 70 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 70
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -90,10 +142,20 @@ class VivianiCurve extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// KnotCurve
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A knot curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class KnotCurve extends Curve {
|
|
class KnotCurve extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -113,11 +175,20 @@ class KnotCurve extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-// HelixCurve
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A helix curve.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class HelixCurve extends Curve {
|
|
class HelixCurve extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -137,18 +208,39 @@ class HelixCurve extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// TrefoilKnot
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Trefoil Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class TrefoilKnot extends Curve {
|
|
class TrefoilKnot extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Trefoil Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=10] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 10 ) {
|
|
constructor( scale = 10 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 10
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -165,18 +257,39 @@ class TrefoilKnot extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// TorusKnot
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A torus knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class TorusKnot extends Curve {
|
|
class TorusKnot extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new torus knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=10] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 10 ) {
|
|
constructor( scale = 10 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 10
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -196,18 +309,39 @@ class TorusKnot extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// CinquefoilKnot
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Cinquefoil Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class CinquefoilKnot extends Curve {
|
|
class CinquefoilKnot extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Cinquefoil Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=10] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 10 ) {
|
|
constructor( scale = 10 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 10
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -227,19 +361,39 @@ class CinquefoilKnot extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-// TrefoilPolynomialKnot
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Trefoil Polynomial Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class TrefoilPolynomialKnot extends Curve {
|
|
class TrefoilPolynomialKnot extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Trefoil Polynomial Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=10] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 10 ) {
|
|
constructor( scale = 10 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 10
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -263,18 +417,39 @@ function scaleTo( x, y, t ) {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// FigureEightPolynomialKnot
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Figure Eight Polynomial Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class FigureEightPolynomialKnot extends Curve {
|
|
class FigureEightPolynomialKnot extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Figure Eight Polynomial Knot.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=1] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 1 ) {
|
|
constructor( scale = 1 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 1
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -291,18 +466,39 @@ class FigureEightPolynomialKnot extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// DecoratedTorusKnot4a
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Decorated Torus Knot 4a.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class DecoratedTorusKnot4a extends Curve {
|
|
class DecoratedTorusKnot4a extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Decorated Torus Knot 4a.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=1] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 40 ) {
|
|
constructor( scale = 40 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 40
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -319,18 +515,39 @@ class DecoratedTorusKnot4a extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// DecoratedTorusKnot4b
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Decorated Torus Knot 4b.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class DecoratedTorusKnot4b extends Curve {
|
|
class DecoratedTorusKnot4b extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Decorated Torus Knot 4b.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=1] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 40 ) {
|
|
constructor( scale = 40 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 40
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -347,19 +564,39 @@ class DecoratedTorusKnot4b extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-// DecoratedTorusKnot5a
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Decorated Torus Knot 5a.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class DecoratedTorusKnot5a extends Curve {
|
|
class DecoratedTorusKnot5a extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Decorated Torus Knot 5a.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=1] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 40 ) {
|
|
constructor( scale = 40 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 40
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|
|
@@ -376,18 +613,39 @@ class DecoratedTorusKnot5a extends Curve {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// DecoratedTorusKnot5c
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * A Decorated Torus Knot 5c.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @augments Curve
|
|
|
|
|
+ */
|
|
|
class DecoratedTorusKnot5c extends Curve {
|
|
class DecoratedTorusKnot5c extends Curve {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Constructs a new Decorated Torus Knot 5c.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} [scale=1] - The curve's scale.
|
|
|
|
|
+ */
|
|
|
constructor( scale = 40 ) {
|
|
constructor( scale = 40 ) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The curve's scale.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 40
|
|
|
|
|
+ */
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * This method returns a vector in 3D space for the given interpolation factor.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.
|
|
|
|
|
+ * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.
|
|
|
|
|
+ * @return {Vector3} The position on the curve.
|
|
|
|
|
+ */
|
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
getPoint( t, optionalTarget = new Vector3() ) {
|
|
|
|
|
|
|
|
const point = optionalTarget;
|
|
const point = optionalTarget;
|