omdl
v0.9.5
OpenSCAD Mechanical Design Library
|
Sizable polyhedra generated from shape database. More...
Files | |
file | polyhedron_db.scad |
Sizable polyhedra generated from shape database. | |
Functions | |
function | ph_db_get_size (tr=ph_db_dtr) |
Get the number of shape identifiers in data table. More... | |
function | ph_db_get_id (n, tr=ph_db_dtr) |
Get data table identifier name (or names). More... | |
module | ph_db_polyhedron (id, size, align, yz=true, tr=ph_db_dtr, tc=ph_db_dtc) |
Construct a named polyhedron. More... | |
Variables | |
ph_db_dtc = dtc_polyhedra_polyhedra_all | |
<map> The default polyhedra data table columns. | |
ph_db_dtr = dtr_polyhedra_polyhedra_all | |
<table> The default polyhedra data table rows. | |
Sizable polyhedra generated from shape database.
Requires: |
---|
include <omdl-base.scad>; |
include <database/geometry/polyhedra/polyhedra_all.scad>; |
include <shapes/polyhedron_db.scad>; |
To work with a smaller data table set, include the specific table of interest rather than polyhedra_all.scad, shown as required above. Here is an example that uses a limited set.
Cupolas example script
top | bottom | diag |
---|---|---|
For a list of all available polyhedra, see the polyhedra datbase.
function ph_db_get_id | ( | n | , |
tr | = ph_db_dtr |
||
) |
Get data table identifier name (or names).
n | <integer> An index number. |
tr | <table> The polyhedra data table rows. |
n
or the list of all identifier names for n
= 0.Identifiers numbering start from 1 and end at ph_db_get_size().
function ph_db_get_size | ( | tr | = ph_db_dtr | ) |
Get the number of shape identifiers in data table.
tr | <table> The polyhedra data table rows. |
Construct a named polyhedron.
id | <string> The polyhedron identifier name. |
size | <decimal-list-3 | decimal> A list [x, y, z] of decimals or a single decimal for (x=y=z). |
align | <decimal-list-3 | decimal> A list [x, y, z] of decimals or a single decimal for (x=y=z). |
yz | <boolean> An internal dataset rotation control variable. |
tr | <table> The polyhedra data table rows. |
tc | <map> The polyhedra data table columns. |
Each axis may be assigned an alignment value of 0, 1 or 2 as summarized in the following table.
align | value description |
---|---|
0 | do not align axis |
1 | align axis at lower shape bounds |
2 | align axis at upper shape bounds |
Using this module, polyhedron can be incorporated into designs as shown in this simple example.
Design example script
front | diag |
---|---|
Definition at line 553 of file polyhedron_db.scad.