Business

Class: Solid

Class representing a Solid.

Method: type

Gets the type of the solid.

Returns

The type of the solid.

Example

const instance = new Solid();
instance.type();

Method: faces

Returns an array of faces contained in the Solid.

Returns

TopoDS_Face[] The array of faces.

Example

const instance = new Solid();
instance.faces();

Method: wires

Retrieves the wires contained in the Solid.

Returns

An array of TopoDS_Wire objects representing the wires in the Solid.

Example

const instance = new Solid();
instance.wires();

Method: edges

Retrieves the edges of the Solid.

Returns

An array of TopoDS_Edge objects representing the edges of the Solid.

Example

const instance = new Solid();
instance.edges();

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

const instance = new Solid();
instance.getWires();

Method: getFaces

Retrieves the faces of the solid.

Returns

An array of TopoDS_Face objects representing the faces of the solid.

Example

const instance = new Solid();
instance.getFaces();

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

const instance = new Solid();
instance.getEdges();

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

const linDeflection = 0.5;
const angDeflection = 0.5;
const instance = new Solid();
instance.render(linDeflection, angDeflection);

Method: flip

Flips the orientation of the solid.

Returns

A new Solid object with the flipped orientation.

Example

const instance = new Solid();
instance.flip();

Method: brepEdges

Retrieves the B-rep edges of the solid.

Returns

An object containing the edges and face edges of the solid.

Example

const instance = new Solid();
instance.brepEdges();

Method: fillet

Applies a fillet operation to the solid.

Returns

A new Solid object with the fillet applied.

Example

const instance = new Solid();
instance.fillet();

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

const geometries = /* specify a geometries */;
const instance = new Solid();
instance.union(geometries);

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

const geometries = /* specify a geometries */;
const instance = new Solid();
instance.intersection(geometries);

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

const geometries = /* specify a geometries */;
const instance = new Solid();
instance.difference(geometries);

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

const solid = /* specify a solid */;
const instance = new Solid();
instance.intersectSurfacesOrSolidsPoints(solid);

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

const solid = /* specify a solid */;
const instance = new Solid();
instance.intersectSurfacesOrSolidsCurves(solid);

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

const point = new Vector(1, 1, 1);
const instance = new Solid();
instance.closestPoint(point);

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

const instance = new Solid();
instance.bBox();

Method: centerOfMass

Calculates the center of mass for the solid.

Returns

The center of mass as a Vector.

Example

const instance = new Solid();
instance.centerOfMass();

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

const point = new Vector(1, 1, 1);
const instance = new Solid();
instance.isoCurve(point);

Method: area

Calculates the area of the solid.

Returns

The area of the solid.

Example

const instance = new Solid();
instance.area();

Method: volume

Calculates the volume of the solid.

Returns

The volume of the solid.

Example

const instance = new Solid();
instance.volume();

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

const offsetSize = 0.5;
const side = /* specify a side */;
const offsetType = /* specify a offsetType */;
const instance = new Solid();
instance.offset(offsetSize, side, offsetType);

Method: boxCorners

Retrieves the corners of the box encapsulating the solid.

Returns

An object containing the corners of the box:

Example

const instance = new Solid();
instance.boxCorners();

Method: boxProperties

Calculates the properties of a solid box.

Returns

An object containing the center, diagonal, area, and volume of the box.

Example

const instance = new Solid();
instance.boxProperties();

Method: isEquivalentCurve

Checks if two curves are equivalent.

Parameters

  • curve1 (ICurve): No description
  • curve2 (ICurve): No description

Returns

True if the curves are equivalent, false otherwise.

Example

const curve1 = CurveBuilder.line(new Vector(0, 0, 0), new Vector(1, 1, 1));
const curve2 = CurveBuilder.line(new Vector(0, 0, 0), new Vector(1, 1, 1));
const instance = new Solid();
instance.isEquivalentCurve(curve1, curve2);

Method: deconstructSolid

Deconstructs the solid into its constituent parts.

Returns

An object containing the faces, edges, and vertices of the solid.

Example

const instance = new Solid();
instance.deconstructSolid();

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

const cutter = /* specify a cutter */;
const instance = new Solid();
instance.splitSolid(cutter);

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

const cutters = /* specify a cutters */;
const instance = new Solid();
instance.splitSolidMultiple(cutters);

Method: mirrorByCurve

Mirrors the solid by a given curve.

Parameters

  • curve (ICurve): The curve to mirror the solid by.

Returns

The mirrored solid.

Example

const curve = CurveBuilder.line(new Vector(0, 0, 0), new Vector(1, 1, 1));
const instance = new Solid();
instance.mirrorByCurve(curve);

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

const plane = /* specify a plane */;
const instance = new Solid();
instance.extremes(plane);

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

const plane = /* specify a plane */;
const distance = 0.5;
const instance = new Solid();
instance.contours(plane, distance);

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

const plane = /* specify a plane */;
const instance = new Solid();
instance.solidPlane(plane);

Method: dump

Returns a string representation of the Solid object.

Returns

The string representation of the Solid object.

Example

const instance = new Solid();
instance.dump();