Skip to main content

Measuring and analysing shapes

bitbybit.occt.analysis asks questions of shapes and answers with numbers, points and lists, not new shapes. Use it to size a part, check a fit, find where to put the next feature, or make sure parts do not collide.

Measure​

analysis.measure holds the measurements a designer reaches for:

  • tightBoundingBox, orientedBoundingBox and boundingBoxInFrame: the box around a shape, aligned with the world, turned to fit it as closely as possible, or in a frame of your own;
  • extrema: the nearest points between two shapes, and their distance;
  • angleBetween and dihedralAngle: angles between directions and between faces;
  • principalFrame: a shape's centre of mass and principal axes;
  • minCurvatureRadius: the tightest bend of a shape, and where it is.

Volume and area are with the shapes themselves: bitbybit.occt.shapes.solid.getSolidVolume and getSolidSurfaceArea.

Here orientedBoundingBox measures a tilted cone. Its frame stands at the box's centre, with its direction along the longest side and its normal along the shortest, and halfSizes holds half the box's size along each. A cube of size 2 scaled by those half sizes and placed on the frame draws the box:

The box that fits a tilted part
Bitbybit Platform

The box that fits a tilted part in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"cone": {
"id": "cone",
"name": "bitbybit.occt.shapes.solid.createCone",
"customName": "cone",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius1": 4,
"radius2": 1,
"height": 12,
"angle": 360,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"leaning": {
"id": "leaning",
"name": "bitbybit.occt.transforms.rotate",
"customName": "rotate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"axis": [
0,
0,
1
],
"angle": 35
},
"inputs": {
"shape": {
"connections": [
{
"node": "cone",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"part": {
"id": "part",
"name": "bitbybit.occt.transforms.rotate",
"customName": "rotate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"axis": [
1,
0,
0
],
"angle": 25
},
"inputs": {
"shape": {
"connections": [
{
"node": "leaning",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"fit": {
"id": "fit",
"name": "bitbybit.occt.analysis.measure.orientedBoundingBox",
"customName": "oriented bounding box",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"halfSizes": {
"id": "halfSizes",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "halfSizes"
},
"inputs": {
"json": {
"connections": [
{
"node": "fit",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"frame": {
"id": "frame",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "frame"
},
"inputs": {
"json": {
"connections": [
{
"node": "fit",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
288
]
},
"frames": {
"id": "frames",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "frame",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"cube": {
"id": "cube",
"name": "bitbybit.occt.shapes.solid.createCube",
"customName": "cube",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"size": 2,
"center": [
0,
0,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
472
]
},
"sized": {
"id": "sized",
"name": "bitbybit.occt.transforms.scale3d",
"customName": "scale 3d",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"scale": [
1,
1,
1
],
"center": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "cube",
"output": "result",
"data": {}
}
]
},
"scale": {
"connections": [
{
"node": "halfSizes",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
280
]
},
"placed": {
"id": "placed",
"name": "bitbybit.occt.transforms.placeOnFrames",
"customName": "place on frames",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "sized",
"output": "result",
"data": {}
}
]
},
"frames": {
"connections": [
{
"node": "frames",
"output": "list",
"data": {}
}
]
}
},
"position": [
2560,
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,
766
]
},
"drawBox": {
"id": "drawBox",
"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": "placed",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "seeThrough",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
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": [
0,
21,
-36
],
"lookAt": [
-3,
4,
2
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2980,
334
]
}
},
"modules": {}
}

extrema gives more than the distance. Each result carries the point on each shape and whether it lies on a face, an edge or a vertex, so you can see what is nearest as well as how far:

The nearest points of two parts
Bitbybit Platform

The nearest points of two parts in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"post": {
"id": "post",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 2,
"height": 6,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
40
]
},
"crate": {
"id": "crate",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 4,
"length": 3,
"height": 3,
"center": [
7,
8,
3
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
472
]
},
"closest": {
"id": "closest",
"name": "bitbybit.occt.analysis.measure.extrema",
"customName": "extrema",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shapeA": {
"connections": [
{
"node": "post",
"output": "result",
"data": {}
}
]
},
"shapeB": {
"connections": [
{
"node": "crate",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"nearest": {
"id": "nearest",
"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": "closest",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"onPost": {
"id": "onPost",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "pointA"
},
"inputs": {
"json": {
"connections": [
{
"node": "nearest",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"onCrate": {
"id": "onCrate",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "pointB"
},
"inputs": {
"json": {
"connections": [
{
"node": "nearest",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
288
]
},
"link": {
"id": "link",
"name": "bitbybit.occt.shapes.wire.createLineWire",
"customName": "line wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0,
0
],
"end": [
0,
1,
0
]
},
"inputs": {
"start": {
"connections": [
{
"node": "onPost",
"output": "result",
"data": {}
}
]
},
"end": {
"connections": [
{
"node": "onCrate",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"gap": {
"id": "gap",
"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": "#ff6a00",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 5,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": true,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
858
]
},
"drawPost": {
"id": "drawPost",
"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": "post",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"drawCrate": {
"id": "drawCrate",
"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": "crate",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
334
]
},
"drawLink": {
"id": "drawLink",
"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": "link",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "gap",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
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": [
12,
18,
-20
],
"lookAt": [
3.5,
4.5,
1
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2140,
922
]
}
},
"modules": {}
}

Clashes​

analysis.clashes.betweenShapes checks a list of parts against each other and names every pair that overlaps, touches or comes within a clearance, with their distance and the volume two solids share. selfIntersections finds a shape that cuts through itself, and facesWithin the faces of one shape that come within a clearance of the faces of another.

Here two blocks overlap. The clash names the pair by their places in the list, 0 and 1, with a distance of 0 and the volume they share:

Do two parts collide?
Bitbybit Platform

Do two parts collide? in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"first": {
"id": "first",
"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": 3,
"height": 3,
"center": [
0,
0,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"second": {
"id": "second",
"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": 3,
"height": 3,
"center": [
2,
1,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
426
]
},
"parts": {
"id": "parts",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "first",
"output": "result",
"data": {}
},
{
"node": "second",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"clashes": {
"id": "clashes",
"name": "bitbybit.occt.analysis.clashes.betweenShapes",
"customName": "clashes between shapes",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"clearance": 0,
"prefilter": true
},
"inputs": {
"shapes": {
"connections": [
{
"node": "parts",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
}
},
"modules": {}
}

In TypeScript the clashes are written to the console. In Rete, point at the output of clashes between shapes to read them.

Curves and surfaces​

analysis.curves and analysis.surfaces read the geometry under edges and faces: the kind of curve or surface, curvature along a curve or at points on a surface, the closest points, where a curve crosses a face or another curve, and the kinks where a wire turns sharply. They are the tools for checking smoothness and for placing things exactly on a surface.

The viewer can show curvature on the model itself. Set surfaceAnalysis in the draw options and the faces take the colours of what it measures, from blue at analysisMin through green to red at analysisMax. It takes gaussian, mean, maxCurvature, minCurvature, minRadius and draftAngle. Here the Gaussian curvature shows where the vase bulges in red and where its waist curves like a saddle in blue, and its flat ends stay green:

A vase coloured by its curvature
Bitbybit Platform

A vase coloured by its curvature in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"foot": {
"id": "foot",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 3,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"belly": {
"id": "belly",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 5.2,
"center": [
0,
3,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
334
]
},
"waist": {
"id": "waist",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 3.4,
"center": [
0,
7,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
628
]
},
"neck": {
"id": "neck",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 2.2,
"center": [
0,
10,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
922
]
},
"lip": {
"id": "lip",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 3.8,
"center": [
0,
14,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
1216
]
},
"rings": {
"id": "rings",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "foot",
"output": "result",
"data": {}
},
{
"node": "belly",
"output": "result",
"data": {}
},
{
"node": "waist",
"output": "result",
"data": {}
},
{
"node": "neck",
"output": "result",
"data": {}
},
{
"node": "lip",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"vase": {
"id": "vase",
"name": "bitbybit.occt.operations.loft",
"customName": "loft",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"makeSolid": true
},
"inputs": {
"shapes": {
"connections": [
{
"node": "rings",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"curvature": {
"id": "curvature",
"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": false,
"drawFaces": true,
"drawVertices": false,
"precision": 0.02,
"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": "gaussian",
"draftDirection": [
0,
1,
0
],
"analysisMin": -0.06,
"analysisMax": 0.06
},
"inputs": {},
"position": [
40,
1510
]
},
"drawVase": {
"id": "drawVase",
"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": "vase",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "curvature",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
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": [
14,
16,
-24
],
"lookAt": [
0,
7,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
1300,
340
]
}
},
"modules": {}
}

For a curve, analysis.curves.curvatureComb draws a tooth at each sample, as long as the curve is sharp there. A smooth outline along the teeth means a smooth curve, and the point where the teeth change sides is where the curve changes its bend:

A curve and its curvature comb
Bitbybit Platform

A curve and its curvature comb in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"points": {
"id": "points",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[[0, 0, 0], [4, 0, 3], [8, 0, -1], [12, 0, 2], [16, 0, 0]]"
},
"inputs": {},
"position": [
40,
40
]
},
"curve": {
"id": "curve",
"name": "bitbybit.occt.shapes.wire.interpolatePoints",
"customName": "interpolate points",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"periodic": false,
"tolerance": 1e-7,
"parametrization": "chordLength"
},
"inputs": {
"points": {
"connections": [
{
"node": "points",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"comb": {
"id": "comb",
"name": "bitbybit.occt.analysis.curves.curvatureComb",
"customName": "curvature comb",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"samples": 120,
"scale": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "curve",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"line": {
"id": "line",
"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": 4,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": true,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
280
]
},
"drawCurve": {
"id": "drawCurve",
"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": "curve",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "line",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
8,
30,
-1
],
"lookAt": [
8,
0,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
1300,
340
]
}
},
"modules": {}
}

analysis.measure.minCurvatureRadius finds the tightest bend of a whole shape. With concaveOnly it looks only at inside bends, which answers a question every machinist asks: what is the largest cutter that reaches this corner? Here the answer is 0.75, and a cutter of that radius sits in the corner of the pocket. On sharp inside corners there is no bend to measure, so radius comes back empty:

The largest cutter that fits a pocket
Bitbybit Platform

The largest cutter that fits a pocket in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"stock": {
"id": "stock",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 12,
"length": 12,
"height": 5,
"center": [
0,
2.5,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"pocket": {
"id": "pocket",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 8,
"length": 8,
"height": 5,
"center": [
0,
4,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
426
]
},
"tools": {
"id": "tools",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "pocket",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"cut": {
"id": "cut",
"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": "stock",
"output": "result",
"data": {}
}
]
},
"shapes": {
"connections": [
{
"node": "tools",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"inside": {
"id": "inside",
"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": "cut",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"corners": {
"id": "corners",
"name": "bitbybit.occt.select.edges.along",
"customName": "edges along",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"angle": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "cut",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "inside",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"part": {
"id": "part",
"name": "bitbybit.occt.fillets.filletEdges",
"customName": "fillet edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 0.75
},
"inputs": {
"shape": {
"connections": [
{
"node": "cut",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "corners",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"tightest": {
"id": "tightest",
"name": "bitbybit.occt.analysis.measure.minCurvatureRadius",
"customName": "min curvature radius",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"samples": 16,
"concaveOnly": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"tightestRadius": {
"id": "tightestRadius",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "radius"
},
"inputs": {
"json": {
"connections": [
{
"node": "tightest",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
40
]
},
"cutter": {
"id": "cutter",
"name": "bitbybit.occt.shapes.solid.createCylinder",
"customName": "cylinder",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 1,
"height": 6,
"center": [
3.25,
1,
3.25
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {
"radius": {
"connections": [
{
"node": "tightestRadius",
"output": "result",
"data": {}
}
]
}
},
"position": [
3400,
40
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
280
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
812
]
},
"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": 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,
1842
]
},
"drawPart": {
"id": "drawPart",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "part",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
3820,
40
]
},
"drawCutter": {
"id": "drawCutter",
"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": "cutter",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "bright",
"output": "result",
"data": {}
}
]
}
},
"position": [
3820,
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": [
9,
26,
-22
],
"lookAt": [
0,
2,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
3820,
628
]
}
},
"modules": {}
}

Every analysis​

FunctionWhat it does
clashes.betweenShapesFinds every pair among a list of shapes that overlap, touch or come within a clearance of each other, such as colliding parts.
clashes.facesWithinFinds the faces of one shape that come within a clearance of faces of another, each pair measured exactly.
clashes.selfIntersectionsFinds the pairs of faces of one shape that cross each other anywhere but along an edge they share.
curves.closestPointsFinds the point of an edge or a wire nearest each given point, with where it lies along the curve.
curves.curvatureCombDraws a curvature comb along an edge or a wire: teeth standing on the curve, as long as the curvature there, pointing away from its center.
curves.curvaturesAtLengthsReads how an edge or a wire bends at places given as lengths along it from its start, in model units.
curves.curvaturesAtParamsReads how an edge or a wire bends at places given as fractions from 0 at its start to 1 at its end.
curves.curveTypeTells what kind of curve an edge runs along: a line, a circle, an ellipse, a hyperbola, a parabola, a Bezier curve, a B-spline, an offset curve or another kind.
curves.extremesAlongFinds the highest and lowest points of an edge or a wire along a direction, such as the crests of a wave.
curves.intersectCurvesFinds where two edges or wires cross or touch, with the parameter and the edge of each point on both curves.
curves.intersectCurveWithFaceFinds where an edge or a wire passes through a face or lies on it, within the face's edges.
curves.kinksFinds the corners of an edge or a wire where the tangent turns by more than an angle, such as the corners of a polyline.
measure.angleBetweenMeasures the angle in degrees between two faces or edges where they come nearest each other.
measure.boundingBoxInFrameFinds the box that just holds a shape with its sides along a frame's axes instead of the world's.
measure.dihedralAngleMeasures the angle through the material between the two faces that meet at an edge.
measure.extremaFinds every nearest pair of points between two shapes, with the vertex, edge or face each point lies on and where on it.
measure.minCurvatureRadiusFinds the tightest bend of a shape, sampled over its faces and edges, and where it is.
measure.orientedBoundingBoxFinds the smallest box that fits around a shape, turned to follow it rather than the axes: a frame at the box's centre, its direction along the longest side and its normal along the shortest, with half the box's size along each.
measure.principalFrameFinds a shape's principal axes of inertia as a frame at its centre of mass: the direction is the axis it turns about most easily, the normal the one it resists most.
measure.tightBoundingBoxFinds the box lined up with the axes that just holds a shape's exact geometry.
signaturesDescribes every face and edge of a shape in one pass: each face's surface kind, area, centre, outward normal and box, and each edge's curve kind, length, midpoint and direction there.
surfaces.closestPointsFinds the point of a face nearest each given point, with its (u, v) and the face's normal there.
surfaces.curvaturesOnUVsReads how a face bends at (u, v) pairs: its largest and smallest curvature with their directions, their mean and product, and the normal.
surfaces.surfaceTypeTells what kind of surface a face lies on, such as a plane, a cylinder or a B-spline.