omdl  v0.9.5
OpenSCAD Mechanical Design Library
constants.scad
Go to the documentation of this file.
1 //! Constant definitions.
2 /***************************************************************************//**
3  \file
4  \author Roy Allen Sutton
5  \date 2015-2018
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  \amu_define group_name (Constant Definitions)
31  \amu_define group_brief (Common mechanical design constants.)
32 
33  \amu_include (include/amu/pgid_path_pstem_pg.amu)
34 *******************************************************************************/
35 
36 //----------------------------------------------------------------------------//
37 // group.
38 //----------------------------------------------------------------------------//
39 
40 /***************************************************************************//**
41  \amu_include (include/amu/group.amu)
42 
43  \amu_include (include/amu/group_in_parent_start.amu)
44 *******************************************************************************/
45 
46 //----------------------------------------------------------------------------//
47 // subgroups.
48 //----------------------------------------------------------------------------//
49 
50 /***************************************************************************//**
51  \amu_define group1 (${group}_general)
52  \amu_define group1_name (General)
53  \amu_define group1_brief (General mathematical constants.)
54 
55  \amu_define group2 (${group}_system)
56  \amu_define group2_name (System)
57  \amu_define group2_brief (System and program limits.)
58 
59  \amu_define group3 (${group}_euclidean)
60  \amu_define group3_name (Euclidean)
61  \amu_define group3_brief (Euclidean space axis mapping.)
62 *******************************************************************************/
63 
64 //----------------------------------------------------------------------------//
65 // group1.
66 //----------------------------------------------------------------------------//
67 
68 /***************************************************************************//**
69  \defgroup \amu_eval(${group1} ${group1_name})
70  \brief \amu_eval(${group1_brief})
71  @{
72  \amu_include (include/amu/includes_required.amu)
73 *******************************************************************************/
74 
75 //----------------------------------------------------------------------------//
76 
77 //! <decimal> Epsilon, small distance to deal with overlapping shapes.
78 eps = 0.001;
79 
80 //! <decimal> The ratio of a circle's circumference to its diameter.
81 pi = 3.14159265358979323;
82 
83 //! <decimal> The ratio of a circle's circumference to its radius.
84 tau = 2*pi;
85 
86 //! <decimal> The golden ratio.
87 phi = (1 + sqrt(5)) / 2;
88 
89 //! @}
90 
91 //----------------------------------------------------------------------------//
92 // group2.
93 //----------------------------------------------------------------------------//
94 
95 /***************************************************************************//**
96  \defgroup \amu_eval(${group2} ${group2_name})
97  \brief \amu_eval(${group2_brief})
98  @{
99  \amu_include (include/amu/includes_required.amu)
100 *******************************************************************************/
101 
102 //----------------------------------------------------------------------------//
103 
104 //! <decimal> The largest representable number in OpenSCAD scripts.
105 number_max = 1e308;
106 
107 //! <decimal> The smallest representable number in OpenSCAD scripts.
108 number_min = -1e308;
109 
110 //! <value> The OpenSCAD \c inf value (infinity).
111 number_inf = 1/0;
112 
113 //! <value> The OpenSCAD \c nan value (not a number).
114 number_nan = 0/0;
115 
116 //! <string> A string with no characters (the empty string).
117 empty_str = "";
118 
119 //! <list> A list with no values (the empty list).
120 empty_lst = [];
121 
122 //! OpenSCAD coarse grid limit.
123 grid_coarse = 0.001;
124 
125 //! OpenSCAD fine grid limit.
126 grid_fine = 0.000001;
127 
128 //! @}
129 
130 //----------------------------------------------------------------------------//
131 // group3.
132 //----------------------------------------------------------------------------//
133 
134 /***************************************************************************//**
135  \defgroup \amu_eval(${group3} ${group3_name})
136  \brief \amu_eval(${group3_brief})
137  @{
138  \amu_include (include/amu/includes_required.amu)
139 *******************************************************************************/
140 
141 //----------------------------------------------------------------------------//
142 
143 //! <integer> The coordinate axis index for the Euclidean space x-axis.
144 x_axis_ci = 0;
145 
146 //! <integer> The coordinate axis index for the Euclidean space y-axis.
147 y_axis_ci = 1;
148 
149 //! <integer> The coordinate axis index for the Euclidean space z-axis.
150 z_axis_ci = 2;
151 
152 //! <decimal-list-2> A 2d zero vector (a list with two zeros).
153 zero2d = [0, 0];
154 
155 //! <point-2d> The origin point coordinate in 2d Euclidean space.
156 origin2d = [0, 0];
157 
158 //! <vector-2d> The unit vector of the positive x-axis in 2d Euclidean space.
159 x_axis2d_uv = [1, 0];
160 
161 //! <vector-2d> The unit vector of the positive y-axis in 2d Euclidean space.
162 y_axis2d_uv = [0, 1];
163 
164 //! <line-2d> A positively-directed unit line centered on the x-axis in 2d Euclidean space.
166 
167 //! <line-2d> A positively-directed unit line centered on the y-axis in 2d Euclidean space.
169 
170 //! <decimal-list-2> A 3d zero vector (a list with three zeros).
171 zero3d = [0, 0, 0];
172 
173 //! <point-3d> The origin point coordinate in 3-dimensional Euclidean space.
174 origin3d = [0, 0, 0];
175 
176 //! <vector-3d> The unit vector of the positive x-axis in 3d Euclidean space.
177 x_axis3d_uv = [1, 0, 0];
178 
179 //! <vector-3d> The unit vector of the positive y-axis in 3d Euclidean space.
180 y_axis3d_uv = [0, 1, 0];
181 
182 //! <vector-3d> The unit vector of the positive z-axis in 3d Euclidean space.
183 z_axis3d_uv = [0, 0, 1];
184 
185 //! <line-3d> A positively-directed unit line centered on the x-axis in 3d Euclidean space.
187 
188 //! <line-3d> A positively-directed unit line centered on the y-axis in 3d Euclidean space.
190 
191 //! <line-3d> A positively-directed unit line centered on the z-axis in 3d Euclidean space.
193 
194 //! <plane> The right-handed xy plane centered at the origin with normal vector.
196 
197 //! <plane> The right-handed yz plane centered at the origin with normal vector.
199 
200 //! <plane> The right-handed zx plane centered at the origin with normal vector.
202 
203 //! <plane> The right-handed xy plane centered at the origin with coplanar unit square points.
204 xy_plane_os = [origin3d, [for (r=[[1,1],[1,-1],[-1,-1],[-1,1]]) [r[0],r[1],0]]];
205 
206 //! <plane> The right-handed yz plane centered at the origin with coplanar unit square points.
207 yz_plane_os = [origin3d, [for (r=[[1,1],[1,-1],[-1,-1],[-1,1]]) [0,r[0],r[1]]]];
208 
209 //! <plane> The right-handed zx plane centered at the origin with coplanar unit square points.
210 zx_plane_os = [origin3d, [for (r=[[1,1],[1,-1],[-1,-1],[-1,1]]) [r[1],0,r[0]]]];
211 
212 //! @}
213 //! @}
214 
215 //----------------------------------------------------------------------------//
216 // end of file
217 //----------------------------------------------------------------------------//
x_axis3d_uv
<vector-3d> The unit vector of the positive x-axis in 3d Euclidean space.
Definition: constants.scad:428
y_axis2d_ul
<line-2d> A positively-directed unit line centered on the y-axis in 2d Euclidean space.
Definition: constants.scad:419
xy_plane_on
<plane> The right-handed xy plane centered at the origin with normal vector.
Definition: constants.scad:446
x_axis_ci
<integer> The coordinate axis index for the Euclidean space x-axis.
Definition: constants.scad:395
z_axis3d_uv
<vector-3d> The unit vector of the positive z-axis in 3d Euclidean space.
Definition: constants.scad:434
y_axis_ci
<integer> The coordinate axis index for the Euclidean space y-axis.
Definition: constants.scad:398
zero2d
<decimal-list-2> A 2d zero vector (a list with two zeros).
Definition: constants.scad:404
z_axis3d_ul
<line-3d> A positively-directed unit line centered on the z-axis in 3d Euclidean space.
Definition: constants.scad:443
yz_plane_on
<plane> The right-handed yz plane centered at the origin with normal vector.
Definition: constants.scad:449
zx_plane_on
<plane> The right-handed zx plane centered at the origin with normal vector.
Definition: constants.scad:452
x_axis2d_ul
<line-2d> A positively-directed unit line centered on the x-axis in 2d Euclidean space.
Definition: constants.scad:416
z_axis_ci
<integer> The coordinate axis index for the Euclidean space z-axis.
Definition: constants.scad:401
origin2d
<point-2d> The origin point coordinate in 2d Euclidean space.
Definition: constants.scad:407
origin3d
<point-3d> The origin point coordinate in 3-dimensional Euclidean space.
Definition: constants.scad:425
y_axis3d_uv
<vector-3d> The unit vector of the positive y-axis in 3d Euclidean space.
Definition: constants.scad:431
y_axis3d_ul
<line-3d> A positively-directed unit line centered on the y-axis in 3d Euclidean space.
Definition: constants.scad:440
zx_plane_os
<plane> The right-handed zx plane centered at the origin with coplanar unit square points.
Definition: constants.scad:461
yz_plane_os
<plane> The right-handed yz plane centered at the origin with coplanar unit square points.
Definition: constants.scad:458
x_axis3d_ul
<line-3d> A positively-directed unit line centered on the x-axis in 3d Euclidean space.
Definition: constants.scad:437
xy_plane_os
<plane> The right-handed xy plane centered at the origin with coplanar unit square points.
Definition: constants.scad:455
zero3d
<decimal-list-2> A 3d zero vector (a list with three zeros).
Definition: constants.scad:422
x_axis2d_uv
<vector-2d> The unit vector of the positive x-axis in 2d Euclidean space.
Definition: constants.scad:410
y_axis2d_uv
<vector-2d> The unit vector of the positive y-axis in 2d Euclidean space.
Definition: constants.scad:413
pi
<decimal> The ratio of a circle's circumference to its diameter.
Definition: constants.scad:198
tau
<decimal> The ratio of a circle's circumference to its radius.
Definition: constants.scad:201
phi
<decimal> The golden ratio.
Definition: constants.scad:204
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
Definition: constants.scad:195
grid_coarse
OpenSCAD coarse grid limit.
Definition: constants.scad:307
empty_str
<string> A string with no characters (the empty string).
Definition: constants.scad:301
number_nan
The OpenSCAD nan value (not a number).
Definition: constants.scad:298
number_inf
The OpenSCAD inf value (infinity).
Definition: constants.scad:295
empty_lst
<list> A list with no values (the empty list).
Definition: constants.scad:304
number_max
<decimal> The largest representable number in OpenSCAD scripts.
Definition: constants.scad:289
grid_fine
OpenSCAD fine grid limit.
Definition: constants.scad:310
number_min
<decimal> The smallest representable number in OpenSCAD scripts.
Definition: constants.scad:292