@bitbybit-dev/core
Version:
Bit By Bit Developers Core CAD API to Program Geometry
35 lines (34 loc) • 962 B
JavaScript
/**
* Spherical surface functions.
* These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/.
* Thanks Peter Boyer for his work.
*/
export class VerbSurfaceSpherical {
constructor(context) {
this.context = context;
}
/**
* Creates the spherical Nurbs surface
* @param inputs Parameters for Nurbs spherical surface
* @returns Spherical Nurbs surface
*/
create(inputs) {
return new this.context.verb.geom.SphericalSurface(inputs.center, inputs.radius);
}
/**
* Get the radius of the spherical Nurbs surface
* @param inputs Spherical Nurbs surface
* @returns Radius
*/
radius(inputs) {
return inputs.sphere.radius();
}
/**
* Get the center of the spherical Nurbs surface
* @param inputs Spherical Nurbs surface
* @returns Center point
*/
center(inputs) {
return inputs.sphere.center();
}
}