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.
depth0 drills through the whole shape;tipAngle118 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:

- Rete
- Blockly
- TypeScript
{
"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,
426
]
},
"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,
40
]
},
"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": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" x="40" y="40"><value name="Entity"><block type="bitbybit.occt.features.counterboredHoles"><value name="Shape"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">10</field></block></value><value name="Length"><block type="math_number"><field name="NUM">6</field></block></value><value name="Height"><block type="math_number"><field name="NUM">1</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Frames"><block type="bitbybit.frame.grid"><value name="Frame"><block type="bitbybit.frame.zx"><value name="Origin"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="CountX"><block type="math_number"><field name="NUM">2</field></block></value><value name="CountY"><block type="math_number"><field name="NUM">3</field></block></value><value name="SpacingX"><block type="math_number"><field name="NUM">3</field></block></value><value name="SpacingY"><block type="math_number"><field name="NUM">3</field></block></value><value name="Centered"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Diameter"><block type="math_number"><field name="NUM">0.6</field></block></value><value name="Depth"><block type="math_number"><field name="NUM">0</field></block></value><value name="TipAngle"><block type="math_number"><field name="NUM">0</field></block></value><value name="CounterboreDiameter"><block type="math_number"><field name="NUM">1.1</field></block></value><value name="CounterboreDepth"><block type="math_number"><field name="NUM">0.4</field></block></value></block></value></block></xml>
const plate = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 6, height: 1, center: [0, 0.5, 0] });
const top = bitbybit.frame.zx({ origin: [0, 1, 0] });
const grid = bitbybit.frame.grid({ frame: top, countX: 2, countY: 3, spacingX: 3, spacingY: 3, centered: true });
const drilled = await bitbybit.occt.features.counterboredHoles({
shape: plate,
frames: grid,
diameter: 0.6,
depth: 0,
counterboreDiameter: 1.1,
counterboreDepth: 0.4,
});
await bitbybit.draw.drawAnyAsync({ entity: drilled });
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.
Here both tapered features start from a face drawn on the top of a block. sketchFaceIndex says which face of the base the profile lies on, and it is found by rule, not counted. The boss changes the block, so the top is found again before the pocket:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"block": {
"id": "block",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 30,
"length": 20,
"height": 6,
"center": [
0,
3,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"up": {
"id": "up",
"name": "bitbybit.occt.select.faces.facing",
"customName": "faces facing",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"angle": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"top": {
"id": "top",
"name": "bitbybit.lists.getFirstItem",
"customName": "get first item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "up",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"round": {
"id": "round",
"name": "bitbybit.occt.shapes.face.createCircleFace",
"customName": "circle face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 5,
"center": [
-7,
6,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
426
]
},
"boss": {
"id": "boss",
"name": "bitbybit.occt.features.taperedBoss",
"customName": "tapered boss",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"sketchFaceIndex": 0,
"angle": 12,
"extent": "length",
"length": 8,
"untilFaceIndex": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"profile": {
"connections": [
{
"node": "round",
"output": "result",
"data": {}
}
]
},
"sketchFaceIndex": {
"connections": [
{
"node": "top",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"flat": {
"id": "flat",
"name": "bitbybit.occt.select.faces.onPlane",
"customName": "faces on plane",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
6,
0
],
"normal": [
0,
1,
0
],
"tolerance": 1e-7
},
"inputs": {
"shape": {
"connections": [
{
"node": "boss",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"stillTop": {
"id": "stillTop",
"name": "bitbybit.lists.getFirstItem",
"customName": "get first item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "flat",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"square": {
"id": "square",
"name": "bitbybit.occt.shapes.face.createSquareFace",
"customName": "square face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"size": 8,
"center": [
8,
6,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
720
]
},
"pocket": {
"id": "pocket",
"name": "bitbybit.occt.features.taperedPocket",
"customName": "tapered pocket",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"sketchFaceIndex": 0,
"angle": 12,
"extent": "length",
"length": 4,
"untilFaceIndex": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "boss",
"output": "result",
"data": {}
}
]
},
"profile": {
"connections": [
{
"node": "square",
"output": "result",
"data": {}
}
]
},
"sketchFaceIndex": {
"connections": [
{
"node": "stillTop",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
-20,
45,
-50
],
"lookAt": [
0,
5,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2980,
40
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="block">block</variable><variable id="boss">boss</variable></variables><block type="variables_set" x="40" y="40"><field name="VAR" id="block">block</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">30</field></block></value><value name="Length"><block type="math_number"><field name="NUM">20</field></block></value><value name="Height"><block type="math_number"><field name="NUM">6</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">3</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="boss">boss</field><value name="VALUE"><block type="bitbybit.occt.features.taperedBoss"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Profile"><block type="bitbybit.occt.shapes.face.createCircleFace"><value name="Radius"><block type="math_number"><field name="NUM">5</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">-7</field></block></value><value name="Y"><block type="math_number"><field name="NUM">6</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="SketchFaceIndex"><block type="bitbybit.lists.getFirstItem"><value name="List"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.faces.facing"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">12</field></block></value><value name="Extent"><block type="bitbybit.occt.enums.featureExtentEnum"><field name="bitbybit.occt.enums.featureExtentEnum">'length'</field></block></value><value name="Length"><block type="math_number"><field name="NUM">8</field></block></value><value name="UntilFaceIndex"><block type="math_number"><field name="NUM">0</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.features.taperedPocket"><value name="Shape"><block type="variables_get"><field name="VAR" id="boss">boss</field></block></value><value name="Profile"><block type="bitbybit.occt.shapes.face.createSquareFace"><value name="Size"><block type="math_number"><field name="NUM">8</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">8</field></block></value><value name="Y"><block type="math_number"><field name="NUM">6</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="SketchFaceIndex"><block type="bitbybit.lists.getFirstItem"><value name="List"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.faces.onPlane"><value name="Shape"><block type="variables_get"><field name="VAR" id="boss">boss</field></block></value><value name="Origin"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">6</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Normal"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Tolerance"><block type="math_number"><field name="NUM">1e-7</field></block></value></block></value></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">12</field></block></value><value name="Extent"><block type="bitbybit.occt.enums.featureExtentEnum"><field name="bitbybit.occt.enums.featureExtentEnum">'length'</field></block></value><value name="Length"><block type="math_number"><field name="NUM">4</field></block></value><value name="UntilFaceIndex"><block type="math_number"><field name="NUM">0</field></block></value></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">-20</field></block></value><value name="Y"><block type="math_number"><field name="NUM">45</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-50</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">5</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></next></block></next></block></xml>
const block = await bitbybit.occt.shapes.solid.createBox({ width: 30, length: 20, height: 6, center: [0, 3, 0] });
const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0] });
const round = await bitbybit.occt.shapes.face.createCircleFace({ radius: 5, center: [-7, 6, 0], direction: [0, 1, 0] });
const boss = await bitbybit.occt.features.taperedBoss({ shape: block, profile: round, sketchFaceIndex: top, angle: 12, length: 8 });
const [stillTop] = await bitbybit.occt.select.faces.onPlane({ shape: boss, origin: [0, 6, 0], normal: [0, 1, 0] });
const square = await bitbybit.occt.shapes.face.createSquareFace({ size: 8, center: [8, 6, 0], direction: [0, 1, 0] });
const pocket = await bitbybit.occt.features.taperedPocket({ shape: boss, profile: square, sketchFaceIndex: stillTop, angle: 12, length: 4 });
await bitbybit.draw.drawAnyAsync({ entity: pocket });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [-20, 45, -50], lookAt: [0, 5, 0] });
rib and groove add or cut a thin wall that follows a wire, such as a stiffening rib under a shelf.
Here a rib fills the inside corner of a bracket. The feature lies on the left of its wire, seen from the side the frame's normal points to, so the slanted line runs from the shelf up to the wall to have the corner on its left. thickness and otherSideThickness lie on either side of the frame's plane:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"shelf": {
"id": "shelf",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 30,
"id": ""
},
"inputs": {},
"position": [
40,
40
]
},
"lip": {
"id": "lip",
"name": "bitbybit.occt.sketch.commands.vLine",
"customName": "v line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 3,
"id": ""
},
"inputs": {},
"position": [
40,
288
]
},
"under": {
"id": "under",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": -27,
"id": ""
},
"inputs": {},
"position": [
40,
536
]
},
"inside": {
"id": "inside",
"name": "bitbybit.occt.sketch.commands.vLine",
"customName": "v line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 27,
"id": ""
},
"inputs": {},
"position": [
40,
784
]
},
"cap": {
"id": "cap",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": -3,
"id": ""
},
"inputs": {},
"position": [
40,
1032
]
},
"back": {
"id": "back",
"name": "bitbybit.occt.sketch.commands.close",
"customName": "close",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"id": ""
},
"inputs": {},
"position": [
40,
1280
]
},
"commands": {
"id": "commands",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "shelf",
"output": "result",
"data": {}
},
{
"node": "lip",
"output": "result",
"data": {}
},
{
"node": "under",
"output": "result",
"data": {}
},
{
"node": "inside",
"output": "result",
"data": {}
},
{
"node": "cap",
"output": "result",
"data": {}
},
{
"node": "back",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"upright": {
"id": "upright",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {},
"position": [
40,
1520
]
},
"outline": {
"id": "outline",
"name": "bitbybit.occt.sketch.pen",
"customName": "pen",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0
],
"makeFace": true
},
"inputs": {
"commands": {
"connections": [
{
"node": "commands",
"output": "list",
"data": {}
}
]
},
"frame": {
"connections": [
{
"node": "upright",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"bracket": {
"id": "bracket",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
0,
20
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "outline",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"slant": {
"id": "slant",
"name": "bitbybit.occt.shapes.edge.line",
"customName": "line",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
24,
3,
10
],
"end": [
3,
22,
10
]
},
"inputs": {},
"position": [
40,
1814
]
},
"midPlane": {
"id": "midPlane",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
10
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {},
"position": [
40,
2062
]
},
"ribbed": {
"id": "ribbed",
"name": "bitbybit.occt.features.rib",
"customName": "rib",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"thickness": 1.5,
"otherSideThickness": 1.5
},
"inputs": {
"shape": {
"connections": [
{
"node": "bracket",
"output": "result",
"data": {}
}
]
},
"wire": {
"connections": [
{
"node": "slant",
"output": "result",
"data": {}
}
]
},
"frame": {
"connections": [
{
"node": "midPlane",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
49,
41,
71
],
"lookAt": [
15,
14,
10
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2140,
40
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" x="40" y="40"><value name="Entity"><block type="bitbybit.occt.features.rib"><value name="Shape"><block type="bitbybit.occt.operations.extrude"><value name="Shape"><block type="bitbybit.occt.sketch.pen"><value name="Commands"><block type="lists_create_with"><mutation items="6"></mutation><value name="ADD0"><block type="bitbybit.occt.sketch.commands.hLine"><value name="Length"><block type="math_number"><field name="NUM">30</field></block></value><value name="Id"><block type="text"><field name="TEXT"></field></block></value></block></value><value name="ADD1"><block type="bitbybit.occt.sketch.commands.vLine"><value name="Length"><block type="math_number"><field name="NUM">3</field></block></value><value name="Id"><block type="text"><field name="TEXT"></field></block></value></block></value><value name="ADD2"><block type="bitbybit.occt.sketch.commands.hLine"><value name="Length"><block type="math_number"><field name="NUM">-27</field></block></value><value name="Id"><block type="text"><field name="TEXT"></field></block></value></block></value><value name="ADD3"><block type="bitbybit.occt.sketch.commands.vLine"><value name="Length"><block type="math_number"><field name="NUM">27</field></block></value><value name="Id"><block type="text"><field name="TEXT"></field></block></value></block></value><value name="ADD4"><block type="bitbybit.occt.sketch.commands.hLine"><value name="Length"><block type="math_number"><field name="NUM">-3</field></block></value><value name="Id"><block type="text"><field name="TEXT"></field></block></value></block></value><value name="ADD5"><block type="bitbybit.occt.sketch.commands.close"><value name="Id"><block type="text"><field name="TEXT"></field></block></value></block></value></block></value><value name="Start"><block type="bitbybit.point.pointXY"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Frame"><block type="bitbybit.frame.create"><value name="Origin"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Normal"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">1</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="MakeFace"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">20</field></block></value></block></value></block></value><value name="Wire"><block type="bitbybit.occt.shapes.edge.line"><value name="Start"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">24</field></block></value><value name="Y"><block type="math_number"><field name="NUM">3</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</field></block></value></block></value><value name="End"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">3</field></block></value><value name="Y"><block type="math_number"><field name="NUM">22</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</field></block></value></block></value></block></value><value name="Frame"><block type="bitbybit.frame.create"><value name="Origin"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</field></block></value></block></value><value name="Normal"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">1</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="Thickness"><block type="math_number"><field name="NUM">1.5</field></block></value><value name="OtherSideThickness"><block type="math_number"><field name="NUM">1.5</field></block></value></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">49</field></block></value><value name="Y"><block type="math_number"><field name="NUM">41</field></block></value><value name="Z"><block type="math_number"><field name="NUM">71</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">15</field></block></value><value name="Y"><block type="math_number"><field name="NUM">14</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></xml>
const outline = await bitbybit.occt.sketch.pen({
commands: [
{ type: "hLine", length: 30 },
{ type: "vLine", length: 3 },
{ type: "hLine", length: -27 },
{ type: "vLine", length: 27 },
{ type: "hLine", length: -3 },
{ type: "close" },
],
frame: { origin: [0, 0, 0], normal: [0, 0, 1], direction: [1, 0, 0] },
makeFace: true,
});
const bracket = await bitbybit.occt.operations.extrude({ shape: outline, direction: [0, 0, 20] });
const slant = await bitbybit.occt.shapes.edge.line({ start: [24, 3, 10], end: [3, 22, 10] });
const ribbed = await bitbybit.occt.features.rib({
shape: bracket,
wire: slant,
frame: { origin: [0, 0, 10], normal: [0, 0, 1], direction: [1, 0, 0] },
thickness: 1.5,
otherSideThickness: 1.5,
});
await bitbybit.draw.drawAnyAsync({ entity: ribbed });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [49, 41, 71], lookAt: [15, 14, 10] });
Changing faces directly
pushPullFacesmoves 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.removeFacestakes 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.
Here one drilled block is changed twice. In the middle one the wall of the hole is removed and the block closes up, and in the last one the top face is pushed up by 2, with the hole growing to follow:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"block": {
"id": "block",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 12,
"length": 8,
"height": 4,
"center": [
0,
2,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"drill": {
"id": "drill",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 1.5,
"height": 6,
"center": [
3,
-1,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
426
]
},
"tools": {
"id": "tools",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "drill",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"part": {
"id": "part",
"name": "bitbybit.occt.booleans.difference",
"customName": "difference",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"keepEdges": false,
"strategy": "oneAfterAnother"
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"shapes": {
"connections": [
{
"node": "tools",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"holeWall": {
"id": "holeWall",
"name": "bitbybit.occt.select.faces.ofType",
"customName": "faces of type",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"type": "cylinder"
},
"inputs": {
"shape": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"closed": {
"id": "closed",
"name": "bitbybit.occt.features.removeFaces",
"customName": "remove faces",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "holeWall",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"closedBeside": {
"id": "closedBeside",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
10
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "closed",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"top": {
"id": "top",
"name": "bitbybit.occt.select.faces.extreme",
"customName": "extreme faces",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"tolerance": 1e-7
},
"inputs": {
"shape": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
334
]
},
"raised": {
"id": "raised",
"name": "bitbybit.occt.features.pushPullFaces",
"customName": "push pull faces",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"distance": 2
},
"inputs": {
"shape": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "top",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
288
]
},
"raisedBeside": {
"id": "raisedBeside",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
20
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "raised",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
288
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
280
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
858
]
},
"drawPart": {
"id": "drawPart",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"drawClosedBeside": {
"id": "drawClosedBeside",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "closedBeside",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
334
]
},
"drawRaisedBeside": {
"id": "drawRaisedBeside",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "raisedBeside",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
628
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
36,
26,
-10
],
"lookAt": [
0,
2,
10
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2560,
922
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="part">part</variable><variable id="steel">steel</variable></variables><block type="variables_set" x="40" y="200"><field name="VAR" id="part">part</field><value name="VALUE"><block type="bitbybit.occt.booleans.difference"><value name="Shape"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">12</field></block></value><value name="Length"><block type="math_number"><field name="NUM">8</field></block></value><value name="Height"><block type="math_number"><field name="NUM">4</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Shapes"><block type="lists_create_with"><mutation items="1"></mutation><value name="ADD0"><block type="bitbybit.occt.shapes.solid.createCylinder"><value name="Radius"><block type="math_number"><field name="NUM">1.5</field></block></value><value name="Height"><block type="math_number"><field name="NUM">6</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">3</field></block></value><value name="Y"><block type="math_number"><field name="NUM">-1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">360</field></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value></block></value><value name="KeepEdges"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Strategy"><block type="bitbybit.occt.enums.booleanStrategyEnum"><field name="bitbybit.occt.enums.booleanStrategyEnum">'oneAfterAnother'</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="steel">steel</field><value name="VALUE"><block type="bitbybit.draw.optionsOcctShape"><value name="FaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeColour"><block type="colour_picker"><field name="COLOUR">#5f6773</field></block></value><value name="FaceColour"><block type="colour_picker"><field name="COLOUR">#ff0000</field></block></value><value name="VertexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="FaceMaterial"><block type="bitbybit.draw.createPBRMaterial"><value name="Name"><block type="text"><field name="TEXT">PBRMaterial</field></block></value><value name="BaseColor"><block type="colour_picker"><field name="COLOUR">#eef0f2</field></block></value><value name="Metallic"><block type="math_number"><field name="NUM">0.7</field></block></value><value name="Roughness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Alpha"><block type="math_number"><field name="NUM">1</field></block></value><value name="EmissiveColor"><block type="colour_picker"><field name="COLOUR">#000000</field></block></value><value name="EmissiveIntensity"><block type="math_number"><field name="NUM">1</field></block></value><value name="ZOffset"><block type="math_number"><field name="NUM">0</field></block></value><value name="ZOffsetUnits"><block type="math_number"><field name="NUM">0</field></block></value><value name="AlphaMode"><block type="bitbybit.draw.enums.alphaModeEnum"><field name="bitbybit.draw.enums.alphaModeEnum">'opaque'</field></block></value><value name="AlphaCutoff"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="DoubleSided"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Wireframe"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Unlit"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><value name="EdgeWidth"><block type="math_number"><field name="NUM">2</field></block></value><value name="EdgeWidthBySize"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="VertexSize"><block type="math_number"><field name="NUM">0.03</field></block></value><value name="DrawEdges"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawFaces"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawVertices"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Precision"><block type="math_number"><field name="NUM">0.01</field></block></value><value name="AngularDeflection"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="RelativeDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="PrecisionShare"><block type="math_number"><field name="NUM">0</field></block></value><value name="DrawEdgeIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="EdgeIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="EdgeIndexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="DrawFaceIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="FaceIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="FaceIndexColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="DrawTwoSided"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="BackFaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeArrowSize"><block type="math_number"><field name="NUM">0</field></block></value><value name="EdgeArrowAngle"><block type="math_number"><field name="NUM">15</field></block></value><value name="KeepMeshData"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="AllowQualityDecrease"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="ForceFaceDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="DrawIsoCurves"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="IsoCurvesU"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesV"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesColour"><block type="colour_picker"><field name="COLOUR">#808080</field></block></value><value name="SurfaceAnalysis"><block type="bitbybit.occt.enums.surfaceAnalysisEnum"><field name="bitbybit.occt.enums.surfaceAnalysisEnum">'none'</field></block></value><value name="DraftDirection"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="part">part</field></block></value><value name="Options"><block type="variables_get"><field name="VAR" id="steel">steel</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.transforms.translate"><value name="Shape"><block type="bitbybit.occt.features.removeFaces"><value name="Shape"><block type="variables_get"><field name="VAR" id="part">part</field></block></value><value name="Indexes"><block type="bitbybit.occt.select.faces.ofType"><value name="Shape"><block type="variables_get"><field name="VAR" id="part">part</field></block></value><value name="Type"><block type="bitbybit.occt.enums.surfaceTypeEnum"><field name="bitbybit.occt.enums.surfaceTypeEnum">'cylinder'</field></block></value></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</field></block></value></block></value></block></value><value name="Options"><block type="variables_get"><field name="VAR" id="steel">steel</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.transforms.translate"><value name="Shape"><block type="bitbybit.occt.features.pushPullFaces"><value name="Shape"><block type="variables_get"><field name="VAR" id="part">part</field></block></value><value name="Indexes"><block type="bitbybit.occt.select.faces.extreme"><value name="Shape"><block type="variables_get"><field name="VAR" id="part">part</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Tolerance"><block type="math_number"><field name="NUM">1e-7</field></block></value></block></value><value name="Distance"><block type="math_number"><field name="NUM">2</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">20</field></block></value></block></value></block></value><value name="Options"><block type="variables_get"><field name="VAR" id="steel">steel</field></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">36</field></block></value><value name="Y"><block type="math_number"><field name="NUM">26</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-10</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></next></block></next></block></next></block></next></block></xml>
const block = await bitbybit.occt.shapes.solid.createBox({ width: 12, length: 8, height: 4, center: [0, 2, 0] });
const drill = await bitbybit.occt.shapes.solid.createCylinder({ radius: 1.5, height: 6, center: [3, -1, 0], direction: [0, 1, 0] });
const part = await bitbybit.occt.booleans.difference({ shape: block, shapes: [drill], keepEdges: false });
const holeWall = await bitbybit.occt.select.faces.ofType({ shape: part, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder });
const closed = await bitbybit.occt.features.removeFaces({ shape: part, indexes: holeWall });
const closedBeside = await bitbybit.occt.transforms.translate({ shape: closed, translation: [0, 0, 10] });
const top = await bitbybit.occt.select.faces.extreme({ shape: part, direction: [0, 1, 0] });
const raised = await bitbybit.occt.features.pushPullFaces({ shape: part, indexes: top, distance: 2 });
const raisedBeside = await bitbybit.occt.transforms.translate({ shape: raised, translation: [0, 0, 20] });
const steel = new Bit.Inputs.Draw.DrawOcctShapeOptions();
steel.faceMaterial = bitbybit.draw.createPBRMaterial({ baseColor: "#eef0f2", metallic: 0.7, roughness: 0.3 });
steel.edgeColour = "#5f6773";
steel.drawTwoSided = false;
await bitbybit.draw.drawAnyAsync({ entity: part, options: steel });
await bitbybit.draw.drawAnyAsync({ entity: closedBeside, options: steel });
await bitbybit.draw.drawAnyAsync({ entity: raisedBeside, options: steel });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [36, 26, -10], lookAt: [0, 2, 10] });
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.
Draw a shape with surfaceAnalysis set to draftAngle and the viewer shows how each face stands against the pull. A face looking along draftDirection is red, one standing straight is green at 0, and one looking away is blue. On this block the two end walls have 6 degrees of draft and the long walls have none, so the long walls would drag. The ball beside it shows every angle at once, with its parting line as the green band around the middle:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"block": {
"id": "block",
"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": 4,
"center": [
0,
2,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"facingRight": {
"id": "facingRight",
"name": "bitbybit.occt.select.faces.facing",
"customName": "faces facing",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
1,
0,
0
],
"angle": 1
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"facingLeft": {
"id": "facingLeft",
"name": "bitbybit.occt.select.faces.facing",
"customName": "faces facing",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
-1,
0,
0
],
"angle": 1
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
380
]
},
"rightIndex": {
"id": "rightIndex",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "facingRight",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"leftIndex": {
"id": "leftIndex",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "facingLeft",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
334
]
},
"rightWall": {
"id": "rightWall",
"name": "bitbybit.occt.shapes.face.getFace",
"customName": "get face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "rightIndex",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"leftWall": {
"id": "leftWall",
"name": "bitbybit.occt.shapes.face.getFace",
"customName": "get face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "leftIndex",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
288
]
},
"walls": {
"id": "walls",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "rightWall",
"output": "result",
"data": {}
},
{
"node": "leftWall",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"drafted": {
"id": "drafted",
"name": "bitbybit.occt.draft.draftAngle",
"customName": "draft angle",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"angle": 6,
"neutralPlaneOrigin": [
0,
0,
0
],
"neutralPlaneDirection": [
0,
1,
0
],
"flag": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"faces": {
"connections": [
{
"node": "walls",
"output": "list",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"ball": {
"id": "ball",
"name": "bitbybit.occt.shapes.solid.createSphere",
"customName": "sphere",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 3,
"center": [
10,
3,
0
]
},
"inputs": {},
"position": [
40,
426
]
},
"draft": {
"id": "draft",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#ffffff",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": true,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "draftAngle",
"draftDirection": [
0,
1,
0
],
"analysisMin": -8,
"analysisMax": 8
},
"inputs": {},
"position": [
40,
674
]
},
"drawDrafted": {
"id": "drawDrafted",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "drafted",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "draft",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"drawBall": {
"id": "drawBall",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "ball",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "draft",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
340
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
10,
16,
-32
],
"lookAt": [
4,
2.5,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2560,
640
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="block">block</variable><variable id="facingRight">facingRight</variable><variable id="facingLeft">facingLeft</variable><variable id="draft">draft</variable></variables><block type="variables_set" x="40" y="200"><field name="VAR" id="block">block</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">10</field></block></value><value name="Length"><block type="math_number"><field name="NUM">6</field></block></value><value name="Height"><block type="math_number"><field name="NUM">4</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="facingRight">facingRight</field><value name="VALUE"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.faces.facing"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">1</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">1</field></block></value></block></value></block></value><next><block type="variables_set"><field name="VAR" id="facingLeft">facingLeft</field><value name="VALUE"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.faces.facing"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">-1</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">1</field></block></value></block></value></block></value><next><block type="variables_set"><field name="VAR" id="draft">draft</field><value name="VALUE"><block type="bitbybit.draw.optionsOcctShape"><value name="FaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeColour"><block type="colour_picker"><field name="COLOUR">#ffffff</field></block></value><value name="FaceColour"><block type="colour_picker"><field name="COLOUR">#ff0000</field></block></value><value name="VertexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="EdgeWidth"><block type="math_number"><field name="NUM">2</field></block></value><value name="EdgeWidthBySize"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="VertexSize"><block type="math_number"><field name="NUM">0.03</field></block></value><value name="DrawEdges"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawFaces"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawVertices"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Precision"><block type="math_number"><field name="NUM">0.01</field></block></value><value name="AngularDeflection"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="RelativeDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="PrecisionShare"><block type="math_number"><field name="NUM">0</field></block></value><value name="DrawEdgeIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="EdgeIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="EdgeIndexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="DrawFaceIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="FaceIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="FaceIndexColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="DrawTwoSided"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="BackFaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeArrowSize"><block type="math_number"><field name="NUM">0</field></block></value><value name="EdgeArrowAngle"><block type="math_number"><field name="NUM">15</field></block></value><value name="KeepMeshData"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="AllowQualityDecrease"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="ForceFaceDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="DrawIsoCurves"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="IsoCurvesU"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesV"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesColour"><block type="colour_picker"><field name="COLOUR">#808080</field></block></value><value name="SurfaceAnalysis"><block type="bitbybit.occt.enums.surfaceAnalysisEnum"><field name="bitbybit.occt.enums.surfaceAnalysisEnum">'draftAngle'</field></block></value><value name="DraftDirection"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="AnalysisMin"><block type="math_number"><field name="NUM">-8</field></block></value><value name="AnalysisMax"><block type="math_number"><field name="NUM">8</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.draft.draftAngle"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Faces"><block type="lists_create_with"><mutation items="2"></mutation><value name="ADD0"><block type="bitbybit.occt.shapes.face.getFace"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Index"><block type="bitbybit.lists.getItem"><value name="List"><block type="variables_get"><field name="VAR" id="facingRight">facingRight</field></block></value><value name="Index"><block type="math_number"><field name="NUM">0</field></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value><value name="ADD1"><block type="bitbybit.occt.shapes.face.getFace"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Index"><block type="bitbybit.lists.getItem"><value name="List"><block type="variables_get"><field name="VAR" id="facingLeft">facingLeft</field></block></value><value name="Index"><block type="math_number"><field name="NUM">0</field></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">6</field></block></value><value name="NeutralPlaneOrigin"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="NeutralPlaneDirection"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Flag"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Options"><block type="variables_get"><field name="VAR" id="draft">draft</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.shapes.solid.createSphere"><value name="Radius"><block type="math_number"><field name="NUM">3</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">10</field></block></value><value name="Y"><block type="math_number"><field name="NUM">3</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="Options"><block type="variables_get"><field name="VAR" id="draft">draft</field></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">10</field></block></value><value name="Y"><block type="math_number"><field name="NUM">16</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-32</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">4</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2.5</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
const block = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 6, height: 4, center: [0, 2, 0] });
const [right] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [1, 0, 0], angle: 1 });
const [left] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [-1, 0, 0], angle: 1 });
const walls = [
await bitbybit.occt.shapes.face.getFace({ shape: block, index: right }),
await bitbybit.occt.shapes.face.getFace({ shape: block, index: left }),
];
const drafted = await bitbybit.occt.draft.draftAngle({
shape: block, faces: walls, direction: [0, 1, 0], angle: 6,
neutralPlaneOrigin: [0, 0, 0], neutralPlaneDirection: [0, 1, 0],
});
const ball = await bitbybit.occt.shapes.solid.createSphere({ radius: 3, center: [10, 3, 0] });
const draft = new Bit.Inputs.Draw.DrawOcctShapeOptions();
draft.surfaceAnalysis = Bit.Inputs.OCCT.surfaceAnalysisEnum.draftAngle;
draft.draftDirection = [0, 1, 0];
draft.analysisMin = -8;
draft.analysisMax = 8;
await bitbybit.draw.drawAnyAsync({ entity: drafted, options: draft });
await bitbybit.draw.drawAnyAsync({ entity: ball, options: draft });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [10, 16, -32], lookAt: [4, 2.5, 0] });
draft.makeDraft starts from a wire instead of a solid and grows a tapered skirt from it, leaning each side by angle:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"outline": {
"id": "outline",
"name": "bitbybit.occt.shapes.wire.createRectangleWire",
"customName": "rectangle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 8,
"length": 5,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"skirt": {
"id": "skirt",
"name": "bitbybit.occt.draft.makeDraft",
"customName": "make draft",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"angle": 10,
"lengthMax": 3,
"internal": false
},
"inputs": {
"shape": {
"connections": [
{
"node": "outline",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"paper": {
"id": "paper",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ffffff",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": true,
"backFaceColour": "#ffffff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
380
]
},
"drawSkirt": {
"id": "drawSkirt",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "skirt",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "paper",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
8,
12,
-14
],
"lookAt": [
0,
1.5,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
880,
334
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" x="40" y="200"><value name="Entity"><block type="bitbybit.occt.draft.makeDraft"><value name="Shape"><block type="bitbybit.occt.shapes.wire.createRectangleWire"><value name="Width"><block type="math_number"><field name="NUM">8</field></block></value><value name="Length"><block type="math_number"><field name="NUM">5</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">10</field></block></value><value name="LengthMax"><block type="math_number"><field name="NUM">3</field></block></value><value name="Internal"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><value name="Options"><block type="bitbybit.draw.optionsOcctShape"><value name="FaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeColour"><block type="colour_picker"><field name="COLOUR">#5f6773</field></block></value><value name="FaceColour"><block type="colour_picker"><field name="COLOUR">#ffffff</field></block></value><value name="VertexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="EdgeWidth"><block type="math_number"><field name="NUM">2</field></block></value><value name="EdgeWidthBySize"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="VertexSize"><block type="math_number"><field name="NUM">0.03</field></block></value><value name="DrawEdges"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawFaces"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawVertices"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Precision"><block type="math_number"><field name="NUM">0.01</field></block></value><value name="AngularDeflection"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="RelativeDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="PrecisionShare"><block type="math_number"><field name="NUM">0</field></block></value><value name="DrawEdgeIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="EdgeIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="EdgeIndexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="DrawFaceIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="FaceIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="FaceIndexColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="DrawTwoSided"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#ffffff</field></block></value><value name="BackFaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeArrowSize"><block type="math_number"><field name="NUM">0</field></block></value><value name="EdgeArrowAngle"><block type="math_number"><field name="NUM">15</field></block></value><value name="KeepMeshData"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="AllowQualityDecrease"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="ForceFaceDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="DrawIsoCurves"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="IsoCurvesU"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesV"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesColour"><block type="colour_picker"><field name="COLOUR">#808080</field></block></value><value name="SurfaceAnalysis"><block type="bitbybit.occt.enums.surfaceAnalysisEnum"><field name="bitbybit.occt.enums.surfaceAnalysisEnum">'none'</field></block></value><value name="DraftDirection"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">8</field></block></value><value name="Y"><block type="math_number"><field name="NUM">12</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-14</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1.5</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></xml>
const outline = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 8, length: 5, center: [0, 0, 0], direction: [0, 1, 0] });
const skirt = await bitbybit.occt.draft.makeDraft({ shape: outline, direction: [0, 1, 0], angle: 10, lengthMax: 3, internal: false });
const paper = new Bit.Inputs.Draw.DrawOcctShapeOptions();
paper.faceColour = "#ffffff";
paper.edgeColour = "#5f6773";
paper.drawTwoSided = true;
paper.backFaceColour = "#ffffff";
await bitbybit.draw.drawAnyAsync({ entity: skirt, options: paper });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [8, 12, -14], lookAt: [0, 1.5, 0] });
corners.filletCornerByPoint rounds the corner nearest each point you give it, and chamferCornerByPoint bevels it. The rounding is widest at the corner and tapers away along the edges that meet there, so you pick a corner by where it is, with no edge indexes, and every other corner stays sharp:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"block": {
"id": "block",
"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": 10,
"height": 10,
"center": [
0,
5,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"corners": {
"id": "corners",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[[5, 10, -5]]"
},
"inputs": {},
"position": [
40,
426
]
},
"rounded": {
"id": "rounded",
"name": "bitbybit.occt.corners.filletCornerByPoint",
"customName": "fillet corner by point",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"points": [],
"radius": 2,
"taperFactor": 1,
"snapTolerance": 0,
"mode": "auto"
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"points": {
"connections": [
{
"node": "corners",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
472
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
666
]
},
"drawRounded": {
"id": "drawRounded",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "rounded",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
16,
19,
-22
],
"lookAt": [
0,
5,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
880,
334
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" x="40" y="200"><value name="Entity"><block type="bitbybit.occt.corners.filletCornerByPoint"><value name="Shape"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">10</field></block></value><value name="Length"><block type="math_number"><field name="NUM">10</field></block></value><value name="Height"><block type="math_number"><field name="NUM">10</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">5</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Points"><block type="bitbybit.json.parse"><value name="Text"><block type="text"><field name="TEXT">[[5, 10, -5]]</field></block></value></block></value><value name="Radius"><block type="math_number"><field name="NUM">2</field></block></value><value name="TaperFactor"><block type="math_number"><field name="NUM">1</field></block></value><value name="SnapTolerance"><block type="math_number"><field name="NUM">0</field></block></value><value name="Mode"><block type="bitbybit.occt.enums.cornerModeEnum"><field name="bitbybit.occt.enums.cornerModeEnum">'auto'</field></block></value></block></value><value name="Options"><block type="bitbybit.draw.optionsOcctShape"><value name="FaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeColour"><block type="colour_picker"><field name="COLOUR">#5f6773</field></block></value><value name="FaceColour"><block type="colour_picker"><field name="COLOUR">#ff0000</field></block></value><value name="VertexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="FaceMaterial"><block type="bitbybit.draw.createPBRMaterial"><value name="Name"><block type="text"><field name="TEXT">PBRMaterial</field></block></value><value name="BaseColor"><block type="colour_picker"><field name="COLOUR">#eef0f2</field></block></value><value name="Metallic"><block type="math_number"><field name="NUM">0.7</field></block></value><value name="Roughness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Alpha"><block type="math_number"><field name="NUM">1</field></block></value><value name="EmissiveColor"><block type="colour_picker"><field name="COLOUR">#000000</field></block></value><value name="EmissiveIntensity"><block type="math_number"><field name="NUM">1</field></block></value><value name="ZOffset"><block type="math_number"><field name="NUM">0</field></block></value><value name="ZOffsetUnits"><block type="math_number"><field name="NUM">0</field></block></value><value name="AlphaMode"><block type="bitbybit.draw.enums.alphaModeEnum"><field name="bitbybit.draw.enums.alphaModeEnum">'opaque'</field></block></value><value name="AlphaCutoff"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="DoubleSided"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Wireframe"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Unlit"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><value name="EdgeWidth"><block type="math_number"><field name="NUM">2</field></block></value><value name="EdgeWidthBySize"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="VertexSize"><block type="math_number"><field name="NUM">0.03</field></block></value><value name="DrawEdges"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawFaces"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawVertices"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Precision"><block type="math_number"><field name="NUM">0.01</field></block></value><value name="AngularDeflection"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="RelativeDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="PrecisionShare"><block type="math_number"><field name="NUM">0</field></block></value><value name="DrawEdgeIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="EdgeIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="EdgeIndexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="DrawFaceIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="FaceIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="FaceIndexColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="DrawTwoSided"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="BackFaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeArrowSize"><block type="math_number"><field name="NUM">0</field></block></value><value name="EdgeArrowAngle"><block type="math_number"><field name="NUM">15</field></block></value><value name="KeepMeshData"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="AllowQualityDecrease"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="ForceFaceDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="DrawIsoCurves"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="IsoCurvesU"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesV"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesColour"><block type="colour_picker"><field name="COLOUR">#808080</field></block></value><value name="SurfaceAnalysis"><block type="bitbybit.occt.enums.surfaceAnalysisEnum"><field name="bitbybit.occt.enums.surfaceAnalysisEnum">'none'</field></block></value><value name="DraftDirection"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">16</field></block></value><value name="Y"><block type="math_number"><field name="NUM">19</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-22</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">5</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></xml>
const block = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 5, 0] });
const corners = bitbybit.json.parse({ text: "[[5, 10, -5]]" });
const rounded = await bitbybit.occt.corners.filletCornerByPoint({ shape: block, points: corners, radius: 2 });
const steel = new Bit.Inputs.Draw.DrawOcctShapeOptions();
steel.faceMaterial = bitbybit.draw.createPBRMaterial({ baseColor: "#eef0f2", metallic: 0.7, roughness: 0.3 });
steel.edgeColour = "#5f6773";
steel.drawTwoSided = false;
await bitbybit.draw.drawAnyAsync({ entity: rounded, options: steel });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [16, 19, -22], lookAt: [0, 5, 0] });
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. Picking faces and edges explains what a history holds.
- The features built from a profile or a wire report two histories, the base's and then the profile's: in the profile's,
facesFromEdgesholds the face each of its edges made. ForribWithHistorythat is the rib's walls, withfirstFacesandlastFacesits two flat sides, andgrooveWithHistorythe same for a groove.taperedBossWithHistoryandtaperedPocketWithHistorygive the leaning walls and, inlastFaces, the top of the boss or the floor of the pocket;revolvedBossWithHistoryandrevolvedPocketWithHistorygive the faces each profile edge turned into, such as a ring's outer wall and its two sides. draftAngleWithHistoryreports a drafted face as its tilted successor infaces.makeDraftWithHistoryandmakeDraftToShapeWithHistorygrow a skirt from a wire or a shape, freely or up to a stop shape, and report infacesFromEdgesthe skirt faces each edge grew.
The booleans have history too. differenceWithHistory reports the block's history first and then one for each tool, and in a tool's history edgesFromFaces lists the edges its faces cut into the block. So the two rims of the round hole come straight from the round tool, with no need to search for them by size or position:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"block": {
"id": "block",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 14,
"length": 10,
"height": 4,
"center": [
0,
2,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"round": {
"id": "round",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 2.2,
"height": 8,
"center": [
-3.6,
-2,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
426
]
},
"square": {
"id": "square",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 3.6,
"length": 3.6,
"height": 8,
"center": [
3.6,
2,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
858
]
},
"tools": {
"id": "tools",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "round",
"output": "result",
"data": {}
},
{
"node": "square",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"cut": {
"id": "cut",
"name": "bitbybit.occt.booleans.differenceWithHistory",
"customName": "difference with history",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"keepEdges": false,
"strategy": "oneAfterAnother"
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"shapes": {
"connections": [
{
"node": "tools",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"histories": {
"id": "histories",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "histories"
},
"inputs": {
"json": {
"connections": [
{
"node": "cut",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"roundHistory": {
"id": "roundHistory",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 1,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "histories",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"edgesFromFaces": {
"id": "edgesFromFaces",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "edgesFromFaces"
},
"inputs": {
"json": {
"connections": [
{
"node": "roundHistory",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"rims": {
"id": "rims",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "edgesFromFaces",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"cutShape": {
"id": "cutShape",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "shape"
},
"inputs": {
"json": {
"connections": [
{
"node": "cut",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
288
]
},
"part": {
"id": "part",
"name": "bitbybit.occt.fillets.filletEdges",
"customName": "fillet edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 0.6
},
"inputs": {
"shape": {
"connections": [
{
"node": "cutShape",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "rims",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
40
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
280
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
1244
]
},
"drawPart": {
"id": "drawPart",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
3400,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
5,
22,
-21
],
"lookAt": [
0,
2,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
3400,
334
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="cut">cut</variable></variables><block type="variables_set" x="40" y="200"><field name="VAR" id="cut">cut</field><value name="VALUE"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.booleans.differenceWithHistory"><value name="Shape"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">14</field></block></value><value name="Length"><block type="math_number"><field name="NUM">10</field></block></value><value name="Height"><block type="math_number"><field name="NUM">4</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Shapes"><block type="lists_create_with"><mutation items="2"></mutation><value name="ADD0"><block type="bitbybit.occt.shapes.solid.createCylinder"><value name="Radius"><block type="math_number"><field name="NUM">2.2</field></block></value><value name="Height"><block type="math_number"><field name="NUM">8</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">-3.6</field></block></value><value name="Y"><block type="math_number"><field name="NUM">-2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">360</field></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><value name="ADD1"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">3.6</field></block></value><value name="Length"><block type="math_number"><field name="NUM">3.6</field></block></value><value name="Height"><block type="math_number"><field name="NUM">8</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">3.6</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value><value name="KeepEdges"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Strategy"><block type="bitbybit.occt.enums.booleanStrategyEnum"><field name="bitbybit.occt.enums.booleanStrategyEnum">'oneAfterAnother'</field></block></value></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.fillets.filletEdges"><value name="Shape"><block type="bitbybit.json.getValueOnProp"><value name="Json"><block type="variables_get"><field name="VAR" id="cut">cut</field></block></value><value name="Property"><block type="text"><field name="TEXT">shape</field></block></value></block></value><value name="Radius"><block type="math_number"><field name="NUM">0.6</field></block></value><value name="Indexes"><block type="bitbybit.lists.getItem"><value name="List"><block type="bitbybit.json.getValueOnProp"><value name="Json"><block type="bitbybit.lists.getItem"><value name="List"><block type="bitbybit.json.getValueOnProp"><value name="Json"><block type="variables_get"><field name="VAR" id="cut">cut</field></block></value><value name="Property"><block type="text"><field name="TEXT">histories</field></block></value></block></value><value name="Index"><block type="math_number"><field name="NUM">1</field></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Property"><block type="text"><field name="TEXT">edgesFromFaces</field></block></value></block></value><value name="Index"><block type="math_number"><field name="NUM">0</field></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value><value name="Options"><block type="bitbybit.draw.optionsOcctShape"><value name="FaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeColour"><block type="colour_picker"><field name="COLOUR">#5f6773</field></block></value><value name="FaceColour"><block type="colour_picker"><field name="COLOUR">#ff0000</field></block></value><value name="VertexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="FaceMaterial"><block type="bitbybit.draw.createPBRMaterial"><value name="Name"><block type="text"><field name="TEXT">PBRMaterial</field></block></value><value name="BaseColor"><block type="colour_picker"><field name="COLOUR">#eef0f2</field></block></value><value name="Metallic"><block type="math_number"><field name="NUM">0.7</field></block></value><value name="Roughness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Alpha"><block type="math_number"><field name="NUM">1</field></block></value><value name="EmissiveColor"><block type="colour_picker"><field name="COLOUR">#000000</field></block></value><value name="EmissiveIntensity"><block type="math_number"><field name="NUM">1</field></block></value><value name="ZOffset"><block type="math_number"><field name="NUM">0</field></block></value><value name="ZOffsetUnits"><block type="math_number"><field name="NUM">0</field></block></value><value name="AlphaMode"><block type="bitbybit.draw.enums.alphaModeEnum"><field name="bitbybit.draw.enums.alphaModeEnum">'opaque'</field></block></value><value name="AlphaCutoff"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="DoubleSided"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Wireframe"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Unlit"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value></block></value><value name="EdgeWidth"><block type="math_number"><field name="NUM">2</field></block></value><value name="EdgeWidthBySize"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="VertexSize"><block type="math_number"><field name="NUM">0.03</field></block></value><value name="DrawEdges"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawFaces"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="DrawVertices"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="Precision"><block type="math_number"><field name="NUM">0.01</field></block></value><value name="AngularDeflection"><block type="math_number"><field name="NUM">0.5</field></block></value><value name="RelativeDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="PrecisionShare"><block type="math_number"><field name="NUM">0</field></block></value><value name="DrawEdgeIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="EdgeIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="EdgeIndexColour"><block type="colour_picker"><field name="COLOUR">#ff00ff</field></block></value><value name="DrawFaceIndexes"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="FaceIndexHeight"><block type="math_number"><field name="NUM">0.06</field></block></value><value name="FaceIndexColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="DrawTwoSided"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#0000ff</field></block></value><value name="BackFaceOpacity"><block type="math_number"><field name="NUM">1</field></block></value><value name="EdgeArrowSize"><block type="math_number"><field name="NUM">0</field></block></value><value name="EdgeArrowAngle"><block type="math_number"><field name="NUM">15</field></block></value><value name="KeepMeshData"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="AllowQualityDecrease"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value><value name="ForceFaceDeflection"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="DrawIsoCurves"><block type="logic_boolean"><field name="BOOL">FALSE</field></block></value><value name="IsoCurvesU"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesV"><block type="math_number"><field name="NUM">5</field></block></value><value name="IsoCurvesColour"><block type="colour_picker"><field name="COLOUR">#808080</field></block></value><value name="SurfaceAnalysis"><block type="bitbybit.occt.enums.surfaceAnalysisEnum"><field name="bitbybit.occt.enums.surfaceAnalysisEnum">'none'</field></block></value><value name="DraftDirection"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">5</field></block></value><value name="Y"><block type="math_number"><field name="NUM">22</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-21</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></next></block></xml>
const block = await bitbybit.occt.shapes.solid.createBox({ width: 14, length: 10, height: 4, center: [0, 2, 0] });
const round = await bitbybit.occt.shapes.solid.createCylinder({ radius: 2.2, height: 8, center: [-3.6, -2, 0], direction: [0, 1, 0] });
const square = await bitbybit.occt.shapes.solid.createBox({ width: 3.6, length: 3.6, height: 8, center: [3.6, 2, 0] });
const cut = await bitbybit.occt.booleans.differenceWithHistory({ shape: block, shapes: [round, square], keepEdges: false });
const roundHistory = cut.histories[1];
const rims = roundHistory.edgesFromFaces[0];
const part = await bitbybit.occt.fillets.filletEdges({ shape: cut.shape, radius: 0.6, indexes: rims });
const steel = new Bit.Inputs.Draw.DrawOcctShapeOptions();
steel.faceMaterial = bitbybit.draw.createPBRMaterial({ baseColor: "#eef0f2", metallic: 0.7, roughness: 0.3 });
steel.edgeColour = "#5f6773";
steel.drawTwoSided = false;
await bitbybit.draw.drawAnyAsync({ entity: part, options: steel });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [5, 22, -21], lookAt: [0, 2, 0] });
Every feature
| Function | What it does |
|---|---|
boss | Grows a boss out of a base by sweeping a profile face that lies on one of its faces along direction. |
bossWithHistory | Grows 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. |
counterboredHoles | Drills holes as holes does, each with a wider, flat-bottomed counterbore at its mouth that sinks a screw head below the surface. |
counterboredHolesWithHistory | Drills holes as counterboredHoles does, and reports a history for the shape, then one per hole in the order of frames. |
countersunkHoles | Drills holes as holes does, each with a cone-shaped countersink at its mouth that sinks a flat screw head flush with the surface. |
countersunkHolesWithHistory | Drills holes as countersunkHoles does, and reports a history for the shape, then one per hole in the order of frames. |
groove | 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. |
grooveWithHistory | Cuts a groove as groove does, and reports two histories: the base's, then the wire's, whose facesFromEdges holds the wall each wire edge cut and firstFaces and lastFaces the groove's two flat sides. |
holes | 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. |
holesWithHistory | Drills holes as holes does, and reports a history for the shape, then one per hole in the order of frames. |
pocket | 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. |
pocketWithHistory | Cuts 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. |
pushPullFaces | 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. |
pushPullFacesWithHistory | Moves 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. |
removeFaces | 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. |
removeFacesWithHistory | Removes 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. |
revolvedBoss | 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. |
revolvedBossWithHistory | Adds a ring as revolvedBoss does, and reports two histories: the base's, then the profile's, whose facesFromEdges holds the face each profile edge turned into, such as the ring's outer wall and its two sides. |
revolvedPocket | 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. |
revolvedPocketWithHistory | Cuts a groove round a base as revolvedPocket does, and reports two histories: the base's, whose side splits into the pieces on either side of the groove, then the profile's, whose facesFromEdges holds the groove's floor and walls. |
rib | 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. |
ribWithHistory | Adds a rib as rib does, and reports two histories: the base's, then the wire's, whose facesFromEdges holds the face each wire edge made and firstFaces and lastFaces the rib's two flat sides. |
taperedBoss | Grows a boss out of a base as boss does, straight out of the sketch face, with its sides leaning by angle degrees. |
taperedBossWithHistory | Grows a tapered boss as taperedBoss does, and reports two histories: the base's, then the profile's, whose facesFromEdges holds the leaning side each profile edge swept and lastFaces the top. |
taperedPocket | Cuts a pocket into a base as pocket does, straight in from the sketch face, with its sides leaning by angle degrees. |
taperedPocketWithHistory | Cuts a tapered pocket as taperedPocket does, and reports two histories: the base's, then the profile's, whose facesFromEdges holds the leaning wall each profile edge swept and lastFaces the floor. |
| Function | What it does |
|---|---|
draftAngle | Tilts the selected faces of a shape by a draft angle so the part can be pulled out of a mold along direction. |
draftAngleWithHistory | Drafts faces as draftAngle does, and reports what each face, edge and vertex of the shape became: a drafted face becomes its tilted successor in faces. |
makeDraft | Grows a tapered skirt from a wire, or the edges of a shape: each edge is swept along direction, leaning outward by angle degrees, until the skirt is lengthMax long. |
makeDraftToShape | Grows a tapered skirt from a wire or the edges of a shape like makeDraft, stopping it where it meets stopShape. |
makeDraftToShapeWithHistory | Grows a skirt up to a stop shape as makeDraftToShape does, and reports what each edge of the wire or shape swept, as makeDraftWithHistory does. |
makeDraftWithHistory | Grows a skirt as makeDraft does, and reports what each edge of the wire or shape swept: facesFromEdges[i] holds the skirt faces edge i grew. |
| Function | What it does |
|---|---|
chamferCornerByPoint | Bevels the corner nearest each given point on a shell or solid, touching only that corner. |
classifyCornerByPoint | Looks up the corner nearest each given point and reports what kind it is, without changing the shape. |
cornerByPointReport | Runs 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. |
filletCornerByPoint | Rounds the corner nearest each given point on a shell or solid, touching only that corner. |



