Skip to main content

Features: holes, bosses, pockets and more

A feature changes a solid in one place, the way a machinist or a CAD program thinks about it: drill a hole here, raise a boss there, cut a pocket, push a face out. bitbybit.occt.features does each in one call, where booleans would need a tool shape built first.

Holes on frames​

holes, counterboredHoles and countersunkHoles drill one hole at each frame you give them. A frame's origin is where the hole enters, and its normal points out of the material, so the hole runs against it. Make the frames with the bitbybit.frame functions: grid and polar lay out a pattern on a face in one call.

  • depth 0 drills through the whole shape; tipAngle 118 gives the point of a twist drill, 0 a flat bottom.
  • A counterbore sinks a cap screw's head: wider than the hole and shallower than it.
  • A countersink sinks a flat head: a cone at the mouth, at countersinkAngle.

Here six counterbored holes go through a plate, one at each frame of a two by three grid on its top face:

Bitbybit Platform

A plate with counterbored holes in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"plate": {
"id": "plate",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 10,
"length": 6,
"height": 1,
"center": [
0,
0.5,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"top": {
"id": "top",
"name": "bitbybit.frame.zx",
"customName": "zx",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
520
]
},
"grid": {
"id": "grid",
"name": "bitbybit.frame.grid",
"customName": "grid",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"countX": 2,
"countY": 3,
"spacingX": 3,
"spacingY": 3,
"centered": true
},
"inputs": {
"frame": {
"connections": [
{
"node": "top",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
520
]
},
"holes": {
"id": "holes",
"name": "bitbybit.occt.features.counterboredHoles",
"customName": "counterbored holes",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"diameter": 0.6,
"depth": 0,
"tipAngle": 0,
"counterboreDiameter": 1.1,
"counterboreDepth": 0.4
},
"inputs": {
"shape": {
"connections": [
{
"node": "plate",
"output": "result",
"data": {}
}
]
},
"frames": {
"connections": [
{
"node": "grid",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
}
},
"modules": {}
}

Bosses and pockets from a profile​

boss grows material out of a face, and pocket cuts into it, by sweeping a profile, a face that lies on one of the solid's faces (sketchFaceIndex). How far is set by extent: a length, through everything, or up to another face. taperedBoss and taperedPocket lean the sides by an angle, as a moulded part needs; revolvedBoss and revolvedPocket turn the profile about an axis, for a collar on a shaft or a groove for a circlip.

rib and groove add or cut a thin wall that follows a wire, such as a stiffening rib under a shelf.

Changing faces directly​

  • pushPullFaces moves chosen faces along their normals and stretches the faces around them to follow: raise a top, thicken a wall, lengthen a block. A negative distance moves inward.
  • removeFaces takes faces away and closes the gap by extending the faces around them: delete a hole, a fillet or a chamfer from an imported part.

Choose the faces by rule with bitbybit.occt.select, so the feature keeps working when the part changes.

Drafts and corners​

bitbybit.occt.draft.draftAngle tilts faces so a moulded part can be pulled out of its mould. bitbybit.occt.corners rounds or bevels a single corner, chosen by a point near it rather than by edge indexes.

History​

Every feature has a ...WithHistory twin that also reports what became of each face, so a later step can find the faces a feature made: the wall of a hole, the top of a boss.

Every feature​

FunctionWhat it does
bossGrows a boss out of a base by sweeping a profile face that lies on one of its faces along direction.
bossWithHistoryGrows a boss as boss does, and reports two histories: the base's, then the profile's, whose facesFromEdges holds the side each profile edge swept and lastFaces the far end.
counterboredHolesDrills holes as holes does, each with a wider, flat-bottomed counterbore at its mouth that sinks a screw head below the surface.
counterboredHolesWithHistoryDrills holes as counterboredHoles does, and reports a history for the shape, then one per hole in the order of frames.
countersunkHolesDrills holes as holes does, each with a cone-shaped countersink at its mouth that sinks a flat screw head flush with the surface.
countersunkHolesWithHistoryDrills holes as countersunkHoles does, and reports a history for the shape, then one per hole in the order of frames.
grooveCuts 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.
holesDrills plain holes into a shape, one at each frame: its origin is where the hole enters and its normal points out of the material.
holesWithHistoryDrills holes as holes does, and reports a history for the shape, then one per hole in the order of frames.
pocketCuts a pocket into a base by sweeping a profile face that lies on one of its faces along direction, which points into the base.
pocketWithHistoryCuts a pocket as pocket does, and reports two histories: the base's, then the profile's, whose facesFromEdges holds the wall each profile edge swept and lastFaces the floor.
pushPullFacesMoves faces of a shape along their outward normals and stretches the faces around them to follow, such as raising the top of a block.
pushPullFacesWithHistoryMoves faces as pushPullFaces does, and reports one history, the shape's: each face, edge and vertex lists what it became, so a moved face is followed to where it went, curved ones too.
removeFacesRemoves 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.
removeFacesWithHistoryRemoves faces as removeFaces does, and reports one history, the shape's: a removed face's faces entry is empty, and each face that stays lists the face it became, grown over the gap.
revolvedBossAdds 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.
revolvedPocketCuts 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.
ribAdds 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.
taperedBossGrows a boss out of a base as boss does, straight out of the sketch face, with its sides leaning by angle degrees.
taperedPocketCuts a pocket into a base as pocket does, straight in from the sketch face, with its sides leaning by angle degrees.
FunctionWhat it does
draftAngleTilts the selected faces of a shape by a draft angle so the part can be pulled out of a mold along direction.
makeDraftGrows a tapered skirt from a wire, or the edges of a shape, along a direction: each edge is swept along direction, leaning outward or inward by angle degrees, until the skirt is lengthMax long.
makeDraftToShapeGrows a tapered skirt from a wire, or the edges of a shape, along a direction like makeDraft, but stops it where it meets stopShape instead of at a fixed length.
FunctionWhat it does
chamferCornerByPointBevels the corner nearest each given point on a shell or solid, touching only that corner.
classifyCornerByPointLooks up the corner nearest each given point and reports what kind it is, without changing the shape.
cornerByPointReportRuns the same corner rounding as filletCornerByPoint and returns a report instead of the shape: for each point, which corner was found, how it was classified, what was done and whether it succeeded.
filletCornerByPointRounds the corner nearest each given point on a shell or solid, touching only that corner.