Linear Dimension
Linear dimensions measure and display the distance between two points in your 3D models. They're essential for technical drawings, manufacturing documentation, and design verification. Bitbybit's linear dimension tools help you create professional dimensional annotations that automatically update when your geometry changes.
Understanding Linear Dimensions
Linear dimensions measure straight-line distances between two points and display them with dimension lines, extension lines, and text labels. The system automatically calculates distances and formats the display. Key components include start and end points that define what's being measured, a direction vector that controls dimension line orientation, offset distance that sets how far the dimension appears from geometry, and label customization for text formatting, units, and positioning.
- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"a1b2c3d4e5f6g7h8": {
"id": "a1b2c3d4e5f6g7h8",
"name": "bitbybit.point.pointXYZ",
"customName": "start point",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -5,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
7.482591014780979,
58.460446270459585
]
},
"b2c3d4e5f6g7h8i9": {
"id": "b2c3d4e5f6g7h8i9",
"name": "bitbybit.point.pointXYZ",
"customName": "end point",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 5,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
10.061801916378727,
411.1480178836501
]
},
"c3d4e5f6g7h8i9j0": {
"id": "c3d4e5f6g7h8i9j0",
"name": "bitbybit.occt.dimensions.simpleLinearLengthDimension",
"customName": "linear dimension",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"offsetFromPoints": 0.3,
"crossingSize": 0.2,
"decimalPlaces": 1,
"labelSuffix": "cm",
"labelSize": 0.4,
"labelOffset": 0.8,
"labelRotation": 0
},
"inputs": {
"start": {
"connections": [
{
"node": "a1b2c3d4e5f6g7h8",
"output": "result",
"data": {}
}
]
},
"end": {
"connections": [
{
"node": "b2c3d4e5f6g7h8i9",
"output": "result",
"data": {}
}
]
},
"direction": {
"connections": [
{
"node": "d4e5f6g7h8i9j0k1",
"output": "result",
"data": {}
}
]
}
},
"position": [
570.2450515032658,
366.4814859166162
]
},
"d4e5f6g7h8i9j0k1": {
"id": "d4e5f6g7h8i9j0k1",
"name": "bitbybit.vector.vectorXYZ",
"customName": "direction",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 1,
"z": 0
},
"inputs": {},
"position": [
7.392071876593093,
765.5571470674718
]
}
}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="*cM!)eZ`SWWP:O-jO1rl">point1</variable><variable id="US%1a6-s%$IBw4-r;O{0">point2</variable></variables><block type="variables_set" id="|Um)Ma@j-zCu1;*pErp@" x="-183" y="-512"><field name="VAR" id="*cM!)eZ`SWWP:O-jO1rl">point1</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="start_point"><value name="X"><block type="math_number" id="start_x"><field name="NUM">-5</field></block></value><value name="Y"><block type="math_number" id="start_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="start_z"><field name="NUM">0</field></block></value></block></value><next><block type="variables_set" id="#|sI0xp23tki-Pabi`D("><field name="VAR" id="US%1a6-s%$IBw4-r;O{0">point2</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="end_point"><value name="X"><block type="math_number" id="end_x"><field name="NUM">5</field></block></value><value name="Y"><block type="math_number" id="end_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="end_z"><field name="NUM">0</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_start_point"><value name="Entity"><block type="variables_get" id="QHE8Fh67w|UfRaLzzv3y"><field name="VAR" id="*cM!)eZ`SWWP:O-jO1rl">point1</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="6HV![{OF#4i9K02h(Jx1"><value name="Entity"><block type="variables_get" id="kJ4uY7_d!)7P);l3dwvz"><field name="VAR" id="US%1a6-s%$IBw4-r;O{0">point2</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_dimension"><value name="Entity"><block type="bitbybit.occt.dimensions.simpleLinearLengthDimension" id="simple_dimension"><value name="Start"><block type="variables_get" id="vX*a7aZ)Ql,pt`$5u,g:"><field name="VAR" id="*cM!)eZ`SWWP:O-jO1rl">point1</field></block></value><value name="End"><block type="variables_get" id="1B:9BRffGKD1G`Nahv5/"><field name="VAR" id="US%1a6-s%$IBw4-r;O{0">point2</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="dimension_direction"><value name="X"><block type="math_number" id="dir_x"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="dir_y"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number" id="dir_z"><field name="NUM">0</field></block></value></block></value><value name="OffsetFromPoints"><block type="math_number" id="offset"><field name="NUM">0.3</field></block></value><value name="CrossingSize"><block type="math_number" id="crossing"><field name="NUM">0.2</field></block></value><value name="DecimalPlaces"><block type="math_number" id="decimals"><field name="NUM">1</field></block></value><value name="LabelSuffix"><block type="text" id="suffix"><field name="TEXT">cm</field></block></value><value name="LabelSize"><block type="math_number" id="label_size"><field name="NUM">0.4</field></block></value><value name="LabelOffset"><block type="math_number" id="label_offset"><field name="NUM">0.8</field></block></value><value name="LabelRotation"><block type="math_number" id="label_rotation"><field name="NUM">0</field></block></value></block></value></block></next></block></next></block></next></block></next></block></xml>
// Import the required DTO for linear dimensions
const { SimpleLinearLengthDimensionDto } = Bit.Inputs.OCCT;
type Point3 = Bit.Inputs.Base.Point3;
// Define the main function
const start = async () => {
// Define two points to measure between
const startPoint: Point3 = [-5, 0, 0];
const endPoint: Point3 = [5, 0, 0];
// Draw the points for reference
bitbybit.draw.drawAnyAsync({ entity: startPoint });
bitbybit.draw.drawAnyAsync({ entity: endPoint });
// Create a linear dimension between the points
const dimensionOptions = new SimpleLinearLengthDimensionDto();
dimensionOptions.start = startPoint;
dimensionOptions.end = endPoint;
dimensionOptions.direction = [0, 1, 0]; // Offset in Y direction
dimensionOptions.offsetFromPoints = 0.3;
dimensionOptions.crossingSize = 0.2;
dimensionOptions.decimalPlaces = 1;
dimensionOptions.labelSuffix = "cm";
dimensionOptions.labelSize = 0.4;
dimensionOptions.labelOffset = 0.8;
dimensionOptions.labelRotation = 0;
// Create and draw the dimension
const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension(dimensionOptions);
bitbybit.draw.drawAnyAsync({ entity: dimension });
}
// Execute the function
start();
Linear dimensions update automatically when geometry changes, keeping your documentation accurate throughout the design process.
- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"dcfbf00035f6f270": {
"id": "dcfbf00035f6f270",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 1,
"length": 2,
"height": 3,
"center": [
0,
0,
0
],
"originOnCenter": true
},
"inputs": {
"width": {
"connections": [
{
"node": "e395e40fe72bb29f",
"output": "result",
"data": {}
}
]
},
"length": {
"connections": [
{
"node": "cf35926fa7da0107",
"output": "result",
"data": {}
}
]
},
"height": {
"connections": [
{
"node": "89be13c13cf875d4",
"output": "result",
"data": {}
}
]
}
},
"position": [
112.23097226696606,
1136.6485136929464
]
},
"a50998866e606a16": {
"id": "a50998866e606a16",
"name": "bitbybit.occt.dimensions.simpleLinearLengthDimension",
"customName": "simple linear length dimension",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"offsetFromPoints": 0.2,
"crossingSize": 0.2,
"decimalPlaces": 2,
"labelSuffix": "(cm)",
"labelSize": 0.5,
"labelOffset": 1,
"labelRotation": 180
},
"inputs": {
"direction": {
"connections": [
{
"node": "a8cd9a592e3f396e",
"output": "result",
"data": {}
}
]
},
"end": {
"connections": [
{
"node": "dfb9c60b39554c59",
"output": "result",
"data": {}
}
]
},
"start": {
"connections": [
{
"node": "4a05d516f394b2b3",
"output": "result",
"data": {}
}
]
}
},
"position": [
1909.0084133845817,
299.37892151503667
]
},
"e395e40fe72bb29f": {
"id": "e395e40fe72bb29f",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 3,
"max": 20,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 13.2
},
"inputs": {},
"position": [
-539.2756926247216,
1038.0317791091716
]
},
"cf35926fa7da0107": {
"id": "cf35926fa7da0107",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 3,
"max": 20,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 9.1
},
"inputs": {},
"position": [
-539.5433497643697,
1217.9169016258388
]
},
"89be13c13cf875d4": {
"id": "89be13c13cf875d4",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 3,
"max": 20,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 5.3
},
"inputs": {},
"position": [
-537.7436456921906,
1393.942538395053
]
},
"5ada75e65ba6ebc2": {
"id": "5ada75e65ba6ebc2",
"name": "bitbybit.occt.shapes.edge.getEdges",
"customName": "get edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "dcfbf00035f6f270",
"output": "result",
"data": {}
}
]
}
},
"position": [
552.7465651913625,
1136.6093233537335
]
},
"e1bf81c7b59ab1e5": {
"id": "e1bf81c7b59ab1e5",
"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": "5ada75e65ba6ebc2",
"output": "result",
"data": {}
}
]
}
},
"position": [
1025.7402763297987,
255.28325420243362
]
},
"dfb9c60b39554c59": {
"id": "dfb9c60b39554c59",
"name": "bitbybit.occt.shapes.edge.endPointOnEdge",
"customName": "end point on edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "e1bf81c7b59ab1e5",
"output": "result",
"data": {}
}
]
}
},
"position": [
1444.415841817625,
347.835985513198
]
},
"4a05d516f394b2b3": {
"id": "4a05d516f394b2b3",
"name": "bitbybit.occt.shapes.edge.startPointOnEdge",
"customName": "start point on edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "e1bf81c7b59ab1e5",
"output": "result",
"data": {}
}
]
}
},
"position": [
1443.2079827600558,
75.86638080483235
]
},
"a8cd9a592e3f396e": {
"id": "a8cd9a592e3f396e",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -2,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
1447.745802643203,
625.9643954581835
]
},
"416af15fe8d8d993": {
"id": "416af15fe8d8d993",
"name": "bitbybit.occt.dimensions.simpleLinearLengthDimension",
"customName": "simple linear length dimension",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"offsetFromPoints": 0.2,
"crossingSize": 0.2,
"decimalPlaces": 2,
"labelSuffix": "(cm)",
"labelSize": 0.5,
"labelOffset": 1,
"labelRotation": 180
},
"inputs": {
"start": {
"connections": [
{
"node": "6b445077c0cfd637",
"output": "result",
"data": {}
}
]
},
"end": {
"connections": [
{
"node": "0f1168255610661f",
"output": "result",
"data": {}
}
]
},
"direction": {
"connections": [
{
"node": "604ea90b0e453027",
"output": "result",
"data": {}
}
]
}
},
"position": [
1907.592259564266,
1173.4850679811507
]
},
"cf2a8c8ff04e541f": {
"id": "cf2a8c8ff04e541f",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 10,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "5ada75e65ba6ebc2",
"output": "result",
"data": {}
}
]
}
},
"position": [
1015.5114277400813,
1135.7473238575687
]
},
"6b445077c0cfd637": {
"id": "6b445077c0cfd637",
"name": "bitbybit.occt.shapes.edge.startPointOnEdge",
"customName": "start point on edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "cf2a8c8ff04e541f",
"output": "result",
"data": {}
}
]
}
},
"position": [
1444.9282057300006,
983.7404716418204
]
},
"0f1168255610661f": {
"id": "0f1168255610661f",
"name": "bitbybit.occt.shapes.edge.endPointOnEdge",
"customName": "end point on edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "cf2a8c8ff04e541f",
"output": "result",
"data": {}
}
]
}
},
"position": [
1444.0147432438412,
1268.4539427754107
]
},
"604ea90b0e453027": {
"id": "604ea90b0e453027",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 0,
"z": -2
},
"inputs": {},
"position": [
1446.0652318544353,
1555.9370725872095
]
},
"4bbf4c14bd27cf5b": {
"id": "4bbf4c14bd27cf5b",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 7,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "5ada75e65ba6ebc2",
"output": "result",
"data": {}
}
]
}
},
"position": [
1079.197873376024,
1954.9602438497295
]
},
"4a5356fecf682988": {
"id": "4a5356fecf682988",
"name": "bitbybit.occt.shapes.edge.startPointOnEdge",
"customName": "start point on edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "4bbf4c14bd27cf5b",
"output": "result",
"data": {}
}
]
}
},
"position": [
1458.6302794417766,
1937.2311996921744
]
},
"3f12bd185760c15f": {
"id": "3f12bd185760c15f",
"name": "bitbybit.occt.shapes.edge.endPointOnEdge",
"customName": "end point on edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "4bbf4c14bd27cf5b",
"output": "result",
"data": {}
}
]
}
},
"position": [
1461.4668226043054,
2215.882252233176
]
},
"75b1de11bd64e281": {
"id": "75b1de11bd64e281",
"name": "bitbybit.occt.dimensions.simpleLinearLengthDimension",
"customName": "simple linear length dimension",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"offsetFromPoints": 0.2,
"crossingSize": 0.2,
"decimalPlaces": 2,
"labelSuffix": "(cm)",
"labelSize": 0.5,
"labelOffset": 1,
"labelRotation": 180
},
"inputs": {
"direction": {
"connections": [
{
"node": "f8041d58c74f0ff7",
"output": "result",
"data": {}
}
]
},
"end": {
"connections": [
{
"node": "4a5356fecf682988",
"output": "result",
"data": {}
}
]
},
"start": {
"connections": [
{
"node": "3f12bd185760c15f",
"output": "result",
"data": {}
}
]
}
},
"position": [
1921.9238354315291,
2017.1968640904734
]
},
"f8041d58c74f0ff7": {
"id": "f8041d58c74f0ff7",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 2,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
1465.547647057041,
2506.436376081527
]
}
}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="4qUOp?[B?ej*|hep`nLw">width</variable><variable id="#(]xRSX!=Ph5`hC[1Qof">length</variable><variable id="Im#epm=~)2D+VHh2)1*#">height</variable><variable id="MxbZn3/s8(#4PSsQ+rs`">box</variable><variable id="~`REBx}LkVw.nfmM2h^]">firstEdge</variable><variable id="v]oyAcKUoJGnBNhT[4IO">secondEdge</variable><variable id="%Bb]@:xfuD3Up~k!/a%l">thirdEdge</variable></variables><block type="variables_set" id=")8)iM%0SzgiWwrUs~C`^" x="229" y="-865"><field name="VAR" id="4qUOp?[B?ej*|hep`nLw">width</field><value name="VALUE"><block type="math_number" id="box_width"><field name="NUM">13.2</field></block></value><next><block type="variables_set" id="Mn,zu#=-X*|Vx=]?S,tj"><field name="VAR" id="#(]xRSX!=Ph5`hC[1Qof">length</field><value name="VALUE"><block type="math_number" id="box_length"><field name="NUM">9.1</field></block></value><next><block type="variables_set" id="J)1l$0RK,e=`SHaD[fr$"><field name="VAR" id="Im#epm=~)2D+VHh2)1*#">height</field><value name="VALUE"><block type="math_number" id="box_height"><field name="NUM">5.3</field></block></value><next><block type="variables_set" id="VTp5pN7(nqToY%WX{T`2"><field name="VAR" id="MxbZn3/s8(#4PSsQ+rs`">box</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createBox" id="create_box"><value name="Width"><block type="variables_get" id="ck9]E@HpX9D5e7yKsQPX"><field name="VAR" id="4qUOp?[B?ej*|hep`nLw">width</field></block></value><value name="Length"><block type="variables_get" id="1Q3S8wHzR#Lc=[Wok,rW"><field name="VAR" id="#(]xRSX!=Ph5`hC[1Qof">length</field></block></value><value name="Height"><block type="variables_get" id="#*IS85STA`iR3jm[.kwT"><field name="VAR" id="Im#epm=~)2D+VHh2)1*#">height</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ" id="box_center"><value name="X"><block type="math_number" id="center_x"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="center_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="center_z"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean" id="origin_center"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="variables_set" id=".Q^J:NR,nd]0;_w8@S#5"><field name="VAR" id="~`REBx}LkVw.nfmM2h^]">firstEdge</field><value name="VALUE"><block type="bitbybit.occt.shapes.edge.getEdge" id="T}X=W#KK3+j6h#]#|S{k"><value name="Shape"><block type="variables_get" id="5[Sobk``)CgdMITK3}G%"><field name="VAR" id="MxbZn3/s8(#4PSsQ+rs`">box</field></block></value><value name="Index"><block type="math_number" id=":.DN_:KtvAKxxMWH_fT6"><field name="NUM">1</field></block></value></block></value><next><block type="variables_set" id="d3HyYJ2}+s,qCC3W_TKu"><field name="VAR" id="v]oyAcKUoJGnBNhT[4IO">secondEdge</field><value name="VALUE"><block type="bitbybit.occt.shapes.edge.getEdge" id="b_yMCP:QDIiyb25;Q8_9"><value name="Shape"><block type="variables_get" id=")[^+K,Pt%}d8udJm|=8g"><field name="VAR" id="MxbZn3/s8(#4PSsQ+rs`">box</field></block></value><value name="Index"><block type="math_number" id=".B.66MXJI*?x*t@J8;.#"><field name="NUM">8</field></block></value></block></value><next><block type="variables_set" id="{mp4.f)/;sG21J`NuuMw"><field name="VAR" id="%Bb]@:xfuD3Up~k!/a%l">thirdEdge</field><value name="VALUE"><block type="bitbybit.occt.shapes.edge.getEdge" id="0`**ZT!WWUwENXf-Y?59"><value name="Shape"><block type="variables_get" id="IfDBWsB^I;!_1shQ2}ga"><field name="VAR" id="MxbZn3/s8(#4PSsQ+rs`">box</field></block></value><value name="Index"><block type="math_number" id="h5dL:z4y0vBb@zwE}RM+"><field name="NUM">11</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_width_dimension"><value name="Entity"><block type="bitbybit.occt.dimensions.simpleLinearLengthDimension" id="width_dimension"><value name="Start"><block type="bitbybit.occt.shapes.edge.startPointOnEdge" id="width_start_point"><value name="Shape"><block type="variables_get" id=";;tz5U;12sL/aPJCFIdD"><field name="VAR" id="~`REBx}LkVw.nfmM2h^]">firstEdge</field></block></value></block></value><value name="End"><block type="bitbybit.occt.shapes.edge.endPointOnEdge" id="width_end_point"><value name="Shape"><block type="variables_get" id="%.TBDC-)++/2r-vGb(/#"><field name="VAR" id="~`REBx}LkVw.nfmM2h^]">firstEdge</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="width_direction"><value name="X"><block type="math_number" id="width_dir_x"><field name="NUM">-2</field></block></value><value name="Y"><block type="math_number" id="width_dir_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="width_dir_z"><field name="NUM">0</field></block></value></block></value><value name="OffsetFromPoints"><block type="math_number" id="width_offset"><field name="NUM">0.2</field></block></value><value name="CrossingSize"><block type="math_number" id="width_crossing"><field name="NUM">0.2</field></block></value><value name="DecimalPlaces"><block type="math_number" id="width_decimals"><field name="NUM">2</field></block></value><value name="LabelSuffix"><block type="text" id="width_suffix"><field name="TEXT">(cm)</field></block></value><value name="LabelSize"><block type="math_number" id="width_label_size"><field name="NUM">0.5</field></block></value><value name="LabelOffset"><block type="math_number" id="width_label_offset"><field name="NUM">1</field></block></value><value name="LabelRotation"><block type="math_number" id="width_label_rotation"><field name="NUM">180</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_depth_dimension"><value name="Entity"><block type="bitbybit.occt.dimensions.simpleLinearLengthDimension" id="depth_dimension"><value name="Start"><block type="bitbybit.occt.shapes.edge.endPointOnEdge" id="depth_start_point"><value name="Shape"><block type="variables_get" id="y`A*+3xwD(M-8%eu_lh*"><field name="VAR" id="v]oyAcKUoJGnBNhT[4IO">secondEdge</field></block></value></block></value><value name="End"><block type="bitbybit.occt.shapes.edge.startPointOnEdge" id="depth_end_point"><value name="Shape"><block type="variables_get" id="^0tiPv3-M+E6v2g6Jp$b"><field name="VAR" id="v]oyAcKUoJGnBNhT[4IO">secondEdge</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="depth_direction"><value name="X"><block type="math_number" id="depth_dir_x"><field name="NUM">2</field></block></value><value name="Y"><block type="math_number" id="depth_dir_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="depth_dir_z"><field name="NUM">0</field></block></value></block></value><value name="OffsetFromPoints"><block type="math_number" id="depth_offset"><field name="NUM">0.2</field></block></value><value name="CrossingSize"><block type="math_number" id="depth_crossing"><field name="NUM">0.2</field></block></value><value name="DecimalPlaces"><block type="math_number" id="depth_decimals"><field name="NUM">2</field></block></value><value name="LabelSuffix"><block type="text" id="depth_suffix"><field name="TEXT">(cm)</field></block></value><value name="LabelSize"><block type="math_number" id="depth_label_size"><field name="NUM">0.5</field></block></value><value name="LabelOffset"><block type="math_number" id="depth_label_offset"><field name="NUM">1</field></block></value><value name="LabelRotation"><block type="math_number" id="depth_label_rotation"><field name="NUM">180</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="mQ)~!!iu`hlLhT,R*~pi"><value name="Entity"><block type="bitbybit.occt.dimensions.simpleLinearLengthDimension" id="CoBQY:WoCad3?znvdFV_"><value name="Start"><block type="bitbybit.occt.shapes.edge.startPointOnEdge" id="QLsC99+-LM4e[YkfEVD0"><value name="Shape"><block type="variables_get" id="q4w1e2G$?;7]En:EEo%P"><field name="VAR" id="%Bb]@:xfuD3Up~k!/a%l">thirdEdge</field></block></value></block></value><value name="End"><block type="bitbybit.occt.shapes.edge.endPointOnEdge" id="Ibp^JHb=QjQ(kS}1WMv3"><value name="Shape"><block type="variables_get" id="62u!M6uv8(/CICK[$YWV"><field name="VAR" id="%Bb]@:xfuD3Up~k!/a%l">thirdEdge</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="^k$|%B*lX1N7nbC+}7-0"><value name="X"><block type="math_number" id="*oif=eIM305}f6E9Q/S?"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="$fbjNrq(p18K]bpH~t1+"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="qRVvX{$%h)UoM`(S)40s"><field name="NUM">-2</field></block></value></block></value><value name="OffsetFromPoints"><block type="math_number" id=";T*szr4mQe]U}wKK6BwJ"><field name="NUM">0.2</field></block></value><value name="CrossingSize"><block type="math_number" id="T8=hej#J9*@?8!Ig@^Yp"><field name="NUM">0.2</field></block></value><value name="DecimalPlaces"><block type="math_number" id="*F.cO,QrPjQ0^iT++xR!"><field name="NUM">2</field></block></value><value name="LabelSuffix"><block type="text" id="IEpA8wB0W;JRv%S9_k+2"><field name="TEXT">(cm)</field></block></value><value name="LabelSize"><block type="math_number" id="hnLV]]4a3AuYb:la=WSD"><field name="NUM">0.5</field></block></value><value name="LabelOffset"><block type="math_number" id="[QDrYS`!tmGJOJ)9aE{4"><field name="NUM">1</field></block></value><value name="LabelRotation"><block type="math_number" id="|RtTuQrZz2VTv/,UiL7h"><field name="NUM">180</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="N#BN;_{~XxvBESK-Q%_V"><value name="Entity"><block type="variables_get" id="8Sxo@k60McvQsUp}2x))"><field name="VAR" id="MxbZn3/s8(#4PSsQ+rs`">box</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
// Import required DTOs for creating shapes and dimensions
const { BoxDto, SimpleLinearLengthDimensionDto } = Bit.Inputs.OCCT;
// Import types for type safety
type TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;
type TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;
// Get access to OCCT modules
const { shapes, dimensions } = bitbybit.occt;
const { solid, edge } = shapes;
// Define the main function to create a box with linear dimensions
const start = async () => {
// Create a box with specific dimensions
const boxOptions = new BoxDto();
boxOptions.width = 13.2;
boxOptions.length = 9.1;
boxOptions.height = 5.3;
boxOptions.center = [0, 0, 0];
boxOptions.originOnCenter = true;
const box = await solid.createBox(boxOptions);
// Draw the box first
bitbybit.draw.drawAnyAsync({ entity: box });
// Get all edges from the box for dimension measurements
const edges = await edge.getEdges({ shape: box });
// Create width dimension (measuring edge 0)
const widthEdge = edges[0];
const widthStartPoint = await edge.startPointOnEdge({ shape: widthEdge });
const widthEndPoint = await edge.endPointOnEdge({ shape: widthEdge });
const widthDimensionOptions = new SimpleLinearLengthDimensionDto();
widthDimensionOptions.start = widthStartPoint;
widthDimensionOptions.end = widthEndPoint;
widthDimensionOptions.direction = [-2, 0, 0]; // Offset to the left
widthDimensionOptions.offsetFromPoints = 0.2;
widthDimensionOptions.crossingSize = 0.2;
widthDimensionOptions.decimalPlaces = 2;
widthDimensionOptions.labelSuffix = "(cm)";
widthDimensionOptions.labelSize = 0.5;
widthDimensionOptions.labelOffset = 1;
widthDimensionOptions.labelRotation = 180;
const widthDimension = await dimensions.simpleLinearLengthDimension(widthDimensionOptions);
bitbybit.draw.drawAnyAsync({ entity: widthDimension });
// Create height dimension (measuring edge 10)
const heightEdge = edges[10];
const heightStartPoint = await edge.startPointOnEdge({ shape: heightEdge });
const heightEndPoint = await edge.endPointOnEdge({ shape: heightEdge });
const heightDimensionOptions = new SimpleLinearLengthDimensionDto();
heightDimensionOptions.start = heightStartPoint;
heightDimensionOptions.end = heightEndPoint;
heightDimensionOptions.direction = [0, 0, -2]; // Offset toward the back
heightDimensionOptions.offsetFromPoints = 0.2;
heightDimensionOptions.crossingSize = 0.2;
heightDimensionOptions.decimalPlaces = 2;
heightDimensionOptions.labelSuffix = "(cm)";
heightDimensionOptions.labelSize = 0.5;
heightDimensionOptions.labelOffset = 1;
heightDimensionOptions.labelRotation = 180;
const heightDimension = await dimensions.simpleLinearLengthDimension(heightDimensionOptions);
bitbybit.draw.drawAnyAsync({ entity: heightDimension });
// Create depth dimension (measuring edge 7)
const depthEdge = edges[7];
const depthStartPoint = await edge.endPointOnEdge({ shape: depthEdge });
const depthEndPoint = await edge.startPointOnEdge({ shape: depthEdge });
const depthDimensionOptions = new SimpleLinearLengthDimensionDto();
depthDimensionOptions.start = depthStartPoint;
depthDimensionOptions.end = depthEndPoint;
depthDimensionOptions.direction = [2, 0, 0]; // Offset to the right
depthDimensionOptions.offsetFromPoints = 0.2;
depthDimensionOptions.crossingSize = 0.2;
depthDimensionOptions.decimalPlaces = 2;
depthDimensionOptions.labelSuffix = "(cm)";
depthDimensionOptions.labelSize = 0.5;
depthDimensionOptions.labelOffset = 1;
depthDimensionOptions.labelRotation = 180;
const depthDimension = await dimensions.simpleLinearLengthDimension(depthDimensionOptions);
bitbybit.draw.drawAnyAsync({ entity: depthDimension });
}
// Execute the function
start();
Dimension Properties and Customization
Linear dimensions offer extensive customization options to match your documentation standards.
Essential Parameters
Start and End Points define the geometry being measured. You can use points directly or extract them from edges and vertices.
Direction Vector controls where the dimension line appears relative to the measured geometry. Positive vectors move the dimension in that direction, negative values move it opposite.
Offset Distance controls how far the dimension line appears from the measured points. This helps stack multiple dimensions without overlap.
Crossing Size determines the length of extension lines connecting measured points to the dimension line.
Label Formatting
Decimal Places controls measurement precision. Engineering drawings typically use 1-3 decimal places.
Label Suffix adds units or context like "(mm)", "(cm)", "(in)", or "(TYP)" for typical dimensions.
Label Size controls text size, scaled for your model and viewing distance.
Label Offset positions text relative to the dimension line. Positive values move text away from geometry.
Label Rotation rotates dimension text for better readability on angled or vertical dimensions.
Best Practices
Linear dimensions serve critical functions in design and manufacturing workflows. They provide precise measurements for manufacturing and quality control, help verify designs meet specifications, guide manufacturing processes, and communicate assembly requirements.
Placement Guidelines
Place dimensions to avoid interfering with geometry or other annotations. Group related dimensions together and organize them hierarchically with primary dimensions most prominent. Maintain consistent formatting throughout your documentation. Choose direction vectors that place dimensions where viewers naturally expect to find them.
Why Linear Dimensions Matter
Linear dimensions bridge the gap between design intent and manufacturing reality. They provide a common language in collaborative environments, eliminate manual measurements, and reduce errors in downstream processes. Parametric dimensions that update automatically save time and prevent outdated documentation. Mastering these tools improves design documentation quality and clarity, leading to reduced errors, faster manufacturing, and clearer communication.



