Skip to main content
OCCT category icon with a stylized logo representation

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
Primitive solids
Bitbybit Platform

Primitive solids in Rete

rete logoRete
Script Source (rete)
{
"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": {}
}

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:

A portal frame from standard sections
Bitbybit Platform

A portal frame from standard sections in Rete

rete logoRete
Script Source (rete)
{
"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": {}
}

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:

A mug with a torus for a handle
Bitbybit Platform

A mug with a torus for a handle in Rete

rete logoRete
Script Source (rete)
{
"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": {}
}

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.