omdl
v1.0
OpenSCAD Mechanical Design Library
docs_home.scad
Go to the documentation of this file.
1
//! Library documentation home page.
2
/***************************************************************************/
/**
3
\file
4
\author Roy Allen Sutton
5
\date 2015-2026
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
*******************************************************************************/
29
30
//----------------------------------------------------------------------------//
31
// introduction.
32
//----------------------------------------------------------------------------//
33
34
/***************************************************************************/
/**
35
\mainpage Introduction
36
\tableofcontents
37
38
\section intro_overview Overview
39
40
[omdl], OpenSCAD Mechanical Design Library, is an open-source
41
parametric framework for mechanical design in [OpenSCAD]. It provides
42
reusable design primitives and fabrication-oriented modules intended
43
to support real mechanical workflows rather than isolated geometric
44
modeling.
45
46
omdl was originally conceived to support the design of mechanically
47
engineered objects intended for real-world CNC-based fabrication. A
48
central goal of the library is to **separate design intent from
49
implementation parameters**, enabling late-time parameter binding
50
during model composition.
51
52
By decoupling intent from geometry, designers can work at a higher
53
level of abstraction, describing what a component must achieve rather
54
than committing early to specific dimensions or configurations. This
55
approach increases target outcome flexibility, allowing designs to be
56
recomposed or adapted to new requirements without rewriting core
57
geometry.
58
59
In practice, this means that assemblies can be adjusted to match a
60
particular application, manufacturing constraint, or the commodity
61
components currently available. Late parameter binding allows the
62
same design definition to integrate different off-the-shelf parts,
63
making omdl well suited for iterative engineering workflows and
64
fabrication-driven design.
65
66
The library emphasizes:
67
68
- **Parametric mechanical design:** components are defined by
69
properties and intent rather than fixed geometry.
70
71
- **Standardized data types:** Structured parameter abstractions used
72
to convey configuration, intent, and implementation details between
73
modules.
74
75
- **Minimal global state:** modules are designed to be predictable and
76
composable.
77
78
- **Unit operations:** consistent handling of lengths, angles, and
79
dimensional data.
80
81
- **Integrated documentation:** API behavior and usage are documented
82
directly in source using [Doxygen] and [openscad-amu].
83
84
- **Validation-driven development:** automated scripts verify
85
functionality of core primitives across evolving OpenSCAD versions.
86
87
Instead of treating OpenSCAD purely as a shape generator, omdl
88
introduces a structured mechanical design layer that helps bridge
89
conceptual design, drafting, and fabrication.
90
91
\section intro_philosophy Design Philosophy
92
93
omdl is shaped by a set of design decisions that follow from its
94
engineering focus.
95
96
Geometry is treated as a consequence of mechanical decisions, not
97
their starting point. Rather than exposing low-level shape primitives
98
as the primary interface, omdl encourages working at the level of
99
components, operations, and assemblies — describing what a part must
100
achieve before specifying how it is constructed.
101
102
Modules are designed to be included individually as needed, helping
103
keep projects lightweight and reducing unnecessary dependencies. This
104
modular approach also supports interoperability, making it easier to
105
integrate omdl alongside other OpenSCAD design libraries without
106
imposing a rigid project structure.
107
108
The library is organized into modular groups that represent distinct
109
functional areas, including tooling utilities, drafting operations,
110
design data, mathematical operations, geometric primitives, and
111
mechanical components. This structure encourages separation of
112
concerns while allowing developers to work at the appropriate level
113
of abstraction for their design.
114
115
\section intro_docs Documentation Approach
116
117
All documentation is generated from inline source comments using
118
[Doxygen]. The documentation is retrieved from the source code and
119
pre-processed by [openscad-amu] before being sent to Doxygen for
120
processing into the desired output format.
121
122
This approach ensures that:
123
124
- examples remain synchronized with the implementation,
125
126
- parameter behavior is clearly described,
127
128
- documentation can be exported to multiple formats such as HTML or PDF.
129
130
Validation scripts are executed during the documentation build
131
process to confirm that core operations behave consistently across
132
supported OpenSCAD versions. This has become less pressing with the
133
maturing OpenSCAD language.
134
135
\section intro_audience Who This Library Is For
136
137
omdl is intended for:
138
139
- Mechanical engineers using OpenSCAD for parametric design
140
141
- Makers building fabrication-ready components
142
143
- Developers creating reusable mechanical modules
144
145
- Projects that benefit from application-specific mechanical design
146
147
- “Just-fit” solutions using available commodity components
148
149
It may be less suitable for purely artistic modeling workflows where
150
strict dimensional control is unnecessary.
151
152
\section intro_getting_started Getting Started
153
154
Before running examples, follow the [installing] instructions to set
155
up omdl and its build environment. For an introduction to the type
156
system and parameter conventions used throughout the library, see
157
[data types].
158
159
The minimal example below demonstrates how omdl modules can be
160
combined to construct a fabrication-oriented component. The example
161
builds a custom linear rod bearing using parametric dimensions and
162
unit conversion functions.
163
164
\amu_define title (Hello world)
165
\amu_define image_views (right top front diag)
166
\amu_define image_size (sxga)
167
\amu_define image_columns (4)
168
\amu_define scope_id (quickstart)
169
170
\amu_define notes_scad
171
( In this example, bearing_linear_rod() is used to construct
172
a custom linear bearing for fabrication on a 3D printer. )
173
174
\amu_define notes_diagrams
175
( The dimension operations in the above example can be found near
176
the end of ${FILE_NAME} within the \em scope \c ${scope_id}. )
177
178
\amu_include (include/amu/scope_diagrams_3d.amu)
179
180
\section intro_contributing Contributing
181
182
omdl is developed using [Git] and hosted on [GitHub]. Contributions
183
typically follow the standard [forking] and [pull requests] workflow.
184
Because the project is licensed under the GNU Lesser General Public
185
License, modified files should retain original copyright notices
186
alongside any new authorship.
187
188
Ideas, bug reports, feature requests, and improvements to
189
documentation are encouraged.
190
191
\section intro_support Support
192
193
Questions, feature requests, or issues can be submitted through the
194
project’s [issue] tracker.
195
196
\section intro_further Further Reading
197
198
- \ref omdl_distinctions "Distinctions:"
199
How omdl differs from libraries like MCAD and BOSL2.
200
201
- \ref architecture_overview "Architecture Overview:"
202
omdl's four-layer framework and module design guidelines.
203
204
- \ref building_and_installing "Building and Installing the Library:"
205
Setup script instructions for installing omdl locally.
206
207
- \ref library_usage "Library Usage:"
208
How to include modules and use omdl-base.scad.
209
210
- \ref type_conventions "Type Conventions:"
211
Naming conventions for all parameter and Euclidean types.
212
213
- \ref tv "Auto-tests and Validation:"
214
Automated test results across supported OpenSCAD versions.
215
216
- \ref build_information "Build Information:"
217
Toolchain versions and component counts at build time.
218
219
220
[GNU Lesser General Public License]: https://www.gnu.org/licenses/lgpl.html
221
222
[omdl]: https://royasutton.github.io/omdl
223
[omdl repository]: https://github.com/royasutton/omdl
224
[issue]: https://github.com/royasutton/omdl/issues
225
226
[openscad-amu]: https://royasutton.github.io/openscad-amu
227
228
[Doxygen]: https://www.doxygen.nl
229
[markups]: https://www.doxygen.nl/manual/commands.html
230
231
[OpenSCAD]: https://www.openscad.org
232
233
[Git]: https://git-scm.com
234
[GitHub]: https://github.com
235
[forking]: https://help.github.com/forking
236
[pull requests]: https://help.github.com/articles/about-pull-requests
237
*******************************************************************************/
238
239
//----------------------------------------------------------------------------//
240
// openscad-amu auxiliary scripts
241
//----------------------------------------------------------------------------//
242
243
/*
244
BEGIN_SCOPE logo;
245
BEGIN_OPENSCAD;
246
include <omdl-base.scad>;
247
include <models/3d/misc/omdl_logo.scad>;
248
249
$fn = 36;
250
251
omdl_logo(d=10, c=false, b=true, t=false);
252
END_OPENSCAD;
253
254
BEGIN_MFSCRIPT;
255
include --path "${INCLUDE_PATH}" {var_init,var_gen_png2eps}.mfs;
256
257
views name "views" distance "25" views "top";
258
images name "slogo" aspect "1:1" xsizes "55";
259
variables set_opts_combine "views slogo";
260
261
include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
262
END_MFSCRIPT;
263
END_SCOPE;
264
*/
265
266
/*
267
BEGIN_SCOPE quickstart;
268
BEGIN_OPENSCAD;
269
include <omdl-base.scad>;
270
include <transforms/base_cs.scad>;
271
include <tools/2d/drafting/draft-base.scad>;
272
include <parts/3d/motion/bearing_linear_rod.scad>;
273
274
$fn = 36;
275
276
p = [length(0.706, "in"), length(0.622, "in")];
277
b = length(6, "mm");
278
279
r = 21.5; c = 6; a = 85;
280
h = [b*8, undef, false];
281
282
v = is_undef ( __mfs__diag ) ? 2: undef;
283
284
bearing_linear_rod(pipe=p, ball=b, count=c, angle=a, h=h, align=4, view=v)
285
minkowski() {cylinder(r=r-b*2/3, h=first(h)-b*3/2, center=true); sphere(r=r/5);};
286
287
// end_include
288
289
if ( !is_undef(__mfs__top) ) color("brown"){
290
draft_dim_center(r=r);
291
draft_dim_radius(r=r, v=[+1,-1], u="mm");
292
draft_dim_line(p1=[-r,0], p2=[+r,0], d=r*1.25, u ="mm");
293
draft_dim_line(p1=[-first(p)/2,0], p2=[+first(p)/2,0], d=r*3/4, u ="mm");
294
}
295
296
if ( !is_undef(__mfs__front) ) color("brown") rotate([90,0,0]) {
297
draft_dim_line(p1=[-r,0], p2=[+r,0], d=r*3/4, u ="mm");
298
draft_dim_line(p1=[-first(p)/2,0], p2=[+first(p)/2,0], u ="mm");
299
draft_dim_line(p1=[0,0], p2=[0,-first(h)], d=+r*1.25, u ="mm");
300
draft_dim_leader(p=[-r+r/20,-r/15], v1=135, v2=180, l1=7, l2=7, t="r/5", tr=0, s=2);
301
}
302
303
END_OPENSCAD;
304
305
BEGIN_MFSCRIPT;
306
include --path "${INCLUDE_PATH}" {var_init,var_gen_png2eps}.mfs;
307
table_unset_all sizes;
308
309
images name "sizes" types "sxga";
310
views name "views" views "diag front right top";
311
312
variables set_opts_combine "sizes views";
313
variables add_opts "--viewall --autocenter --view=axes";
314
315
include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
316
END_MFSCRIPT;
317
END_SCOPE;
318
*/
319
320
//----------------------------------------------------------------------------//
321
// end of file
322
//----------------------------------------------------------------------------//
docs_home.scad
Generated on Tue Mar 24 2026 18:54:48 for omdl by
doxygen
with
openscad-amu