54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
/**
|
|
* R3.D3.API.Geometry.Buffer.TorusKnot
|
|
* @param apiComponent
|
|
*
|
|
* @property radius
|
|
* @property tube
|
|
* @property radialSegments
|
|
* @property tubularSegments
|
|
* @property p
|
|
* @property q
|
|
*
|
|
* @constructor
|
|
*/
|
|
R3.D3.API.Geometry.Buffer.TorusKnot = function(
|
|
apiComponent
|
|
) {
|
|
|
|
__API_GEOMETRY_BUFFER__;
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiComponent.radius)) {
|
|
apiComponent.radius = 1;
|
|
}
|
|
this.radius = apiComponent.radius;
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiComponent.tube)) {
|
|
apiComponent.tube = 0.4;
|
|
}
|
|
this.tube = apiComponent.tube;
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiComponent.radialSegments)) {
|
|
apiComponent.radialSegments = 8;
|
|
}
|
|
this.radialSegments = apiComponent.radialSegments;
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiComponent.tubularSegments)) {
|
|
apiComponent.tubularSegments = 64;
|
|
}
|
|
this.tubularSegments = apiComponent.tubularSegments;
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiComponent.p)) {
|
|
apiComponent.p = 2;
|
|
}
|
|
this.p = apiComponent.p;
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiComponent.q)) {
|
|
apiComponent.q = 3;
|
|
}
|
|
this.q = apiComponent.q;
|
|
|
|
};
|
|
|
|
R3.D3.API.Geometry.Buffer.TorusKnot.prototype = Object.create(R3.D3.API.Geometry.Buffer.prototype);
|
|
R3.D3.API.Geometry.Buffer.TorusKnot.prototype.constructor = R3.D3.API.Geometry.Buffer.TorusKnot;
|