Class: Solid
A Solid represents an enclosed 3D volume -- the most complete geometric type in Beegraphy's CAD kernel. Solids are watertight shapes bounded by faces, edges, and vertices, making them suitable for physical manufacturing and simulation workflows.
When to use
- Creating physical objects -- any geometry that needs a definable inside and outside (e.g., a machined part, a mold cavity).
- Boolean operations -- combine, subtract, or intersect solids to build complex shapes from simple primitives.
- Manufacturing outputs -- solids can be meshed, measured, offset, and exported for CNC, 3D printing, or rendering pipelines.
Quick start
Key methods
| Method | Description |
|---|---|
union(geometries) | Combine solids into one shape |
difference(geometries) | Subtract solids from this solid |
intersection(geometries) | Keep only overlapping volume |
fillet() | Round edges with a fillet |
splitSolid(cutter) | Split the solid by a plane, curve, surface, or solid |
offset(size, side, type) | Offset (shell) the solid by a given distance |
bBox() | Get bounding box with width, length, height, area, and center |
volume() | Calculate the solid's volume |
area() | Calculate the total surface area |
faces() | Retrieve all faces of the solid |
edges() | Retrieve all edges of the solid |
render(linDeflection, angDeflection) | Mesh the solid into triangle buffers for visualization |
closestPoint(point) | Find the nearest point on the solid to a given point |
centerOfMass() | Calculate the center of mass |
Method: type
Gets the type of the solid.
Returns
The type of the solid.
Example
Method: faces
Returns an array of faces contained in the Solid.
Returns
TopoDS_Face[] The array of faces.
Example
Method: wires
Retrieves the wires contained in the Solid.
Returns
An array of TopoDS_Wire objects representing the wires in the Solid.
Example
Method: edges
Retrieves the edges of the Solid.
Returns
An array of TopoDS_Edge objects representing the edges of the Solid.
Example
Method: getWires
Retrieves an array of TopoDS_Wire objects representing the wires of the Solid.
Returns
TopoDS_Wire[] An array of TopoDS_Wire objects.
Example
Method: getFaces
Retrieves the faces of the solid.
Returns
An array of TopoDS_Face objects representing the faces of the solid.
Example
Method: getEdges
Retrieves an array of TopoDS_Edge objects representing the edges of the Solid.
Returns
TopoDS_Edge[] An array of TopoDS_Edge objects.
Example
Method: render
Renders the solid and returns the triangle, position, normal, and UV buffers.
Parameters
linDeflection(number): The linear deflection value for meshing the solid. Default is 1.angDeflection(number): The angular deflection value for meshing the solid. Default is 1.
Returns
An object containing the triangle, position, normal, and UV buffers.
Example
Method: flip
Flips the orientation of the solid.
Returns
A new Solid object with the flipped orientation.
Example
Method: brepEdges
Retrieves the B-rep edges of the solid.
Returns
An object containing the edges and face edges of the solid.
Example
Method: fillet
Applies a fillet operation to the solid.
Returns
A new Solid object with the fillet applied.
Example
Method: union
Performs a union operation on the given solids and returns a new Solid.
Parameters
geometries(IGeometry[]): An array of Solid objects to be union.
Returns
A new Solid object representing the union of the solids.
Example
Method: intersection
Calculates the intersection of the given solids with the current Solid.
Parameters
geometries(IGeometry[]): An array of Solid objects to intersect with the current Solid.
Returns
An array of Solid objects representing the intersection solids.
Example
Method: difference
Performs a difference operation on the given solids and returns a new Solid.
Parameters
geometries(IGeometry[]): An array of Solid objects to perform the difference operation with.
Returns
A new Solid resulting from the difference operation.
Example
Method: intersectSurfacesOrSolidsPoints
Calculates the intersection of the given solids.
Parameters
solid(Solid): An array of Solid objects to intersect with each other.
Returns
An array of Points representing the intersection solids.
Example
Method: intersectSurfacesOrSolidsCurves
Calculates the intersection of the given solids.
Parameters
solid(Solid): An array of Solid objects to intersect with each other.
Returns
An array of Curves representing the intersection solids.
Example
Method: closestPoint
Finds the closest point on the solid to the given point.
Parameters
point(IVector): The point to find the closest point to.
Returns
An object containing the nearest point and an array of points on the solid, if there are multiple closest points.
Example
Method: bBox
Calculates the bounding box of the solid.
Returns
An object containing the width, length, height, area, center, and bounding box of the solid.
Example
Method: centerOfMass
Calculates the center of mass for the solid.
Returns
The center of mass as a Vector.
Example
Method: isoCurve
Calculates the iso curve for a given point on the face.
Parameters
point(IVector): The point on the face.
Returns
An object containing the u and v iso curves.
Example
Method: area
Calculates the area of the solid.
Returns
The area of the solid.
Example
Method: volume
Calculates the volume of the solid.
Returns
The volume of the solid.
Example
Method: offset
Offsets the solid by the specified size and parameters.
Parameters
offsetSize(number): The size of the offset.side(boolean): A boolean value indicating whether the offset is on the side.offsetType(OffsetType): The type of offset. Defaults to OffsetType.Arc.
Returns
A new Solid object representing the offset solid.
Example
Method: boxCorners
Retrieves the corners of the box encapsulating the solid.
Returns
An object containing the corners of the box:
Example
Method: boxProperties
Calculates the properties of a solid box.
Returns
An object containing the center, diagonal, area, and volume of the box.
Example
Method: isEquivalentCurve
Checks if two curves are equivalent.
Parameters
curve1(ICurve): No descriptioncurve2(ICurve): No description
Returns
True if the curves are equivalent, false otherwise.
Example
Method: deconstructSolid
Deconstructs the solid into its constituent parts.
Returns
An object containing the faces, edges, and vertices of the solid.
Example
Method: splitSolid
Splits the solid by a given geometry or plane.
Parameters
cutter(IPlane | ICurve | ISurface | ISolid): The geometry or plane used to split the solid.
Returns
An array of Solid objects resulting from the split.
Example
Method: splitSolidMultiple
Splits the solid into multiple solids using the provided cutters.
Parameters
cutters((IPlane | ICurve | ISurface | ISolid): An array of objects representing the cutters.
Returns
An array of Solid objects resulting from the split operation.
Example
Method: mirrorByCurve
Mirrors the solid by a given curve.
Parameters
curve(ICurve): The curve to mirror the solid by.
Returns
The mirrored solid.
Example
Method: extremes
Calculates the extremes of a solid in relation to a given plane.
Parameters
plane(IPlane): The plane to calculate the extremes from.
Returns
An object containing the highest and lowest points on the solid in relation to the plane.
Example
Method: contours
Calculates the contours of a solid object based on the given plane and distance.
Parameters
plane(IPlane): The plane to calculate the contours on.distance(number): The distance between each contour.
Returns
An array of Curve objects representing the contours of the solid.
Example
Method: solidPlane
Gets the intersection curves between a Solid and a Plane.
Parameters
plane(IPlane): The plane to calculate the contours on.
Returns
An array of Curve objects representing the section curves.
Example
Method: dump
Returns a string representation of the Solid object.
Returns
The string representation of the Solid object.