Converter tables

From Vectorlab
Jump to: navigation, search

Common conversion tables for various units. To be expanded.

Conversions

1 inch (in) 25.4 mm
1 foot (ft) 12 in 30.48 cm
1 yard (yd) 3 ft 91.44 cm
1 mil 0,001 in 0,0254 mm
1 ft 0,3048 m 304,8 mm
1 mm 0.039370 in 1/25,4 in
Points
1 point 1/72 in 1/1828,8 mm
1 point 1/(25.4*72) mm 0,000547 mm
1 in 72 points
12 points 1 pica
6 pica 1 in

UPI (Units Per Inches)

A user can set the document units to any value, including custom ones, thus an environment check might be necessary for correct retrival of dimensions and further usage within VectorScript.

current unit to inches x := x / upi
current unit to mm x := x / upi * 25,4
mm to current unit x := x * upi / 25,4

Available routines for checking the current units settings are:

Examples
if document units are inches GetPrefReal(152) = 1
if document units are feets GetPrefReal(152) = 0.08333333333...
if document units are yards GetPrefReal(152) = 0.02777777777...
if document units are miles GetPrefReal(152) = 1.578282828283e-05...
if document units are metres GetPrefReal(152) = 0.0254
if document units are centimeters GetPrefReal(152) = 2.54
if document units are millimeters GetPrefReal(152) = 25.4

Routines that require/return specific units values

Some VectorScript routines need or return values in a defined unit and a conversion from the current unit settings to inches or millimeters might be needed:

returning mm

requesting mm

  • OffsetPoly<code=vss>(hPoly: HANDLE; dist: REAL): HANDLE;</code=vss>

returning in

page in

  • GetMarker<code=vss>( h:HANDLE; VAR start:BOOLEAN; VAR end:BOOLEAN; VAR style:INTEGER; VAR size:REAL );</code=vss> Size is always page inches.
  • FMarker<code=vss>( VAR style:INTEGER; VAR size:REAL; VAR ang:INTEGER );</code=vss> Size is always page inches.

real world in

requesting in

page in

  • SetLScale<code=vss>( h:HANDLE; scale: REAL);</code=vss>
  • SetScale<code=vss>( actualSize: REAL );</code=vss>

real world in

See also