omdl  v0.9.5
OpenSCAD Mechanical Design Library
Dimension

Drafting dimension operations. More...

+ Collaboration diagram for Dimension:

Files

file  dimension.scad
 Drafting dimension operations.
 

Dimensioning

module draft_dim_leader (p=origin2d, v1=30, l1=draft_get_config("dim-leader-length"), v2, l2, h, t, ts, tp, tr, ta="center", bw=draft_get_config("dim-leader-box-weight"), bs=draft_get_config("dim-leader-box-style"), w=draft_get_config("dim-leader-weight"), s=draft_get_config("dim-leader-style"), a=draft_get_config("dim-leader-arrow"), o=draft_get_config("dim-offset"), cmh=draft_get_config("dim-cmh"), cmv=draft_get_config("dim-cmv"), window=false, layers=draft_get_config("layers-dim"))
 Construct a dimension leader line at a point. More...
 
module draft_dim_line (p1=origin2d, p2=origin2d, v1, v2, t, u, d=draft_get_config("dim-line-distance"), e=draft_get_config("dim-line-extension-length"), es=draft_get_config("dim-line-extension-style"), w=draft_get_config("dim-line-weight"), s=draft_get_config("dim-line-style"), a=draft_get_config("dim-line-arrow"), a1, a2, o=draft_get_config("dim-offset"), ts=draft_get_config("dim-text-size"), tp=draft_get_config("dim-text-place"), rm=draft_get_config("dim-round-mode"), cmh=draft_get_config("dim-cmh"), cmv=draft_get_config("dim-cmv"), layers=draft_get_config("layers-dim"))
 Construct a dimension line between two points. More...
 
module draft_dim_radius (c=origin2d, p, r=1, v, t, u, d=false, w=draft_get_config("dim-radius-weight"), s=draft_get_config("dim-radius-style"), a=draft_get_config("dim-radius-arrow"), a1, a2, o=draft_get_config("dim-offset"), ts=draft_get_config("dim-text-size"), tp=draft_get_config("dim-text-place"), rm=draft_get_config("dim-round-mode"), cmh=draft_get_config("dim-cmh"), cmv=draft_get_config("dim-cmv"), layers=draft_get_config("layers-dim"))
 Construct a radial dimension line. More...
 
module draft_dim_angle (c=origin2d, r=1, v1, v2, fn, cw=false, t, u, e=draft_get_config("dim-angle-extension-ratio"), es=draft_get_config("dim-angle-extension-style"), w=draft_get_config("dim-angle-weight"), s=draft_get_config("dim-angle-style"), a=draft_get_config("dim-angle-arrow"), a1, a2, o=draft_get_config("dim-offset"), ts=draft_get_config("dim-text-size"), tp=draft_get_config("dim-text-place"), rm=draft_get_config("dim-round-mode"), cmh=draft_get_config("dim-cmh"), cmv=draft_get_config("dim-cmv"), layers=draft_get_config("layers-dim"))
 Construct a angular dimension arc. More...
 
module draft_dim_center (c=origin2d, r, v=0, l=draft_get_config("dim-center-length"), e, es=draft_get_config("dim-angle-extension-style"), w=draft_get_config("dim-center-weight"), s=draft_get_config("dim-center-style"), layers=draft_get_config("layers-dim"))
 Construct a center mark dimension cross. More...
 

Detailed Description

Drafting dimension operations.

Function Documentation

◆ draft_dim_angle()

module draft_dim_angle ( = origin2d,
= 1,
v1  ,
v2  ,
fn  ,
cw  = false,
,
,
= draft_get_config("dim-angle-extension-ratio"),
es  = draft_get_config("dim-angle-extension-style"),
= draft_get_config("dim-angle-weight"),
= draft_get_config("dim-angle-style"),
= draft_get_config("dim-angle-arrow"),
a1  ,
a2  ,
= draft_get_config("dim-offset"),
ts  = draft_get_config("dim-text-size"),
tp  = draft_get_config("dim-text-place"),
rm  = draft_get_config("dim-round-mode"),
cmh  = draft_get_config("dim-cmh"),
cmv  = draft_get_config("dim-cmv"),
layers  = draft_get_config("layers-dim") 
)

Construct a angular dimension arc.

Parameters
c<point-2d> The arc center point.
r<decimal> The arc radius length.
v1<line-2d | decimal> The arc initial angle. A 2d line, vector, or decimal angle.
v2<line-2d | decimal> The arc terminal angle. A 2d line, vector, or decimal angle.
fn<integer> The number of facets.
cw<boolean> Sweep clockwise along arc from the head of vector v1 to the head of vector v2 when cw = true, and counter clockwise when cw = false.
t<string | string-list> A single or multi-line text string that overrides the measured angle.
u<string> The units for the measured angle. One of the predefined in Angle Units.
e<decimal | decimal-list-2> The extension line to radius ratio. A list [e1, e2] of decimals or a single decimal for (e1=e2).
es<integer | integer-list> The extension line style.
w<decimal> The arc weight.
s<integer | integer-list> The arc style.
a<integer | integer-list-5> The arrowheads style.
a1<integer | integer-list-5> The arrowhead 1 style override.
a2<integer | integer-list-5> The arrowhead 2 style override.
o<decimal> The dimension arc offset.
ts<decimal-list-3> A list of decimals that define the <width, line-height, heading-height> of the text.
tp<integer-list-4> The text alignment point. A list [tpx, tpy, tpa, tra] of decimals, where tpa is the text pivot angle and tra is the text rotation angle.
rm<integer> The measurement rounding mode. One of: 0=none, 1=round_d, and 2=round_s.
cmh<decimal> The horizontal width minimum unit cell size.
cmv<decimal> The vertical height minimum unit cell size.
layers<string-list> The List of drafting layer names.

Object example

draft_dim_angle

Definition at line 775 of file dimension.scad.

+ Here is the call graph for this function:

◆ draft_dim_center()

module draft_dim_center ( = origin2d,
,
= 0,
= draft_get_config("dim-center-length"),
,
es  = draft_get_config("dim-angle-extension-style"),
= draft_get_config("dim-center-weight"),
= draft_get_config("dim-center-style"),
layers  = draft_get_config("layers-dim") 
)

Construct a center mark dimension cross.

Parameters
c<point-2d> The center point.
r<decimal> A circular arc radius.
v<line-2d | decimal> The cross rotation angle. A 2d line, vector, or decimal angle.
l<decimal> The cross line length.
e<decimal | decimal-list-4> The length of the extension lines. A list [e1, e2, e3, e4] of decimals or a single decimal for (e1=e2=e3=e4).
es<integer | integer-list> The extension line style.
w<decimal> The line weight.
s<integer | integer-list> The line style.
layers<string-list> The List of drafting layer names.

Object example

draft_dim_center

Definition at line 948 of file dimension.scad.

+ Here is the call graph for this function:

◆ draft_dim_leader()

module draft_dim_leader ( = origin2d,
v1  = 30,
l1  = draft_get_config("dim-leader-length"),
v2  ,
l2  ,
,
,
ts  ,
tp  ,
tr  ,
ta  = "center",
bw  = draft_get_config("dim-leader-box-weight"),
bs  = draft_get_config("dim-leader-box-style"),
= draft_get_config("dim-leader-weight"),
= draft_get_config("dim-leader-style"),
= draft_get_config("dim-leader-arrow"),
= draft_get_config("dim-offset"),
cmh  = draft_get_config("dim-cmh"),
cmv  = draft_get_config("dim-cmv"),
window  = false,
layers  = draft_get_config("layers-dim") 
)

Construct a dimension leader line at a point.

Parameters
p<point-2d> The leader line point.
v1<line-2d | decimal> The leader line 1 angle. A 2d line, vector, or decimal angle.
l1<decimal> The leader line 1 length.
v2<line-2d | decimal> The leader line 2 angle. A 2d line, vector, or decimal angle.
l2<decimal> The leader line 2 length.
h<string> An optional text heading.
t<string | string-list> A single or multi-line text string.
ts<decimal-list-3> A list of decimals that define the <width, line-height, heading-height> of the text.
tp<integer-list-2> The text alignment point. A list [tpx, tpy] of decimals. Requires tr.
tr<decimal> The text rotation angle.
ta<string> The text horizontal alignment. One of: < "left" | "center" | "right" >.
bw<decimal> The boarder line weight.
bs<integer | integer-list> The boarder line style.
w<decimal> The line weight.
s<integer | integer-list> The line style.
a<integer | integer-list-5> The arrowhead style.
o<decimal> The leader point offset.
cmh<decimal> The horizontal width minimum unit cell size.
cmv<decimal> The vertical height minimum unit cell size.
window<boolean> Return text window rectangle.
layers<string-list> The List of drafting layer names.

Object example

draft_dim_leader

Definition at line 219 of file dimension.scad.

+ Here is the call graph for this function:

◆ draft_dim_line()

module draft_dim_line ( p1  = origin2d,
p2  = origin2d,
v1  ,
v2  ,
,
,
= draft_get_config("dim-line-distance"),
= draft_get_config("dim-line-extension-length"),
es  = draft_get_config("dim-line-extension-style"),
= draft_get_config("dim-line-weight"),
= draft_get_config("dim-line-style"),
= draft_get_config("dim-line-arrow"),
a1  ,
a2  ,
= draft_get_config("dim-offset"),
ts  = draft_get_config("dim-text-size"),
tp  = draft_get_config("dim-text-place"),
rm  = draft_get_config("dim-round-mode"),
cmh  = draft_get_config("dim-cmh"),
cmv  = draft_get_config("dim-cmv"),
layers  = draft_get_config("layers-dim") 
)

Construct a dimension line between two points.

Parameters
p1<point-2d> The dimension point 1.
p2<point-2d> The dimension point 2.
v1<line-2d | decimal> The point 1 extension line vector. A 2d line, vector, or decimal angle.
v2<line-2d | decimal> The point 2 extension line vector. A 2d line, vector, or decimal angle.
t<string | string-list> A single or multi-line text string that overrides the measured distance.
u<string> The units for the measured distance. One of the predefined in Length Units.
d<decimal | decimal-list-2> The minimum distance between the reference point and the start of the extension line. A list [d1, d2] of decimals or a single decimal for (d1=d2).
e<decimal | decimal-list-2> The length of the extension line. A list [e1, e2] of decimals or a single decimal for (e1=e2).
es<integer | integer-list> The extension line style.
w<decimal> The line weight.
s<integer | integer-list> The line style.
a<integer | integer-list-5> The arrowheads style.
a1<integer | integer-list-5> The arrowhead 1 style override.
a2<integer | integer-list-5> The arrowhead 2 style override.
o<decimal> The dimension line offset.
ts<decimal-list-3> A list of decimals that define the <width, line-height, heading-height> of the text.
tp<integer-list-2> The text alignment point. A list [tpx, tpy] of decimals.
rm<integer> The measurement rounding mode. One of: 0=none, 1=round_d, and 2=round_s.
cmh<decimal> The horizontal width minimum unit cell size.
cmv<decimal> The vertical height minimum unit cell size.
layers<string-list> The List of drafting layer names.

Only one of v1 or v2 should normally be used at a time. When neither is specified, the extension line vector angle will be at a right angle to the line formed by the dimension points p1 and p2.

Object example

draft_dim_line

Definition at line 371 of file dimension.scad.

+ Here is the call graph for this function:

◆ draft_dim_radius()

module draft_dim_radius ( = origin2d,
,
= 1,
,
,
,
= false,
= draft_get_config("dim-radius-weight"),
= draft_get_config("dim-radius-style"),
= draft_get_config("dim-radius-arrow"),
a1  ,
a2  ,
= draft_get_config("dim-offset"),
ts  = draft_get_config("dim-text-size"),
tp  = draft_get_config("dim-text-place"),
rm  = draft_get_config("dim-round-mode"),
cmh  = draft_get_config("dim-cmh"),
cmv  = draft_get_config("dim-cmv"),
layers  = draft_get_config("layers-dim") 
)

Construct a radial dimension line.

Parameters
c<point-2d> The radius center point.
p<point-2d> A point on the radius.
r<decimal> The radius length.
v<line-2d | decimal> The dimension line angle for radius r. A 2d line, vector, or decimal angle.
t<string | string-list> A single or multi-line text string that overrides the measured length.
u<string> The units for the measured length. One of the predefined in Length Units.
d<boolean> Construct a diameter dimension line.
w<decimal> The line weight.
s<integer | integer-list> The line style.
a<integer | integer-list-5> The arrowheads style.
a1<integer | integer-list-5> The arrowhead 1 style override.
a2<integer | integer-list-5> The arrowhead 2 style override.
o<decimal | decimal-list-2> The dimension line offset. A list [o1, o2] of decimals or a single decimal for (o1=o2).
ts<decimal-list-3> A list of decimals that define the <width, line-height, heading-height> of the text.
tp<integer-list-2> The text alignment point. A list [tpx, tpy] of decimals.
rm<integer> The measurement rounding mode. One of: 0=none, 1=round_d, and 2=round_s.
cmh<decimal> The horizontal width minimum unit cell size.
cmv<decimal> The vertical height minimum unit cell size.
layers<string-list> The List of drafting layer names.

Object example

draft_dim_radius

Definition at line 574 of file dimension.scad.

+ Here is the call graph for this function: