Class: SolidBuilder
SolidBuilder is a factory class for creating solid primitives -- boxes, spheres, cylinders, cones, tori, and lofted shapes. All methods are static, so you never need to instantiate the class; just call SolidBuilder.box(...) directly.
When to use
- Creating basic 3D shapes -- start with primitives and refine them with boolean operations, fillets, or transformations.
- Rapid prototyping -- quickly assemble geometry from boxes, cylinders, and spheres before moving to complex surface modeling.
- Building blocks for booleans -- create cutters, pockets, and bosses to combine with
Solid.union,Solid.difference, andSolid.intersection.
Quick start
Key methods
| Method | Description |
|---|---|
box(origin, width, length, height) | Create a rectangular box solid |
box2Pnt(point1, point2) | Create a box defined by two corner points |
sphere(origin, radius) | Create a sphere solid |
cylinder(origin, radius, height) | Create a cylinder solid |
cone(origin, radius1, radius2, height) | Create a cone or frustum solid |
torus(origin, radius1, radius2) | Create a torus (donut) solid |
loft(surfaces, degree) | Create a lofted solid from an array of surfaces |
Static Method: box
Creates a box solid with the specified dimensions.
Parameters
origin(IVector): The origin point of the box.width(number): The width of the box.length(number): The length of the box.height(number): The height of the box.
Returns
A Solid object representing the box.
Example
Static Method: box2Pnt
Creates a solid box between two points.
Parameters
point1(IVector): The first point defining the box.point2(IVector): The second point defining the box.
Returns
A Solid object representing the created box.
Example
Static Method: sphere
Creates a sphere solid with the given origin and radius.
Parameters
origin(IVector): The origin point of the sphere.radius(number): The radius of the sphere.
Returns
A Solid object representing the sphere.
Example
Static Method: cone
Creates a cone solid.
Parameters
origin(IVector): The origin point of the cone.radius1(number): The radius of the base of the cone.radius2(number): The radius of the top of the cone.height(number): The height of the cone.
Returns
A Solid object representing the cone.
Example
Static Method: cylinder
Creates a cylinder solid with the specified origin, radius, and height.
Parameters
origin(IVector): The origin point of the cylinder.radius(number): The radius of the cylinder.height(number): The height of the cylinder.
Returns
A Solid object representing the cylinder.
Example
Static Method: torus
Creates a torus solid.
Parameters
origin(IVector): The origin of the torus.radius1(number): The major radius of the torus.radius2(number): The minor radius of the torus.
Returns
A Solid object representing the torus.
Example
Static Method: loft
Creates a lofted solid from the given array of surfaces.
Parameters
surfaces(ISurface[]): The array of surfaces to loft.degree(number): The degree of the lofted solid.
Returns
A new Solid object representing the lofted solid.