omdl  v0.6.1
OpenSCAD Mechanical Design Library
constants.scad
Go to the documentation of this file.
1 //! Design constant definitions.
2 /***************************************************************************//**
3  \file constants.scad
4  \author Roy Allen Sutton
5  \date 2015-2017
6 
7  \copyright
8 
9  This file is part of [omdl] (https://github.com/royasutton/omdl),
10  an OpenSCAD mechanical design library.
11 
12  The \em omdl is free software; you can redistribute it and/or modify
13  it under the terms of the [GNU Lesser General Public License]
14  (http://www.gnu.org/licenses/lgpl.html) as published by the Free
15  Software Foundation; either version 2.1 of the License, or (at
16  your option) any later version.
17 
18  The \em omdl is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with the \em omdl; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26  02110-1301, USA; or see <http://www.gnu.org/licenses/>.
27 
28  \details
29 
30  \ingroup constants constants_general constants_system constants_euclidean
31 *******************************************************************************/
32 
33 //----------------------------------------------------------------------------//
34 /***************************************************************************//**
35  \addtogroup constants
36  @{
37 
38  \defgroup constants_general General
39  \brief General design constants.
40  @{
41 *******************************************************************************/
42 //----------------------------------------------------------------------------//
43 
44 //! <decimal> Epsilon, small distance to deal with overlapping shapes.
45 aeps = 0.001;
46 
47 //! <decimal> The ratio of a circle's circumference to its diameter.
48 pi = 3.14159265358979323;
49 
50 //! <decimal> The ratio of a circle's circumference to its radius.
51 tau = 2*pi;
52 
53 //! <decimal> The golden ratio.
54 phi = (1 + sqrt(5)) / 2;
55 
56 //! @}
57 //! @}
58 
59 //----------------------------------------------------------------------------//
60 /***************************************************************************//**
61  \addtogroup constants
62  @{
63 
64  \defgroup constants_system System
65  \brief System and program limits.
66  @{
67 *******************************************************************************/
68 //----------------------------------------------------------------------------//
69 
70 //! <decimal> The largest representable number in OpenSCAD scripts.
71 number_max = 1e308;
72 
73 //! <decimal> The smallest representable number in OpenSCAD scripts.
74 number_min = -1e308;
75 
76 //! <string> A string with no characters (the empty string).
77 empty_str = "";
78 
79 //! <list> A list with no values (the empty list).
80 empty_lst = [];
81 
82 //! @}
83 //! @}
84 
85 //----------------------------------------------------------------------------//
86 /***************************************************************************//**
87  \addtogroup constants
88  @{
89 
90  \defgroup constants_euclidean Euclidean
91  \brief Euclidean space axis mapping.
92  @{
93 *******************************************************************************/
94 //----------------------------------------------------------------------------//
95 
96 //! <integer> The coordinate axis index for the Euclidean space x-axis.
98 
99 //! <integer> The coordinate axis index for the Euclidean space y-axis.
101 
102 //! <integer> The coordinate axis index for the Euclidean space z-axis.
104 
105 //! <decimal-list-2> A 2d zero vector (a list with two zeros).
106 zero2d = [0, 0];
107 
108 //! <point-2d> The origin point coordinate in 2d Euclidean space.
109 origin2d = [0, 0];
110 
111 //! <vector-2d> The unit vector of the positive x-axis in 2d Euclidean space.
112 x_axis2d_uv = [1, 0];
113 
114 //! <vector-2d> The unit vector of the positive y-axis in 2d Euclidean space.
115 y_axis2d_uv = [0, 1];
116 
117 //! <line-2d> A positively-directed unit line centered on the x-axis in 2d Euclidean space.
119 
120 //! <line-2d> A positively-directed unit line centered on the y-axis in 2d Euclidean space.
122 
123 //! <decimal-list-2> A 3d zero vector (a list with three zeros).
124 zero3d = [0, 0, 0];
125 
126 //! <point-3d> The origin point coordinate in 3-dimensional Euclidean space.
127 origin3d = [0, 0, 0];
128 
129 //! <vector-3d> The unit vector of the positive x-axis in 3d Euclidean space.
130 x_axis3d_uv = [1, 0, 0];
131 
132 //! <vector-3d> The unit vector of the positive y-axis in 3d Euclidean space.
133 y_axis3d_uv = [0, 1, 0];
134 
135 //! <vector-3d> The unit vector of the positive z-axis in 3d Euclidean space.
136 z_axis3d_uv = [0, 0, 1];
137 
138 //! <line-3d> A positively-directed unit line centered on the x-axis in 3d Euclidean space.
140 
141 //! <line-3d> A positively-directed unit line centered on the y-axis in 3d Euclidean space.
143 
144 //! <line-3d> A positively-directed unit line centered on the z-axis in 3d Euclidean space.
146 
147 //! <plane> The right-handed xy plane centered at the origin with normal vector.
149 
150 //! <plane> The right-handed yz plane centered at the origin with normal vector.
152 
153 //! <plane> The right-handed zx plane centered at the origin with normal vector.
155 
156 //! <plane> The right-handed xy plane centered at the origin with coplanar unit square points.
157 xy_plane_os = [origin3d, [for (r=[[1,1],[1,-1],[-1,-1],[-1,1]]) [r[0],r[1],0]]];
158 
159 //! <plane> The right-handed yz plane centered at the origin with coplanar unit square points.
160 yz_plane_os = [origin3d, [for (r=[[1,1],[1,-1],[-1,-1],[-1,1]]) [0,r[0],r[1]]]];
161 
162 //! <plane> The right-handed zx plane centered at the origin with coplanar unit square points.
163 zx_plane_os = [origin3d, [for (r=[[1,1],[1,-1],[-1,-1],[-1,1]]) [r[1],0,r[0]]]];
164 
165 //! @}
166 //! @}
167 
168 //----------------------------------------------------------------------------//
169 // end of file
170 //----------------------------------------------------------------------------//
zero3d
A 3d zero vector (a list with three zeros).
Definition: constants.scad:124
y_axis3d_uv
The unit vector of the positive y-axis in 3d Euclidean space.
Definition: constants.scad:133
x_axis_ci
The coordinate axis index for the Euclidean space x-axis.
Definition: constants.scad:97
y_axis_ci
The coordinate axis index for the Euclidean space y-axis.
Definition: constants.scad:100
x_axis3d_ul
A positively-directed unit line centered on the x-axis in 3d Euclidean space.
Definition: constants.scad:139
tau
The ratio of a circle's circumference to its radius.
Definition: constants.scad:51
phi
The golden ratio.
Definition: constants.scad:54
zx_plane_on
The right-handed zx plane centered at the origin with normal vector.
Definition: constants.scad:154
xy_plane_on
The right-handed xy plane centered at the origin with normal vector.
Definition: constants.scad:148
x_axis3d_uv
The unit vector of the positive x-axis in 3d Euclidean space.
Definition: constants.scad:130
empty_lst
A list with no values (the empty list).
Definition: constants.scad:80
number_min
The smallest representable number in OpenSCAD scripts.
Definition: constants.scad:74
y_axis2d_ul
A positively-directed unit line centered on the y-axis in 2d Euclidean space.
Definition: constants.scad:121
z_axis_ci
The coordinate axis index for the Euclidean space z-axis.
Definition: constants.scad:103
pi
The ratio of a circle's circumference to its diameter.
Definition: constants.scad:48
zero2d
A 2d zero vector (a list with two zeros).
Definition: constants.scad:106
empty_str
A string with no characters (the empty string).
Definition: constants.scad:77
origin3d
The origin point coordinate in 3-dimensional Euclidean space.
Definition: constants.scad:127
x_axis2d_ul
A positively-directed unit line centered on the x-axis in 2d Euclidean space.
Definition: constants.scad:118
xy_plane_os
The right-handed xy plane centered at the origin with coplanar unit square points...
Definition: constants.scad:157
origin2d
The origin point coordinate in 2d Euclidean space.
Definition: constants.scad:109
z_axis3d_uv
The unit vector of the positive z-axis in 3d Euclidean space.
Definition: constants.scad:136
y_axis3d_ul
A positively-directed unit line centered on the y-axis in 3d Euclidean space.
Definition: constants.scad:142
yz_plane_on
The right-handed yz plane centered at the origin with normal vector.
Definition: constants.scad:151
aeps
Epsilon, small distance to deal with overlapping shapes.
Definition: constants.scad:45
number_max
The largest representable number in OpenSCAD scripts.
Definition: constants.scad:71
zx_plane_os
The right-handed zx plane centered at the origin with coplanar unit square points...
Definition: constants.scad:163
z_axis3d_ul
A positively-directed unit line centered on the z-axis in 3d Euclidean space.
Definition: constants.scad:145
y_axis2d_uv
The unit vector of the positive y-axis in 2d Euclidean space.
Definition: constants.scad:115
yz_plane_os
The right-handed yz plane centered at the origin with coplanar unit square points...
Definition: constants.scad:160
x_axis2d_uv
The unit vector of the positive x-axis in 2d Euclidean space.
Definition: constants.scad:112