Removes faces from a solid and closes the gap by extending the faces around them, as when a hole or a rounded edge is deleted from a part.
The shape must hold solids only; a gap its neighbours cannot close, such as the top of a box leaves, is refused rather than left open.
The shape and the faces to remove
The shape without the faces
Moves faces of a shape along their outward normals and stretches the faces around them to follow, such as raising the top of a block.
distance moves every chosen face, a negative one inward; distances gives one per index
instead. Each solid of a compound moves on its own and stays a solid.
The shape, the faces and how far to move them
The shape with the faces moved
Grows a boss out of a base by sweeping a profile face that lies on one of its faces along
direction.
extent stops it after length, at the face untilFaceIndex names, such as the underside of
an overhang, or through all of the base in its way, which needs base ahead of it.
The base, the profile, its sketch face, the direction and how far to go
The base with the boss
const block = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 5, 0] });
const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 });
const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] });
const bossed = await bitbybit.occt.features.boss({ shape: block, profile, sketchFaceIndex: top, direction: [0, 1, 0], length: 3 });
Cuts a pocket into a base by sweeping a profile face that lies on one of its faces along
direction, which points into the base.
extent stops it after length, at the face untilFaceIndex names, such as the ceiling of a
void or the far side of the base, or through all of it.
The base, the profile, its sketch face, the direction and how far to go
The base with the pocket
const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 });
const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] });
const pocketed = await bitbybit.occt.features.pocket({ shape: block, profile, sketchFaceIndex: top, direction: [0, -1, 0], length: 3 });
Grows a boss out of a base as boss does, straight out of the sketch face, with its sides
leaning by angle degrees.
A positive angle narrows the boss as it rises from the sketch face, a negative one widens it
and rounds its outer corners. extent works as for boss.
The base, the profile, its sketch face, the draft angle in degrees and how far to go
The base with the tapered boss
const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 });
const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] });
const bossed = await bitbybit.occt.features.taperedBoss({ shape: block, profile, sketchFaceIndex: top, angle: 10, length: 3 });
Cuts a pocket into a base as pocket does, straight in from the sketch face, with its sides
leaning by angle degrees.
A positive angle narrows the pocket as it deepens, a negative one widens it. The kernel cannot stop a tapered pocket at the far side of the base; run it through all instead.
The base, the profile, its sketch face, the draft angle in degrees and how far to go
The base with the tapered pocket
const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 });
const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] });
const pocketed = await bitbybit.occt.features.taperedPocket({ shape: block, profile, sketchFaceIndex: top, angle: 5, length: 3 });
Adds a ring to a base by turning a profile face about an axis, such as a collar round a shaft: the profile lies on a face of the base, in a plane through the axis.
angle is in degrees and follows the right-hand rule about axisDirection; 360 makes a whole
ring.
The base, the profile, its sketch face, the axis and the angle in degrees
The base with the ring
const shaft = await bitbybit.occt.shapes.solid.createCylinder({ radius: 5, height: 10, center: [0, 0, 0], direction: [0, 1, 0] });
const [side] = await bitbybit.occt.select.faces.ofType({ shape: shaft, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder });
const profile = await bitbybit.occt.shapes.face.createRectangleFace({ width: 2, length: 1, center: [5.5, 5, 0], direction: [0, 0, 1] });
const collared = await bitbybit.occt.features.revolvedBoss({ shape: shaft, profile, sketchFaceIndex: side, axisOrigin: [0, 0, 0], axisDirection: [0, 1, 0], angle: 360 });
Cuts a groove round a base by turning a profile face about an axis, such as the seat of a circlip on a shaft: the profile lies on a face of the base, in a plane through the axis.
angle is in degrees and follows the right-hand rule about axisDirection; 360 cuts all the
way round.
The base, the profile, its sketch face, the axis and the angle in degrees
The base with the groove
const [side] = await bitbybit.occt.select.faces.ofType({ shape: shaft, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder });
const profile = await bitbybit.occt.shapes.face.createRectangleFace({ width: 2, length: 1, center: [4.5, 5, 0], direction: [0, 0, 1] });
const grooved = await bitbybit.occt.features.revolvedPocket({ shape: shaft, profile, sketchFaceIndex: side, axisOrigin: [0, 0, 0], axisDirection: [0, 1, 0], angle: 360 });
Adds a rib to a base: the region between a wire and the base's faces, on the wire's left as it runs seen from the side the frame's normal points to, filled and thickened across the plane.
A wire across the inside corner of an L fills the corner; an edge is made into a wire first.
The base, the wire, the plane it lies in and the thickness on each side
The base with the rib
Cuts a groove into a base: the part of the base's section on the left of a wire as it runs, seen from the side the frame's normal points to, removed across the plane.
A wire bent round a corner keeps the region inside the bend and cuts the rest; an edge is made into a wire first.
The base, the wire, the plane it lies in and the thickness on each side
The base with the groove
const wire = await bitbybit.occt.shapes.wire.createPolylineWire({ points: [[10, 12, 0], [10, 5, 0], [22, 5, 0]] });
const grooved = await bitbybit.occt.features.groove({
shape: block,
wire,
frame: { origin: [0, 0, 0], normal: [0, 0, -1], direction: [1, 0, 0] },
thickness: 0.5,
otherSideThickness: 0.5,
});
Drills plain holes into a shape, one at each frame: its origin is where the hole enters and its normal points out of the material.
depth 0 drills through the whole shape; tipAngle 0 leaves a flat bottom and 118 the point of
a twist drill, in degrees. Holes that meet are cut as one.
The shape, the frames and the size of the holes
The drilled shape
const plate = await bitbybit.occt.shapes.solid.createBox({ width: 20, length: 20, height: 5, center: [0, 2.5, 0] });
const drilled = await bitbybit.occt.features.holes({
shape: plate,
frames: [
{ origin: [5, 5, 5], normal: [0, 1, 0], direction: [1, 0, 0] },
{ origin: [-5, 5, -5], normal: [0, 1, 0], direction: [1, 0, 0] },
],
diameter: 3,
depth: 0,
tipAngle: 0,
});
Drills holes as holes does, each with a wider, flat-bottomed counterbore at its mouth that
sinks a screw head below the surface.
The counterbore must be wider than the hole and, in a hole of a given depth, shallower than
it; a hole that breaks either rule is refused.
The shape, the frames, the size of the holes and the size of the counterbores
The drilled shape
Drills holes as holes does, each with a cone-shaped countersink at its mouth that sinks a
flat screw head flush with the surface.
countersinkAngle is the cone's full angle in degrees. The countersink must be wider than the
hole and end above the bottom of a hole of a given depth.
The shape, the frames, the size of the holes and the size of the countersinks
The drilled shape
Local modelling features on solids: holes drilled at frames, bosses and pockets from a profile sketched on a face, tapered and revolved ones, ribs and grooves from a wire, and faces removed or pushed and pulled. Each method returns a new shape and leaves the one it was given as it is; faces are counted from 0 as
shapes.face.getFacesand the face selectors count them. Sweeps that need no base, such asoperations.sweepEvolved, live inoperations.