omdl  v1.0
OpenSCAD Mechanical Design Library
length.scad File Reference

Length units and conversions. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions and/or Modules

function length_unit_name (u=length_unit_default, d=1, w=false)
 Return the name for a length unit identifier with dimension. More...
 
function length (v, from=length_unit_default, to=length_unit_base, d=1)
 Convert a length value from one unit to another, with optional dimensional scaling. More...
 
function length_inv (v, from=length_unit_base, to=length_unit_default, d=1)
 Recover a linear length from an area or volume value, then convert units. More...
 
Shorts

Convenience wrappers around length that fix the from unit to a named unit and the to unit to length_unit_base. The d parameter is forwarded (default 1). Use length directly when a non-default target unit or list input with d > 1 is required.

function l_mm (v, d=1)
 Shorthand length conversion for millimeters. More...
 
function l_in (v, d=1)
 Shorthand length conversion for inches. More...
 

Variables

 length_unit_base = "mm"
 
 length_unit_default = "mm"
 

File Details

Length units and conversions.

Author
Roy Allen Sutton
Date
2015-2024

This file is part of omdl, an OpenSCAD mechanical design library.

The omdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

The omdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the omdl; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA; or see http://www.gnu.org/licenses/.

Definition in file length.scad.