Introduction to OCCT Solids
Solids are three-dimensional shapes that represent complete geometric objects with volume. OCCT provides several primitive solid types that serve as building blocks for more complex 3D modeling operations. These primitives are commonly used in CAD applications and can be combined, modified, and transformed to create sophisticated geometries.
This example demonstrates the creation of the most common primitive solid types:
- Box: A rectangular solid with specified width, length, and height
- Cube: A special case of a box where all dimensions are equal
- Cylinder: A circular solid with specified radius and height
- Sphere: A perfectly round solid with a specified radius
- Cone: A tapered solid with different radii at top and bottom

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"box": {
"id": "box",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 3,
"length": 7,
"height": 8,
"center": [
0,
0,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
1095,
212
]
},
"cube": {
"id": "cube",
"name": "bitbybit.occt.shapes.solid.createCube",
"customName": "cube",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"size": 5,
"center": [
0,
0,
0
],
"originOnCenter": true
},
"inputs": {
"center": {
"connections": [
{
"node": "pointXyz",
"output": "result",
"data": {}
}
]
}
},
"position": [
1096,
639
]
},
"pointXyz": {
"id": "pointXyz",
"name": "bitbybit.point.pointXYZ",
"customName": "point xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 5,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
726,
680
]
},
"cylinder": {
"id": "cylinder",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 2,
"height": 3,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": true
},
"inputs": {
"center": {
"connections": [
{
"node": "pointXyz2",
"output": "result",
"data": {}
}
]
}
},
"position": [
1102,
1057
]
},
"pointXyz2": {
"id": "pointXyz2",
"name": "bitbybit.point.pointXYZ",
"customName": "point xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -5,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
729,
1135
]
},
"sphere": {
"id": "sphere",
"name": "bitbybit.occt.shapes.solid.createSphere",
"customName": "sphere",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 1.5,
"center": [
0,
0,
0
]
},
"inputs": {
"center": {
"connections": [
{
"node": "pointXyz3",
"output": "result",
"data": {}
}
]
}
},
"position": [
1117,
1522
]
},
"pointXyz3": {
"id": "pointXyz3",
"name": "bitbybit.point.pointXYZ",
"customName": "point xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 10,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
712,
1562
]
},
"cone": {
"id": "cone",
"name": "bitbybit.occt.shapes.solid.createCone",
"customName": "cone",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius1": 2,
"radius2": 1,
"height": 3,
"angle": 360,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {
"center": {
"connections": [
{
"node": "pointXyz4",
"output": "result",
"data": {}
}
]
}
},
"position": [
1118,
1889
]
},
"pointXyz4": {
"id": "pointXyz4",
"name": "bitbybit.point.pointXYZ",
"customName": "point xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -10,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
724,
2042
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="box">box</variable><variable id="cube">cube</variable><variable id="cylinder">cylinder</variable><variable id="sphere">sphere</variable><variable id="cone">cone</variable></variables><block type="variables_set" x="50" y="50"><field name="VAR" id="box">box</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">3</field></block></value><value name="Length"><block type="math_number"><field name="NUM">7</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">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="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="cube">cube</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createCube"><value name="Size"><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">5</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="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="cylinder">cylinder</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createCylinder"><value name="Radius"><block type="math_number"><field name="NUM">2</field></block></value><value name="Height"><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">-5</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><value name="Angle"><block type="math_number"><field name="NUM">360</field></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="sphere">sphere</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createSphere"><value name="Radius"><block type="math_number"><field name="NUM">1.5</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">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="variables_set"><field name="VAR" id="cone">cone</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createCone"><value name="Radius1"><block type="math_number"><field name="NUM">2</field></block></value><value name="Radius2"><block type="math_number"><field name="NUM">1</field></block></value><value name="Height"><block type="math_number"><field name="NUM">3</field></block></value><value name="Angle"><block type="math_number"><field name="NUM">360</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">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><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="box">box</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="cube">cube</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="cylinder">cylinder</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="sphere">sphere</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="cone">cone</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
// Import required DTOs and types for solid creation
const { BoxDto, CubeDto, CylinderDto, SphereDto, ConeDto } = Bit.Inputs.OCCT;
type Point3 = Bit.Inputs.Base.Point3;
type Vector3 = Bit.Inputs.Base.Vector3;
// Get access to OCCT solid creation functions
const { solid } = bitbybit.occt.shapes;
// Create various primitive solids
// Create a rectangular box
const boxOptions = new BoxDto();
boxOptions.width = 3;
boxOptions.length = 7;
boxOptions.height = 8;
boxOptions.center = [0, 0, 0] as Point3;
boxOptions.originOnCenter = true;
const box = await solid.createBox(boxOptions);
// Create a cube at a different position
const cubeOptions = new CubeDto();
cubeOptions.size = 5;
cubeOptions.center = [5, 0, 0] as Point3;
cubeOptions.originOnCenter = true;
const cube = await solid.createCube(cubeOptions);
// Create a cylinder
const cylinderOptions = new CylinderDto();
cylinderOptions.radius = 2;
cylinderOptions.height = 3;
cylinderOptions.center = [-5, 0, 0] as Point3;
cylinderOptions.direction = [0, 1, 0] as Vector3;
cylinderOptions.angle = 360;
cylinderOptions.originOnCenter = true;
const cylinder = await solid.createCylinder(cylinderOptions);
// Create a sphere
const sphereOptions = new SphereDto();
sphereOptions.radius = 1.5;
sphereOptions.center = [10, 0, 0] as Point3;
const sphere = await solid.createSphere(sphereOptions);
// Create a cone
const coneOptions = new ConeDto();
coneOptions.radius1 = 2;
coneOptions.radius2 = 1;
coneOptions.height = 3;
coneOptions.angle = 360;
coneOptions.center = [-10, 0, 0] as Point3;
coneOptions.direction = [0, 1, 0] as Vector3;
const cone = await solid.createCone(coneOptions);
// Draw all the created solids
bitbybit.draw.drawAnyAsync({ entity: box });
bitbybit.draw.drawAnyAsync({ entity: cube });
bitbybit.draw.drawAnyAsync({ entity: cylinder });
bitbybit.draw.drawAnyAsync({ entity: sphere });
bitbybit.draw.drawAnyAsync({ entity: cone });
These primitive solids serve as the foundation for more complex 3D modeling operations. They can be combined using boolean operations (union, intersection, difference), transformed, and modified to create sophisticated geometries for engineering and design applications.
Standard sections
The beam solids make a structural section as one solid: createIBeamProfileSolid, createHBeamProfileSolid, createTBeamProfileSolid and createUBeamProfileSolid. width and height size the section, webThickness and flangeThickness its parts. center and direction place it, rotation turns it about its axis, and extrusionLengthFront and extrusionLengthBack run it out from there:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"left": {
"id": "left",
"name": "bitbybit.occt.shapes.solid.createIBeamProfileSolid",
"customName": "I beam profile solid",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 2,
"height": 3,
"webThickness": 0.2,
"flangeThickness": 0.3,
"alignment": "midMid",
"rotation": 0,
"center": [
-9,
0,
0
],
"direction": [
0,
1,
0
],
"extrusionLengthFront": 12,
"extrusionLengthBack": 0
},
"inputs": {},
"position": [
40,
40
]
},
"right": {
"id": "right",
"name": "bitbybit.occt.shapes.solid.createIBeamProfileSolid",
"customName": "I beam profile solid",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 2,
"height": 3,
"webThickness": 0.2,
"flangeThickness": 0.3,
"alignment": "midMid",
"rotation": 0,
"center": [
9,
0,
0
],
"direction": [
0,
1,
0
],
"extrusionLengthFront": 12,
"extrusionLengthBack": 0
},
"inputs": {},
"position": [
40,
656
]
},
"top": {
"id": "top",
"name": "bitbybit.occt.shapes.solid.createHBeamProfileSolid",
"customName": "H beam profile solid",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 2,
"height": 3,
"webThickness": 0.3,
"flangeThickness": 0.4,
"alignment": "midMid",
"rotation": 90,
"center": [
-10,
13.5,
0
],
"direction": [
1,
0,
0
],
"extrusionLengthFront": 20,
"extrusionLengthBack": 0
},
"inputs": {},
"position": [
40,
1272
]
},
"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,
40
]
},
"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,
1888
]
},
"paint": {
"id": "paint",
"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": "#ff4400",
"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": {},
"position": [
40,
2918
]
},
"drawLeft": {
"id": "drawLeft",
"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": "left",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"drawRight": {
"id": "drawRight",
"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": "right",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
334
]
},
"drawTop": {
"id": "drawTop",
"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": "top",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "paint",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
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": [
18,
26,
-27
],
"lookAt": [
0,
7,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
880,
922
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="steel">steel</variable></variables><block type="variables_set" x="40" y="200"><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="bitbybit.occt.shapes.solid.createIBeamProfileSolid"><value name="Width"><block type="math_number"><field name="NUM">2</field></block></value><value name="Height"><block type="math_number"><field name="NUM">3</field></block></value><value name="WebThickness"><block type="math_number"><field name="NUM">0.2</field></block></value><value name="FlangeThickness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Alignment"><block type="bitbybit.base.enums.basicAlignmentEnum"><field name="bitbybit.base.enums.basicAlignmentEnum">'midMid'</field></block></value><value name="Rotation"><block type="math_number"><field name="NUM">0</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">-9</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><value name="ExtrusionLengthFront"><block type="math_number"><field name="NUM">12</field></block></value><value name="ExtrusionLengthBack"><block type="math_number"><field name="NUM">0</field></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.shapes.solid.createIBeamProfileSolid"><value name="Width"><block type="math_number"><field name="NUM">2</field></block></value><value name="Height"><block type="math_number"><field name="NUM">3</field></block></value><value name="WebThickness"><block type="math_number"><field name="NUM">0.2</field></block></value><value name="FlangeThickness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="Alignment"><block type="bitbybit.base.enums.basicAlignmentEnum"><field name="bitbybit.base.enums.basicAlignmentEnum">'midMid'</field></block></value><value name="Rotation"><block type="math_number"><field name="NUM">0</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">9</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><value name="ExtrusionLengthFront"><block type="math_number"><field name="NUM">12</field></block></value><value name="ExtrusionLengthBack"><block type="math_number"><field name="NUM">0</field></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.shapes.solid.createHBeamProfileSolid"><value name="Width"><block type="math_number"><field name="NUM">2</field></block></value><value name="Height"><block type="math_number"><field name="NUM">3</field></block></value><value name="WebThickness"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="FlangeThickness"><block type="math_number"><field name="NUM">0.4</field></block></value><value name="Alignment"><block type="bitbybit.base.enums.basicAlignmentEnum"><field name="bitbybit.base.enums.basicAlignmentEnum">'midMid'</field></block></value><value name="Rotation"><block type="math_number"><field name="NUM">90</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">13.5</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">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="ExtrusionLengthFront"><block type="math_number"><field name="NUM">20</field></block></value><value name="ExtrusionLengthBack"><block type="math_number"><field name="NUM">0</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">#ff4400</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">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">18</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">-27</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">7</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></xml>
const left = await bitbybit.occt.shapes.solid.createIBeamProfileSolid({ width: 2, height: 3, webThickness: 0.2, flangeThickness: 0.3, center: [-9, 0, 0], direction: [0, 1, 0], extrusionLengthFront: 12 });
const right = await bitbybit.occt.shapes.solid.createIBeamProfileSolid({ width: 2, height: 3, webThickness: 0.2, flangeThickness: 0.3, center: [9, 0, 0], direction: [0, 1, 0], extrusionLengthFront: 12 });
const top = await bitbybit.occt.shapes.solid.createHBeamProfileSolid({ width: 2, height: 3, webThickness: 0.3, flangeThickness: 0.4, rotation: 90, center: [-10, 13.5, 0], direction: [1, 0, 0], extrusionLengthFront: 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;
const paint = new Bit.Inputs.Draw.DrawOcctShapeOptions();
paint.faceColour = "#ff4400";
paint.edgeColour = "#5f6773";
paint.drawTwoSided = false;
await bitbybit.draw.drawAnyAsync({ entity: left, options: steel });
await bitbybit.draw.drawAnyAsync({ entity: right, options: steel });
await bitbybit.draw.drawAnyAsync({ entity: top, options: paint });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [18, 26, -27], lookAt: [0, 7, 0] });
Rings
createTorus makes a ring: majorRadius from its center to the middle of the tube and minorRadius for the tube itself. An angle under 360 gives part of a ring. A whole one is often the easier piece to work with, as here, where the bore removes the half that is not wanted:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"body": {
"id": "body",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 3,
"height": 8,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
40
]
},
"ring": {
"id": "ring",
"name": "bitbybit.occt.shapes.solid.createTorus",
"customName": "create torus",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"majorRadius": 2,
"minorRadius": 0.4,
"center": [
3,
4,
0
],
"direction": [
0,
0,
1
],
"angle": 360
},
"inputs": {},
"position": [
40,
472
]
},
"pieces": {
"id": "pieces",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "body",
"output": "result",
"data": {}
},
{
"node": "ring",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"joined": {
"id": "joined",
"name": "bitbybit.occt.booleans.union",
"customName": "union",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"keepEdges": false,
"strategy": "oneAfterAnother"
},
"inputs": {
"shapes": {
"connections": [
{
"node": "pieces",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"bore": {
"id": "bore",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 2.7,
"height": 8.5,
"center": [
0,
0.3,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
858
]
},
"tools": {
"id": "tools",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "bore",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
280
]
},
"mug": {
"id": "mug",
"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": "joined",
"output": "result",
"data": {}
}
]
},
"shapes": {
"connections": [
{
"node": "tools",
"output": "list",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"joints": {
"id": "joints",
"name": "bitbybit.occt.select.edges.concave",
"customName": "concave edges",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"tangentAngle": 1
},
"inputs": {
"shape": {
"connections": [
{
"node": "mug",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"blended": {
"id": "blended",
"name": "bitbybit.occt.fillets.filletEdges",
"customName": "fillet edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 0.15
},
"inputs": {
"shape": {
"connections": [
{
"node": "mug",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "joints",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"drawBlended": {
"id": "drawBlended",
"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": "blended",
"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": [
10,
16,
-24
],
"lookAt": [
1.5,
4,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2560,
334
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="mug">mug</variable></variables><block type="variables_set" x="40" y="200"><field name="VAR" id="mug">mug</field><value name="VALUE"><block type="bitbybit.occt.booleans.difference"><value name="Shape"><block type="bitbybit.occt.booleans.union"><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">3</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">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><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.createTorus"><value name="MajorRadius"><block type="math_number"><field name="NUM">2</field></block></value><value name="MinorRadius"><block type="math_number"><field name="NUM">0.4</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">4</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">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">1</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">360</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><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">2.7</field></block></value><value name="Height"><block type="math_number"><field name="NUM">8.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.3</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="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.fillets.filletEdges"><value name="Shape"><block type="variables_get"><field name="VAR" id="mug">mug</field></block></value><value name="Radius"><block type="math_number"><field name="NUM">0.15</field></block></value><value name="Indexes"><block type="bitbybit.occt.select.edges.concave"><value name="Shape"><block type="variables_get"><field name="VAR" id="mug">mug</field></block></value><value name="TangentAngle"><block type="math_number"><field name="NUM">1</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">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">-24</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">1.5</field></block></value><value name="Y"><block type="math_number"><field name="NUM">4</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 body = await bitbybit.occt.shapes.solid.createCylinder({ radius: 3, height: 8, center: [0, 0, 0], direction: [0, 1, 0] });
const ring = await bitbybit.occt.shapes.solid.createTorus({ majorRadius: 2, minorRadius: 0.4, center: [3, 4, 0], direction: [0, 0, 1] });
const joined = await bitbybit.occt.booleans.union({ shapes: [body, ring], keepEdges: false });
const bore = await bitbybit.occt.shapes.solid.createCylinder({ radius: 2.7, height: 8.5, center: [0, 0.3, 0], direction: [0, 1, 0] });
const mug = await bitbybit.occt.booleans.difference({ shape: joined, shapes: [bore], keepEdges: false });
const joints = await bitbybit.occt.select.edges.concave({ shape: mug });
const blended = await bitbybit.occt.fillets.filletEdges({ shape: mug, radius: 0.15, indexes: joints });
await bitbybit.draw.drawAnyAsync({ entity: blended });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [10, 16, -24], lookAt: [1.5, 4, 0] });
A solid from its faces
A body can also be built face by face, without a boolean: make the faces that close it, then let bitbybit.occt.shapes.solid.fromFaces sew them and the shells among them into one solid, turned so its material is inside. Their shared edges must line up within tolerance; faces that leave a wider gap, or that close more than one volume, are refused. fromFacesWithHistory makes the same solid and reports, as a history per shape given, which faces of the solid each of its faces became. Shells shows the sewing step on its own.



