Creates the flat cross-section of an I-beam: two horizontal flanges joined by a vertical web.
width is the flange width, height the total height, webThickness and flangeThickness
the wall thicknesses; alignment says which point of the profile's box sits on center,
rotation turns it in its plane, in degrees. It lies on the ground, ready to extrude along
Y.
The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal
The I-beam profile face
const profile = await bitbybit.occt.shapes.face.createIBeamProfileFace({
width: 10,
height: 20,
webThickness: 2,
flangeThickness: 3,
alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
rotation: 0,
center: [0, 0, 0],
direction: [0, 1, 0],
});
const beam = await bitbybit.occt.operations.extrude({ shape: profile, direction: [0, 100, 0] });
Creates the flat cross-section of an H-beam: two vertical flanges joined by a horizontal web, an I-beam on its side.
width is the total width, height the flange height, webThickness and flangeThickness
the wall thicknesses; alignment says which point of the profile's box sits on center,
rotation turns it in its plane, in degrees. It lies on the ground.
The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal
The H-beam profile face
Creates the flat cross-section of a T-beam: a horizontal flange with a vertical web hanging from its middle.
width is the flange width, height the total height, webThickness and flangeThickness
the wall thicknesses; alignment says which point of the profile's box sits on center, and
rotation turns it in its plane, in degrees. It lies flat on the ground.
The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal
The T-beam profile face
Creates the flat cross-section of a U-beam, a channel: a web with two flanges of
flangeWidth standing up from its ends.
width and height are the total size, webThickness and flangeThickness the wall
thicknesses; alignment says which point of the profile's box sits on center, rotation
turns it in its plane, in degrees. It lies flat on the ground.
The profile size, the thicknesses, the flange width, the alignment, the rotation, the center and the plane normal
The U-beam profile face
Collects diagnostic facts about a face: its surface type, U and V degrees, control point and knot counts, whether U or V are closed, periodic or rational, the UV bounds, area, planarity, orientation and the number of wires and edges.
An empty or null face gives a report marked invalid.
The face to inspect
The report
Lays a grid of points over a face by stepping evenly through its U and V ranges.
nrDivisionsU by nrDivisionsV points cover the face edge to edge, listed row by row: all V
values for the first U, then the next U. The removal flags drop the first or last row; the
shift flags push every point half a step.
The face, the number of points in U and V, and the shift and removal options
The points, row by row
Draws evenly spaced wires across a face along one parameter direction, like the lines of a ruled sheet.
nrDivisions steps give one more wire than that, the boundary lines included; removeStart
and removeEnd drop those, shiftHalfStep moves every wire half a step. With isU true
each wire sits at a fixed U and runs across V; false swaps the roles.
The face, the number of divisions, the direction and the options
The wires, in order along the chosen direction
Lays a grid of points over a face like subdivideToPoints, but shifts and removes points on
every nth row or column, for brick-like and staggered patterns.
Each rule is a pair: shiftHalfStepNthU says every how-manyth V row moves half a step in U,
shiftHalfStepUOffsetN where counting starts; the removal rules drop every nth point of an
edge row.
The face, the number of points in U and V, and the nth-row shift and removal rules
The points, row by row
const staggered = await bitbybit.occt.shapes.face.subdivideToPointsControlled({
shape: face,
nrDivisionsU: 10,
nrDivisionsV: 10,
shiftHalfStepNthU: 2,
shiftHalfStepUOffsetN: 0,
removeStartEdgeNthU: 0,
removeStartEdgeUOffsetN: 0,
removeEndEdgeNthU: 0,
removeEndEdgeUOffsetN: 0,
shiftHalfStepNthV: 0,
shiftHalfStepVOffsetN: 0,
removeStartEdgeNthV: 0,
removeStartEdgeVOffsetN: 0,
removeEndEdgeNthV: 0,
removeEndEdgeVOffsetN: 0,
});
Computes the surface normal at every point of the grid subdivideToPoints would lay over a
face, with the same options and the same order.
The normals are unit vectors and follow the face's orientation, so a reversed face gives them
flipped. Pair the list with subdivideToPoints to place things standing on the surface.
The face, the number of points in U and V, and the shift and removal options
The unit normals, row by row
Lists the UV parameter pairs of the grid subdivideToPoints would lay over a face, with the
same options and the same order.
The pairs are in the face's real UV values, not fractions.
The face, the number of points in U and V, and the shift and removal options
The UV pairs, row by row
Finds the point on a face at the given UV fractions.
paramU and paramV run from 0 to 1 over the face's U and V range, so 0.5, 0.5 is the
middle of the range, which on a trimmed face is not always inside the face.
The face and the U and V fractions
The point on the surface
Finds the surface normal of a face at the given UV fractions.
paramU and paramV run from 0 to 1 over the face's U and V range. The normal is a unit
vector and follows the face's orientation, so a reversed face gives it flipped.
The face and the U and V fractions
The unit normal
Finds the points on a face at several UV fraction pairs at once.
Each pair holds U then V, both from 0 to 1 over the face's range.
The face and the list of U and V fraction pairs
One point per pair, in the same order
Finds the surface normals of a face at several UV fraction pairs at once.
Each pair holds U then V, both from 0 to 1 over the face's range. The normals are unit
vectors of the underlying surface; unlike normalOnUV, they are not flipped for a reversed
face.
The face and the list of U and V fraction pairs
One unit normal per pair, in the same order
Places evenly spaced points along one straight line across a face's UV range.
With isU true the line sits at param (a fraction from 0 to 1 of the U range) and
nrPoints points spread over the whole V range; with false the roles swap.
removeStartPoint and removeEndPoint drop the ends, and shiftHalfStep moves every point
half a step.
The face, the direction, the fraction along it, the number of points and the options
The points along the line, in order
Draws one wire across a face along a parameter line, following the surface.
With isU true the wire sits at param (a fraction from 0 to 1 of the U range) and runs
over the whole V range; with false the roles swap.
The face, the direction and the fraction along it
The wire on the surface
Draws several wires across a face, one per parameter value, following the surface.
With isU true each wire sits at its fraction of the U range and runs over the whole V
range; with false the roles swap.
The face, the direction and the fractions along it
One wire per fraction, in the same order
Sorts points as inside a face, on its boundary or outside it, and keeps the chosen groups.
keepIn, keepOn, keepOut and keepUnknown choose the groups; tolerance decides how
close to the boundary counts as on it. With useBndBox, a point outside the bounding box
grown by gapTolerance is outside.
The face, the points, the tolerance, the bounding-box shortcut and which groups to keep
The points that passed, in their original order
Runs filterFacePoints against several faces with the same points and options.
By default the result holds one list per face; with flatPointsArray true the lists are
joined into one, so a point on two faces appears twice.
The faces, the points, the tolerance, which groups to keep and whether to flatten the result
One list of points per face, or a single joined list
Creates one face per wire, each cut from the surface of a guiding face so it takes that surface's curvature.
The wires must lie on the surface. With inside true each wire is turned so its face is the
region it encloses; with false the wire's own direction decides, and a wire running the other
way gives the outside region.
The wires, the guiding face and which side to keep
One face per wire, in the same order
Creates a face from a wire that lies on the surface of a guiding face, so the new face takes the curvature of that surface.
With inside true the wire is turned so the face is the region it encloses; with false the
wire's own direction decides, and a wire running the other way gives the region outside it.
The wire, the guiding face and which side to keep
The new face
Creates a face bounded by a closed wire.
With planar true the wire must lie in one plane and the face is flat; with false a smooth
surface is fitted through the wire's edges, which fills a wire that is not flat. A shape that
is not a wire throws an error.
The wire and whether the face must be flat
The new face
Creates one face from several wires: the first wire is the outer boundary and every further wire cuts a hole in it.
With planar true the wires must lie in one plane. The hole wires must sit inside the outer
one without crossing it or each other.
The wires, outer boundary first, and whether the face must be flat
The face with holes
const outer = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 20, length: 10, center: [0, 0, 0], direction: [0, 1, 0] });
const hole = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 2, center: [0, 0, 0], direction: [0, 1, 0] });
const plate = await bitbybit.occt.shapes.face.createFaceFromWires({ shapes: [outer, hole], planar: true });
Creates one face from several wires on the surface of a guiding face: the first wire is the outer boundary and every further wire cuts a hole.
The face takes the curvature of the guiding surface. inside applies to the first wire: true
turns it so the face is the region it encloses; false lets its own direction decide.
The wires, outer boundary first, the guiding face and which side to keep
The face with holes
Creates one face per closed wire, each as createFaceFromWire would.
With planar true every wire must lie in a plane; with false a smooth surface is fitted
through each.
The wires and whether the faces must be flat
One face per wire, in the same order
Joins circles with tangent belts: for each pair it draws the two outer tangent lines and the outer arcs between them and fills that outline with a flat face.
combination picks the pairs: allWithAll every circle with every other, inOrder
neighbors in the list, inOrderClosed also the last with the first. unify fuses the faces;
otherwise they form a compound.
The circle wires, how to pair them, whether to fuse the result and the tolerance
The fused shape, or the compound of belt faces
const a = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 3, center: [0, 0, 0], direction: [0, 1, 0] });
const b = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 1, center: [10, 0, 0], direction: [0, 1, 0] });
const c = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 2, center: [5, 0, 8], direction: [0, 1, 0] });
const belt = await bitbybit.occt.shapes.face.createFaceFromMultipleCircleTanWires({
circles: [a, b, c],
combination: Bit.Inputs.OCCT.combinationCirclesForFaceEnum.inOrderClosed,
unify: true,
tolerance: 1e-7,
});
Joins circles from consecutive lists with tangent belts, the way
createFaceFromMultipleCircleTanWires joins single circles.
allWithAll joins every circle of a list with every circle of the next; inOrder joins
circles at the same position in neighboring lists, which need equal lengths; inOrderClosed
also closes each list into a ring. unify fuses the faces; otherwise they form a compound.
The lists of circle wires, how to pair them, whether to fuse the result and the tolerance
The fused shape, or the compound of belt faces
Creates a face that covers a whole surface, out to the surface's natural bounds.
tolerance is used to detect degenerate edges, such as the pole of a sphere. Surfaces come
from geom.surfaces.
The surface and the tolerance for degenerate edges
The face
Creates a face by cutting a surface with a wire that lies on it.
With inside true the wire is turned so the face is the region it encloses; with false the
wire's own direction decides, and a wire running the other way gives the region outside it.
Surfaces come from geom.surfaces.
The surface, the wire on it and which side to keep
The face
Creates a flat triangular face from three points.
The triangle as three points
The face
Creates one flat triangular face per triangle of a mesh.
A triangle that cannot form a face, for instance one with repeated points, is skipped with a warning in the console.
The mesh as a list of triangles
One face per triangle that could be built
Picks one face out of a shape by its position, counting from 0, in the order the kernel walks the shape.
The shape must be a face or something built from faces; an index beyond the last face throws an error.
The shape and the 0-based index
The face at that index
Lists every face of a shape in the order the kernel walks it.
The shape
The faces found in the shape
Flips a face so its normal points the other way.
The geometry stays the same; only the orientation changes, which decides the outside of a
shell and the direction normalOnUV reports.
The face
The flipped face
Reads the smallest U parameter value of a face, in the surface's own units.
Together with getUMaxBound, getVMinBound and getVMaxBound it gives the range that the
UV fractions used elsewhere in this class map onto.
The face
The lower U bound
Reads the largest U parameter value of a face, in the surface's own units.
The face
The upper U bound
Reads the smallest V parameter value of a face, in the surface's own units.
The face
The lower V bound
Reads the largest V parameter value of a face, in the surface's own units.
The face
The upper V bound
Measures the surface area of a face, in square model units.
The face
The area
Measures the surface area of each face in a list, in square model units.
The faces
One area per face, in the same order
Finds the center of mass of a face, the point its area balances on.
On a curved or ring-shaped face this point can lie off the surface.
The face
The center of mass
Finds the center of mass of each face in a list.
The faces
One point per face, in the same order
Lays rectangular wires over a face, one per cell of an nrRectanglesU by nrRectanglesV
division of its UV range, following the surface.
The border offsets trim the range at each end. Each rectangle sits centered in its cell, sized by the scale patterns as a fraction of it; the fillet pattern rounds corners, the inclusion pattern skips cells.
The face, the cell counts, the border offsets and the optional patterns
The rectangle wires, cell by cell
Cuts a grid of rectangular holes into a face and returns the perforated face.
The holes follow the same cells and patterns as subdivideToRectangleWires; when no scale
pattern is given each hole covers half its cell. With holesToFaces true the result also
carries one face per hole, after the perforated face, which is handy for lids or fillers.
The face, the cell counts, the border offsets, the optional patterns and whether to return the hole faces
The perforated face, followed by the hole faces when asked for
const [perforated] = await bitbybit.occt.shapes.face.subdivideToRectangleHoles({
shape: face,
nrRectanglesU: 6,
nrRectanglesV: 4,
scalePatternU: [0.6],
scalePatternV: [0.6],
filletPattern: [0.5],
inclusionPattern: [true],
holesToFaces: false,
offsetFromBorderU: 0.05,
offsetFromBorderV: 0.05,
});
Lays a honeycomb of hexagonal wires over a face, nrHexagonsU by nrHexagonsV of them
fitted into its UV range, each following the surface.
The border offsets trim a fraction of the range at each end; flatU turns a flat side toward
U, the extend flags stretch the outer rows past the edges. Scale, fillet and inclusion
patterns repeat per hexagon.
The face, the hexagon counts, the orientation, the border offsets, the extend flags and the optional patterns
The hexagon wires, row by row
Cuts a honeycomb of hexagonal holes into a face and returns the perforated face.
The holes follow the same layout and patterns as subdivideToHexagonWires; when no scale
pattern is given each hole is half the size of its hexagon. With holesToFaces true the
result also carries one face per hole, after the perforated face.
The face, the hexagon counts, the orientation, the border offsets, the optional patterns and whether to return the hole faces
The perforated face, followed by the hole faces when asked for
const [perforated] = await bitbybit.occt.shapes.face.subdivideToHexagonHoles({
shape: face,
nrHexagonsU: 8,
nrHexagonsV: 6,
flatU: false,
holesToFaces: false,
scalePatternU: [0.7],
scalePatternV: [0.7],
filletPattern: [0],
inclusionPattern: [true],
offsetFromBorderU: 0.05,
offsetFromBorderV: 0.05,
});
Creates a flat face from a list of corner points, closing the outline from the last point back to the first.
The points must lie in one plane.
The corner points in order
The face
Creates a flat circular face, a disc.
direction is the normal of its plane: the default [0, 1, 0] lays it flat on the ground.
The disc face
Fills a rectangle on the ground plane with a grid of flat hexagonal faces, centered on the origin.
The hexagons are scaled so nrHexagonsInWidth fit across width and nrHexagonsInHeight
across height. The scale, fillet and inclusion patterns are read hexagon by hexagon and
repeat; the extend flags stretch the outer rows past the edges to cover the rectangle.
The rectangle size, the hexagon counts, the extend flags and the optional patterns
One face per hexagon, row by row
Creates a flat elliptical face.
direction is the normal of its plane: the default [0, 1, 0] lays it flat on the ground.
radiusMajor must be at least radiusMinor.
The two radii, the center and the plane normal
The ellipse face
Creates a flat square face centered on center.
direction is the normal of its plane: the default [0, 1, 0] lays it flat on the ground.
The square face
Creates a flat rectangular face centered on center.
On the ground plane width runs along X and length along Z; direction is the normal of
the plane, and the default [0, 1, 0] keeps the face flat on the ground.
The width, the length, the center and the plane normal
The rectangle face
Creates a flat L-shaped face: two rectangular legs joined at a corner.
The first leg has widthFirst and lengthFirst, the second widthSecond and
lengthSecond; align puts the corner on the outside, inside or middle of the legs, and
rotation turns the shape in its plane, in degrees. It lies flat on the ground unless
direction says otherwise.
The two leg sizes, the alignment, the rotation, the center and the plane normal
The L-shaped face
Creates a flat star-shaped face with numRays points.
The points reach outerRadius and the notches between them innerRadius; half keeps only
the first half of the rays. offsetOuterEdges lifts the ray tips out of the plane and is
meant for the wire; a flat face needs it at 0. It lies flat on the ground unless direction
says otherwise.
The star face
Creates a flat face shaped like a stylized Christmas tree: nrSkirts layers of branches,
narrowing from outerDist to innerDist off the trunk line, on a trunk of trunkHeight and
trunkWidth.
Unlike the other flat shapes here it stands upright in the XY plane, tip along Y; direction
is the trunk-to-tip direction, rotation spins it about that axis, in degrees.
The tree proportions, the trunk size, the options, the origin and the trunk-to-tip direction
The tree face
Creates a flat parallelogram face: a rectangle of width and height whose sides lean over
by angle degrees.
With aroundCenter true the shape is centered on center; otherwise it starts there and
extends in the positive directions. direction is the normal of the plane; the default [0, 1, 0] lays it flat on the ground.
The width, the height, the lean angle, whether to center it, the center and the plane normal
The parallelogram face
Creates a flat heart-shaped face that fits roughly into a square of sizeApprox.
rotation turns it in its plane, in degrees. direction is the normal of the plane; the
default [0, 1, 0] lays it flat on the ground.
The approximate size, the rotation, the center and the plane normal
The heart face
Creates a flat regular polygon face with nrCorners corners, all on a circle of radius.
direction is the normal of the plane; the default [0, 1, 0] lays it flat on the ground.
The number of corners, the radius, the center and the plane normal
The polygon face
Rebuilds the surface of a face as a B-spline of the given U and V degrees.
Lowering a degree smooths the surface into a simpler approximation within tolerance;
raising it is exact. keepTrim keeps the original boundary wires, which is reliable when
raising; otherwise the face covers the whole new surface. A rebuild that fails gives a null
face.
The face, the target U and V degrees, the tolerance and whether to keep the boundary
The rebuilt face
Changes how the UV parameters run over a face: swap U and V, reverse U, reverse V, or any combination.
The geometry stays the same; only the parameter directions change, which matters for every
method here that works in UV, such as subdivideToPoints or wireAlongParam. The face is
rebuilt over the surface's natural bounds.
The face and which flips to apply
The face with the changed parametrization
Reparametrizes a face so equal steps in U or V give roughly equal distances on the surface.
Many surfaces bunch their parameters up in places, so a UV grid over them looks uneven; this
resamples the surface at samples points per direction and refits it, which evens out
subdivideToPoints and its siblings. The face is rebuilt over the new bounds.
The face, which directions to normalize, the sample count and the fit tolerance
The reparametrized face
Faces in OpenCascade: bounded pieces of a surface, flat or curved, with an outer boundary wire and optional inner wires that make holes. Build them from wires or surfaces, or as ready-made flat shapes (circles, rectangles, stars, beam profiles) that lie on the ground plane unless
directionsays otherwise; walk their surface through UV parameters to get points, normals and grids of wires; cut hole patterns into them; and measure area and center of mass. U and V are the two directions of a surface, given here as fractions from 0 to 1 of the face's own range. Faces join edge to edge into shells, whichshapes.shellhandles.