Creates an I-beam by extruding its flat profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The I-beam profile and the two extrusion lengths
A new solid
const beam = await bitbybit.occt.shapes.solid.createIBeamProfileSolid({
width: 10,
height: 20,
flangeThickness: 1,
webThickness: 1,
alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
rotation: 0,
center: [0, 0, 0],
direction: [0, 0, 1],
extrusionLengthFront: 100,
extrusionLengthBack: 0,
});
Creates an H-beam by extruding its flat profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The H-beam profile and the two extrusion lengths
A new solid
const beam = await bitbybit.occt.shapes.solid.createHBeamProfileSolid({
width: 20,
height: 20,
flangeThickness: 1,
webThickness: 1,
alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
rotation: 0,
center: [0, 0, 0],
direction: [0, 0, 1],
extrusionLengthFront: 100,
extrusionLengthBack: 0,
});
Creates a T-beam by extruding its flat profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The T-beam profile and the two extrusion lengths
A new solid
const beam = await bitbybit.occt.shapes.solid.createTBeamProfileSolid({
width: 10,
height: 20,
flangeThickness: 1,
webThickness: 1,
alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
rotation: 0,
center: [0, 0, 0],
direction: [0, 0, 1],
extrusionLengthFront: 100,
extrusionLengthBack: 0,
});
Creates a U-beam by extruding its flat profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The U-beam profile and the two extrusion lengths
A new solid
const beam = await bitbybit.occt.shapes.solid.createUBeamProfileSolid({
width: 10,
height: 20,
flangeThickness: 1,
webThickness: 1,
flangeWidth: 3,
alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
rotation: 0,
center: [0, 0, 0],
direction: [0, 0, 1],
extrusionLengthFront: 100,
extrusionLengthBack: 0,
});
Collects diagnostic facts about a solid: whether it is valid, how many faces and edges it has, its surface area and volume, and for every face the surface type, degrees, control point counts, bounds and area.
An empty or null shape gives a report marked invalid with zero counts.
The solid to inspect
The report with counts, area, volume and one entry per face
Keeps the points that lie inside, on the surface of, or outside a solid, as chosen by the
keepIn, keepOn and keepOut flags.
A point counts as on the surface when it is within tolerance of it. Points the kernel
cannot classify are kept only with keepUnknown.
The solid, the points, the tolerance and which classes of point to keep
The points that passed the filter, in their original order
Turns a closed shell into a solid, so the volume it encloses becomes a body that can be measured, booleaned and meshed.
The shell must be watertight; a shell with gaps produces a solid the kernel cannot use.
The closed shell
The solid bounded by the shell
Measures the total area of all the faces of a solid.
The solid
The surface area in square model units
Measures the volume a solid encloses, in cubic model units.
The solid
The volume in cubic model units
Measures the volume of each solid in a list.
The solids
One volume per solid, in the same order
Finds the center of mass of a solid, treating it as filled with material of uniform density.
The solid
The center of mass point
Finds the center of mass of each solid in a list, treating each as filled with material of uniform density.
The solids
One point per solid, in the same order
Lists the solids inside any shape, such as the bodies of a compound or the result of a boolean.
A shape that is itself a solid gives a list with that one solid.
The shape to take the solids from
The solids found in the shape
Creates a box solid with its sides parallel to the axes.
width runs along X, height along Y (up) and length along Z, all in model units. By
default the box is centered on center; with originOnCenter set to false it stands on that
point instead, so center becomes the middle of the bottom face.
Box size, the point it is placed on, and whether it is centered on or stands on it
A new solid
Creates a cube solid, a box with all three sides the same size, parallel to the axes.
By default the cube is centered on center; with originOnCenter set to false it stands on
that point instead, so center becomes the middle of the bottom face.
A new solid
Creates a box solid that starts at a corner point and extends along the positive axes.
The corner with the smallest x, y and z sits at corner; the box reaches width along X,
height along Y and length along Z from there, all in model units.
Box size and the corner it grows from
A new solid
Creates a cylinder solid with a round base at center, growing height along direction.
With originOnCenter on, the cylinder is shifted back by half its height so center sits in
its middle. angle, in degrees, cuts a wedge out of the full 360 degree round, like a slice
of cake.
Radius, height, base center, direction, an optional partial angle and whether to center on the point
A new solid
Creates one cylinder solid along each line, from its start to its end, all with the same radius.
The height of each cylinder is the length of its line.
The lines and the radius
One solid per line, in the same order
Creates a sphere solid of the given radius around a center point.
A new solid
Creates a cone solid, or a truncated cone when both radii are above 0, standing on a round
base at center and growing height along direction.
radius1 is the base and radius2 the top; a top radius of 0 makes a pointed cone. angle,
in degrees, cuts a wedge out of the full 360 degree round.
A new solid
Creates a torus solid, a ring with a round cross-section, centered on center with its axis
along direction.
majorRadius is the distance from the center to the middle of the tube and minorRadius the
tube's own radius. angle, in degrees, makes a partial ring instead of the full 360 degrees.
A new solid
Creates a star-shaped solid by extruding a flat star profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown. The star itself is built as
shapes.wire.createStarWire builds it.
The star profile and the two extrusion lengths
A new solid
Creates a solid with a regular polygon cross-section by extruding a flat n-gon profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The polygon profile and the two extrusion lengths
A new solid
Creates a solid with a parallelogram cross-section by extruding a flat parallelogram profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The parallelogram profile and the two extrusion lengths
A new solid
Creates a heart-shaped solid by extruding a flat heart profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The heart profile and the two extrusion lengths
A new solid
Creates a Christmas tree-shaped solid by extruding a flat tree profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The tree profile and the two extrusion lengths
A new solid
Creates an L-shaped solid by extruding a flat L profile forward and backward along its own normal.
extrusionLengthFront and extrusionLengthBack say how far it grows each way, in model
units; at least one must be above 0 or an error is thrown.
The L profile and the two extrusion lengths
A new solid
Solids in OpenCascade: closed shapes that enclose a volume. Build one from a primitive (
createBox,createSphere,createCylinder,createCone,createTorus), from a flat profile extruded front and back (the star, n-gon, heart, beam and other profile solids), or from a closed shell withfromClosedShell; then measure it with the volume, surface area and center of mass getters, and filter points by whether they lie inside it. Vertices, edges, wires, faces, shells and compounds have their own classes beside this one undershapes.