Skip to content

Latest commit

 

History

History
110 lines (84 loc) · 35.8 KB

File metadata and controls

110 lines (84 loc) · 35.8 KB
sidebar_position 1
title Linear Dimension
sidebar_label Linear Dimension
description Learn how to create and display linear dimensions for measuring distances in your 3D models with clear, professional annotations.
tags
code
occt
rete
blockly
typescript

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import BitByBitRenderCanvas from '@site/src/components/BitByBitRenderCanvas';

OCCT category icon with a stylized logo representation

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.

point1point2point1-500point2500point1point2point1point20100.30.21cm0.40.80","version":"0.20.7","type":"blockly"}} title="Simple linear dimension between two points" /> {\n // Define two points to measure between\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Draw the points for reference\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n\n // Create a linear dimension between the points\n const dimensionOptions = new SimpleLinearLengthDimensionDto();\n dimensionOptions.start = startPoint;\n dimensionOptions.end = endPoint;\n dimensionOptions.direction = [0, 1, 0]; // Offset in Y direction\n dimensionOptions.offsetFromPoints = 0.3;\n dimensionOptions.crossingSize = 0.2;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"cm\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.8;\n dimensionOptions.labelRotation = 0;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} title="Simple linear dimension between two points" /> Linear dimensions update automatically when geometry changes, keeping your documentation accurate throughout the design process. widthlengthheightboxfirstEdgesecondEdgethirdEdgewidth13.2length9.1height5.3boxwidthlengthheight000TRUEfirstEdgebox1secondEdgebox8thirdEdgebox11firstEdgefirstEdge-2000.20.22(cm)0.51180secondEdgesecondEdge2000.20.22(cm)0.51180thirdEdgethirdEdge00-20.20.22(cm)0.51180box","version":"0.20.7","type":"blockly"}} title="Linear dimensions applied on box" /> {\n // Create a box with specific dimensions\n const boxOptions = new BoxDto();\n boxOptions.width = 13.2;\n boxOptions.length = 9.1;\n boxOptions.height = 5.3;\n boxOptions.center = [0, 0, 0];\n boxOptions.originOnCenter = true;\n const box = await solid.createBox(boxOptions);\n\n // Draw the box first\n bitbybit.draw.drawAnyAsync({ entity: box });\n\n // Get all edges from the box for dimension measurements\n const edges = await edge.getEdges({ shape: box });\n\n // Create width dimension (measuring edge 0)\n const widthEdge = edges[0];\n const widthStartPoint = await edge.startPointOnEdge({ shape: widthEdge });\n const widthEndPoint = await edge.endPointOnEdge({ shape: widthEdge });\n\n const widthDimensionOptions = new SimpleLinearLengthDimensionDto();\n widthDimensionOptions.start = widthStartPoint;\n widthDimensionOptions.end = widthEndPoint;\n widthDimensionOptions.direction = [-2, 0, 0]; // Offset to the left\n widthDimensionOptions.offsetFromPoints = 0.2;\n widthDimensionOptions.crossingSize = 0.2;\n widthDimensionOptions.decimalPlaces = 2;\n widthDimensionOptions.labelSuffix = \"(cm)\";\n widthDimensionOptions.labelSize = 0.5;\n widthDimensionOptions.labelOffset = 1;\n widthDimensionOptions.labelRotation = 180;\n \n const widthDimension = await dimensions.simpleLinearLengthDimension(widthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: widthDimension });\n\n // Create height dimension (measuring edge 10)\n const heightEdge = edges[10];\n const heightStartPoint = await edge.startPointOnEdge({ shape: heightEdge });\n const heightEndPoint = await edge.endPointOnEdge({ shape: heightEdge });\n\n const heightDimensionOptions = new SimpleLinearLengthDimensionDto();\n heightDimensionOptions.start = heightStartPoint;\n heightDimensionOptions.end = heightEndPoint;\n heightDimensionOptions.direction = [0, 0, -2]; // Offset toward the back\n heightDimensionOptions.offsetFromPoints = 0.2;\n heightDimensionOptions.crossingSize = 0.2;\n heightDimensionOptions.decimalPlaces = 2;\n heightDimensionOptions.labelSuffix = \"(cm)\";\n heightDimensionOptions.labelSize = 0.5;\n heightDimensionOptions.labelOffset = 1;\n heightDimensionOptions.labelRotation = 180;\n \n const heightDimension = await dimensions.simpleLinearLengthDimension(heightDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: heightDimension });\n\n // Create depth dimension (measuring edge 7)\n const depthEdge = edges[7];\n const depthStartPoint = await edge.endPointOnEdge({ shape: depthEdge });\n const depthEndPoint = await edge.startPointOnEdge({ shape: depthEdge });\n\n const depthDimensionOptions = new SimpleLinearLengthDimensionDto();\n depthDimensionOptions.start = depthStartPoint;\n depthDimensionOptions.end = depthEndPoint;\n depthDimensionOptions.direction = [2, 0, 0]; // Offset to the right\n depthDimensionOptions.offsetFromPoints = 0.2;\n depthDimensionOptions.crossingSize = 0.2;\n depthDimensionOptions.decimalPlaces = 2;\n depthDimensionOptions.labelSuffix = \"(cm)\";\n depthDimensionOptions.labelSize = 0.5;\n depthDimensionOptions.labelOffset = 1;\n depthDimensionOptions.labelRotation = 180;\n \n const depthDimension = await dimensions.simpleLinearLengthDimension(depthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: depthDimension });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} title="Linear dimensions applied on box" />

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.