Skip to main content

Units, tolerance and precision

Numbers have no unit​

A length in Bitbybit is a plain number. The kernels do not know millimetres from metres: a box of width 4 is 4 of whatever unit you decide on. Pick one for a model and keep to it, and say which one when you export: a STEP file or a 3D printer will read the numbers in a unit of its own, often millimetres. Angles, wherever a function takes one, are in degrees.

The scene does not care either, but its camera, lights and shadows are set up for models of a few units to a few hundred. A model in millimetres of a whole building may need the camera moved further out and the shadows told how large the scene is.

Tolerance and precision are different things​

Two numbers decide how close is close enough, and they are easy to confuse:

  • Tolerance belongs to the kernel. It is how far apart two points may be and still count as the same point when OpenCascade joins edges, sews faces or checks a solid. The default suits most models; it matters when you import geometry from elsewhere or build at a very small or very large scale.
  • Precision belongs to drawing. A curved surface is drawn as triangles, and precision is how far those triangles may stray from the true surface. A smaller number gives smoother curves and more triangles.

Precision never changes the shape. The disc below is the same exact cylinder twice; the left one is drawn with a coarse precision of 0.5 and without its edges, so its round rim becomes a polygon, the right one with the default:

Bitbybit Platform

One disc, two precisions in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"coarse": {
"id": "coarse",
"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": 1,
"center": [
-3,
0,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
40,
40
]
},
"options": {
"id": "options",
"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,
"vertexSize": 0.03,
"drawEdges": false,
"drawFaces": true,
"drawVertices": false,
"precision": 0.5,
"angularDeflection": 0.5,
"relativeDeflection": false,
"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,
380
]
},
"draw": {
"id": "draw",
"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": "coarse",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "options",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"fine": {
"id": "fine",
"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": 1,
"center": [
3,
0,
0
],
"direction": [
0,
1,
0
],
"angle": 360,
"originOnCenter": false
},
"inputs": {},
"position": [
460,
520
]
}
},
"modules": {}
}

Measure the two and they give the same volume, and a STEP export of either is exactly round. Only the picture differs. Lower the precision when a model is large and curved and the drawing is slow; raise it for close-ups and renders.

The rest of the conventions​

Which way is up in each kernel, colours from 0 to 1, and the drawing defaults are on Conventions.