Inside a shape: its graph and its geometry
An OpenCascade shape has two layers. The topology says what the shape is made of and how the parts connect: a solid bounded by shells, a shell made of faces, faces bounded by wires of edges, edges ending in vertices. The geometry says where each part lies: the surface a face is cut from, the curve an edge follows, the point a vertex sits at. A cylinder's side face is a piece of an infinite cylindrical surface, trimmed by two circular edges.
Most scripts never look at either layer directly: they build, combine and select. These two namespaces are for when you need to.
The graph: occt.brepGraph
bitbybit.occt.brepGraph reads a shape as a graph and answers in plain data:
analyzecounts what the shape is made of, and the distinct surfaces and curves behind it;faceAdjacencylists, for every face, the faces it shares an edge with;edgeFaceMaplists, for every edge, the faces it belongs to and whether it is a seam;vertexEdgeMaplists every vertex with the edges that meet there;faceInfo,edgeInfoandwireInfodescribe the geometry behind each face, edge and wire: the kind of surface or curve, its bounds and its continuity;containmentmaps upward, from faces to shells to solids;assemblyreads an assembly's products and the places each is used;dumpwrites out the whole structure, andvalidatechecks it for dangling or inconsistent links.
Every query returns its answer with an ok flag and an error message rather than stopping the script, so a batch of queries can report what failed item by item. nodeOfShape finds the node that stands for a sub-shape, and reconstruct turns a node back into the real face or edge, to draw it, measure it or build on it.
Reach for the graph to find faces by how they connect, such as every face next to a selected one, or to understand a shape that came from a file. To pick faces and edges by what they are and where they lie, selecting by rule is simpler.
Here faceAdjacency answers what touches the top of a plate. Its faces list holds one entry per face, and for a solid like this one the entries follow the numbers occt.shapes.face.getFaces gives, so the entry of the top face lists its neighbours. reconstruct then turns each of those numbers into a real face to draw: the four sides, and the wall of the hole. For a single question like this one, bitbybit.occt.select.faces.adjacentTo gives the numbers directly; the graph answers it for every face at once:

- 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": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 10,
"length": 6,
"height": 2,
"center": [
0,
1,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"centre": {
"id": "centre",
"name": "bitbybit.frame.zx",
"customName": "zx",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
2,
0
]
},
"inputs": {},
"position": [
40,
426
]
},
"frames": {
"id": "frames",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "centre",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"plate": {
"id": "plate",
"name": "bitbybit.occt.features.holes",
"customName": "holes",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"diameter": 2,
"depth": 0,
"tipAngle": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "box",
"output": "result",
"data": {}
}
]
},
"frames": {
"connections": [
{
"node": "frames",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"seeThrough": {
"id": "seeThrough",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 0.25,
"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": 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,
666
]
},
"drawPlate": {
"id": "drawPlate",
"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": "plate",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "seeThrough",
"output": "result",
"data": {}
}
]
}
},
"position": [
3400,
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": "plate",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
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": [
1720,
40
]
},
"graph": {
"id": "graph",
"name": "bitbybit.occt.brepGraph.faceAdjacency",
"customName": "face adjacency",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "plate",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
380
]
},
"faces": {
"id": "faces",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "faces"
},
"inputs": {
"json": {
"connections": [
{
"node": "graph",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
288
]
},
"topEntry": {
"id": "topEntry",
"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": "faces",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "top",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"neighbours": {
"id": "neighbours",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 1,
"forceExecution": false
},
"property": "adjacent"
},
"inputs": {
"json": {
"connections": [
{
"node": "topEntry",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"realFaces": {
"id": "realFaces",
"name": "bitbybit.occt.brepGraph.reconstruct",
"customName": "reconstruct",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"kind": "face",
"index": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "plate",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "neighbours",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
40
]
},
"bright": {
"id": "bright",
"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": true,
"backFaceColour": "#ff4400",
"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,
2616
]
},
"drawNeighbours": {
"id": "drawNeighbours",
"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": "realFaces",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "bright",
"output": "result",
"data": {}
}
]
}
},
"position": [
3400,
334
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="plate">plate</variable><variable id="neighbours">neighbours</variable><variable id="face">face</variable></variables><block type="variables_set" x="40" y="40"><field name="VAR" id="plate">plate</field><value name="VALUE"><block type="bitbybit.occt.features.holes"><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">2</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">1</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="lists_create_with"><mutation items="1"></mutation><value name="ADD0"><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">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value></block></value><value name="Diameter"><block type="math_number"><field name="NUM">2</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></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="variables_get"><field name="VAR" id="plate">plate</field></block></value><value name="Options"><block type="bitbybit.draw.optionsOcctShape"><value name="FaceOpacity"><block type="math_number"><field name="NUM">0.25</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">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="variables_set"><field name="VAR" id="neighbours">neighbours</field><value name="VALUE"><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="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.brepGraph.faceAdjacency"><value name="Shape"><block type="variables_get"><field name="VAR" id="plate">plate</field></block></value></block></value></block></value><value name="Property"><block type="text"><field name="TEXT">faces</field></block></value></block></value><value name="Index"><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="plate">plate</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="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><value name="Property"><block type="text"><field name="TEXT">adjacent</field></block></value></block></value><next><block type="controls_forEach"><field name="VAR" id="face">face</field><value name="LIST"><block type="variables_get"><field name="VAR" id="neighbours">neighbours</field></block></value><statement name="DO"><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.brepGraph.reconstruct"><value name="Shape"><block type="variables_get"><field name="VAR" id="plate">plate</field></block></value><value name="Kind"><block type="bitbybit.occt.enums.brepGraphNodeKindEnum"><field name="bitbybit.occt.enums.brepGraphNodeKindEnum">'face'</field></block></value><value name="Index"><block type="variables_get"><field name="VAR" id="face">face</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">TRUE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#ff4400</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></block></statement></block></next></block></next></block></next></block></xml>
const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 6, height: 2, center: [0, 1, 0] });
const plate = await bitbybit.occt.features.holes({ shape: box, frames: [bitbybit.frame.zx({ origin: [0, 2, 0] })], diameter: 2 });
const [top] = await bitbybit.occt.select.faces.facing({ shape: plate, direction: [0, 1, 0] });
const graph = await bitbybit.occt.brepGraph.faceAdjacency({ shape: plate });
const neighbours = graph.faces[top].adjacent;
const seeThrough = new Bit.Inputs.Draw.DrawOcctShapeOptions();
seeThrough.faceColour = "#ffffff";
seeThrough.faceOpacity = 0.25;
seeThrough.edgeColour = "#5f6773";
seeThrough.drawTwoSided = false;
await bitbybit.draw.drawAnyAsync({ entity: plate, options: seeThrough });
const bright = new Bit.Inputs.Draw.DrawOcctShapeOptions();
bright.faceColour = "#ff4400";
bright.edgeColour = "#5f6773";
bright.drawTwoSided = true;
bright.backFaceColour = "#ff4400";
for (const index of neighbours) {
const face = await bitbybit.occt.brepGraph.reconstruct({ shape: plate, kind: Bit.Inputs.OCCT.brepGraphNodeKindEnum.face, index });
await bitbybit.draw.drawAnyAsync({ entity: face, options: bright });
}
A compound holding the same shape twice keeps that shape once in its graph, so its numbers and those of getFaces part ways; go through nodeOfShape there.
The geometry: occt.geom
bitbybit.occt.geom reaches beneath the topology to the curves and surfaces themselves:
surfaces.surfaceFromFacereads the surface a face lies on, without its boundary, andsurfaces.cylindricalSurfacemakes an infinite cylinder;curvesmakes 2D curves, segments, ellipses and trimmed pieces, for constructions in the UV space of a surface, and evaluates them at a parameter.geomCircleCurveandgeomEllipseCurvemake full circles and ellipses as closed wires.
A surface or a 2D curve cannot be drawn on its own: it has no boundary. Wrap it into a face or an edge first, with occt.shapes.face and occt.shapes.edge, such as faceFromSurfaceAndWire, which trims a surface by a wire. This is how a pattern is drawn on a curved face: build it in the face's UV space, then put it on the surface.
Here a rectangle is drawn in the face's UV space and put on the surface. bitbybit.occt.shapes.wire.placeWireOnFace wraps a flat wire around a face, reading its Z coordinate as the angle around the axis, in radians, and its X coordinate as the height along it, so this rectangle stands 6 tall and spans 1.4 radians. bitbybit.occt.shapes.face.createFaceBoundedByWiresOnFace then cuts the part of the surface the wrapped wire encloses, and it takes wires either way round:

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"drum": {
"id": "drum",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 5,
"height": 10,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
40
]
},
"round": {
"id": "round",
"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": "drum",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"sideNumber": {
"id": "sideNumber",
"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": "round",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"side": {
"id": "side",
"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": "drum",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "sideNumber",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"flat": {
"id": "flat",
"name": "bitbybit.occt.shapes.wire.createRectangleWire",
"customName": "rectangle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 6,
"length": 1.4,
"center": [
5,
0,
3
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
472
]
},
"wrapped": {
"id": "wrapped",
"name": "bitbybit.occt.shapes.wire.placeWireOnFace",
"customName": "place wire on face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"wire": {
"connections": [
{
"node": "flat",
"output": "result",
"data": {}
}
]
},
"face": {
"connections": [
{
"node": "side",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"wires": {
"id": "wires",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "wrapped",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"panel": {
"id": "panel",
"name": "bitbybit.occt.shapes.face.createFaceBoundedByWiresOnFace",
"customName": "face bounded by wires on face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"wires": {
"connections": [
{
"node": "wires",
"output": "list",
"data": {}
}
]
},
"face": {
"connections": [
{
"node": "side",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"bright": {
"id": "bright",
"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": true,
"backFaceColour": "#ff4400",
"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,
812
]
},
"drawPanel": {
"id": "drawPanel",
"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": "panel",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "bright",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
40
]
},
"outline": {
"id": "outline",
"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": false,
"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": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
2762
]
},
"drawDrum": {
"id": "drawDrum",
"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": "drum",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "outline",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
334
]
},
"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,
14,
-26
],
"lookAt": [
0,
5,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2980,
628
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="drum">drum</variable><variable id="side">side</variable></variables><block type="variables_set" x="40" y="40"><field name="VAR" id="drum">drum</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createCylinder"><value name="Radius"><block type="math_number"><field name="NUM">5</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">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><next><block type="variables_set"><field name="VAR" id="side">side</field><value name="VALUE"><block type="bitbybit.occt.shapes.face.getFace"><value name="Shape"><block type="variables_get"><field name="VAR" id="drum">drum</field></block></value><value name="Index"><block type="bitbybit.lists.getFirstItem"><value name="List"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.faces.ofType"><value name="Shape"><block type="variables_get"><field name="VAR" id="drum">drum</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="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.shapes.face.createFaceBoundedByWiresOnFace"><value name="Wires"><block type="lists_create_with"><mutation items="1"></mutation><value name="ADD0"><block type="bitbybit.occt.shapes.wire.placeWireOnFace"><value name="Wire"><block type="bitbybit.occt.shapes.wire.createRectangleWire"><value name="Width"><block type="math_number"><field name="NUM">6</field></block></value><value name="Length"><block type="math_number"><field name="NUM">1.4</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">3</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="Face"><block type="variables_get"><field name="VAR" id="side">side</field></block></value></block></value></block></value><value name="Face"><block type="variables_get"><field name="VAR" id="side">side</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">TRUE</field></block></value><value name="BackFaceColour"><block type="colour_picker"><field name="COLOUR">#ff4400</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="drum">drum</field></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">#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">FALSE</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">'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">10</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">-26</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></next></block></xml>
const drum = await bitbybit.occt.shapes.solid.createCylinder({ radius: 5, height: 10, center: [0, 0, 0], direction: [0, 1, 0] });
const [sideNumber] = await bitbybit.occt.select.faces.ofType({ shape: drum, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder });
const side = await bitbybit.occt.shapes.face.getFace({ shape: drum, index: sideNumber });
const flat = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 6, length: 1.4, center: [5, 0, 3], direction: [0, 1, 0] });
const wrapped = await bitbybit.occt.shapes.wire.placeWireOnFace({ wire: flat, face: side });
const panel = await bitbybit.occt.shapes.face.createFaceBoundedByWiresOnFace({ wires: [wrapped], face: side });
const bright = new Bit.Inputs.Draw.DrawOcctShapeOptions();
bright.faceColour = "#ff4400";
bright.edgeColour = "#5f6773";
bright.drawTwoSided = true;
bright.backFaceColour = "#ff4400";
await bitbybit.draw.drawAnyAsync({ entity: panel, options: bright });
const outline = new Bit.Inputs.Draw.DrawOcctShapeOptions();
outline.drawFaces = false;
await bitbybit.draw.drawAnyAsync({ entity: drum, options: outline });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [10, 14, -26], lookAt: [0, 5, 0] });
Every function
The graph
| Function | What it does |
|---|---|
analyze | Counts what a shape is made of: solids, shells, faces, wires, edges, coedges and vertices, the distinct surfaces and curves behind them, and any assembly products and occurrences. |
assembly | Reads the assembly structure of a shape as products and occurrences: a product is a part or sub-assembly defined once, an occurrence is one placement of it with a matrix and a parent. |
containment | Maps the shape's parts upward: which shells each face belongs to, which solids each shell belongs to, and which solids each face ends up in. |
dump | Dumps the whole structure of a shape: every solid, shell, face, edge and vertex with its unique id and the parts directly below it. |
edgeFaceMap | Lists, for every edge, the faces it belongs to, its end vertices and its topology flags, such as whether it is a seam or a border edge. |
edgeInfo | Describes the geometry of every edge: the kind of curve it follows, its parameter range, its continuity and a unique id. |
faceAdjacency | Lists, for every face, the faces that share an edge with it, along with its edges, wire count and outer wire. |
faceInfo | Describes the geometry of every face: the kind of surface it lies on, its UV bounds, whether it carries a triangulation, and a unique id. |
nodeOfShape | Finds the graph node that stands for a given sub-shape of a shape: its kind, its index and its unique id. |
reconstruct | Turns a node of the graph, given by its kind and index, back into the real sub-shape it stands for, so a face or edge found by a query can be used in an operation. |
validate | Checks the structure of a shape's graph for problems such as dangling references or inconsistent links, and lists every issue found with its severity. |
vertexEdgeMap | Lists every vertex with its 3D point, its tolerance and the edges that meet there. |
wireInfo | Describes every wire: whether it is closed, whether it is the outer boundary of its face, how many coedges and distinct edges it has and which face owns it. |
The geometry
| Function | What it does |
|---|---|
curves.geom2dEllipse | Creates a 2D ellipse curve in a plane, for constructions in the UV space of a surface. |
curves.geom2dSegment | Creates a straight 2D curve segment between two 2D points, for constructions in the UV space of a surface. |
curves.geom2dTrimmedCurve | Cuts a piece out of a 2D curve between the parameters u1 and u2. |
curves.geomCircleCurve | Creates a full circle as a closed single-edge wire, lying in the plane whose normal is direction. |
curves.geomEllipseCurve | Creates a full ellipse as a closed single-edge wire, lying in the plane whose normal is direction. |
curves.get2dPointFrom2dCurveOnParam | Evaluates a 2D curve at a parameter and returns the 2D point there. |
surfaces.cylindricalSurface | Creates an infinite cylindrical surface of the given radius around an axis through center along direction. |
surfaces.surfaceFromFace | Reads the underlying surface a face lies on, without its boundary. |



