omdl
v0.6.1
OpenSCAD Mechanical Design Library
|
Three-dimensional geometric shapes. More...
Files | |
file | shapes3d.scad |
Three-dimensional basic shapes. | |
Functions | |
module | cone (r, h, d, vr, vr1, vr2) |
A cone. More... | |
module | cuboid (size, vr, vrm=0, center=false) |
A cuboid with edge, fillet, or chamfer corners. More... | |
module | ellipsoid (size) |
An ellipsoid. More... | |
module | ellipsoid_s (size, a1=0, a2=0) |
A sector of an ellipsoid. More... | |
module | pyramid_t (size, center=false) |
A pyramid with trilateral base formed by four equilateral triangles. More... | |
module | pyramid_q (size, center=false) |
A pyramid with quadrilateral base. More... | |
module | star3d (size, n=5, half=false) |
A three-dimensional star. More... | |
module | torus_rp (size, core, r, l, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, pa=0, ra=360, m=255, center=false, profile=false) |
A rectangular cross-sectional profile revolved about the z-axis. More... | |
module | torus_tp (size, core, r, l, co, cr=0, vr, vr1, vr2, pa=0, ra=360, m=255, centroid=false, incenter=false, profile=false,) |
A triangular cross-sectional profile revolved about the z-axis. More... | |
module | torus_ep (size, core, r, l, t, a1=0, a2=0, co, cr=0, pa=0, ra=360, m=255, profile=false) |
An elliptical cross-sectional profile revolved about the z-axis. More... | |
Three-dimensional geometric shapes.
module cone | ( | r | , |
h | , | ||
d | , | ||
vr | , | ||
vr1 | , | ||
vr2 | |||
) |
A cone.
r | <decimal> The base radius. |
h | <decimal> The height. |
d | <decimal> The base diameter. |
vr | <decimal> The default corner rounding radius. |
vr1 | <decimal> The base corner rounding radius. |
vr2 | <decimal> The point corner rounding radius. |
Example
Definition at line 107 of file shapes3d.scad.
module cuboid | ( | size | , |
vr | , | ||
vrm | = 0 , |
||
center | = false |
||
) |
A cuboid with edge, fillet, or chamfer corners.
size | <decimal-list-3|decimal> A list [x, y, z] of decimals or a single decimal for (x=y=z). |
vr | <decimal> The corner rounding radius. |
vrm | <integer> The radius mode. A 2-bit encoded integer that indicates edge and vertex finish. B0 controls edge and B1 controls vertex. |
center | <boolean> Center about origin. |
Example
vrm | B1 | B0 | Description |
---|---|---|---|
0 | 0 | 0 | fillet edges with fillet vertexes |
1 | 0 | 1 | chamfer edges with sphere vertexes |
2 | 1 | 0 | fillet edges with chamfer vertexes |
3 | 1 | 1 | chamfer edges with chamfer vertexes |
vr
, inset [vr, vr]
from the each edge. vr
. Therefore the chamfer length will be vr*sqrt(2)
at 45 degree angles. Definition at line 172 of file shapes3d.scad.
module ellipsoid | ( | size | ) |
An ellipsoid.
size | <decimal-list-2|decimal> A list [w, h] of decimals or a single decimal for (w=h). |
Example
Definition at line 257 of file shapes3d.scad.
module ellipsoid_s | ( | size | , |
a1 | = 0 , |
||
a2 | = 0 |
||
) |
A sector of an ellipsoid.
size | <decimal-list-2|decimal> A list [w, h] of decimals or a single decimal for (w=h). |
a1 | <decimal> The start angle in degrees. |
a2 | <decimal> The stop angle in degrees. |
Example
Definition at line 289 of file shapes3d.scad.
module pyramid_q | ( | size | , |
center | = false |
||
) |
A pyramid with quadrilateral base.
size | <decimal-list-3|decimal> A list [x, y, z] of decimals or a single decimal for (x=y=z). |
center | <boolean> Center about origin. |
Example
Definition at line 391 of file shapes3d.scad.
module pyramid_t | ( | size | , |
center | = false |
||
) |
A pyramid with trilateral base formed by four equilateral triangles.
size | <decimal> The face radius. |
center | <boolean> Center about origin. |
Example
Definition at line 347 of file shapes3d.scad.
module star3d | ( | size | , |
n | = 5 , |
||
half | = false |
||
) |
A three-dimensional star.
size | <decimal-list-3|decimal> A list [l, w, h] of decimals or a single decimal for (size=l=2*w=4*h). |
n | <decimal> The number of points. |
half | <boolean> Render upper half only. |
Example
Definition at line 437 of file shapes3d.scad.
module torus_ep | ( | size | , |
core | , | ||
r | , | ||
l | , | ||
t | , | ||
a1 | = 0 , |
||
a2 | = 0 , |
||
co | , | ||
cr | = 0 , |
||
pa | = 0 , |
||
ra | = 360 , |
||
m | = 255 , |
||
profile | = false |
||
) |
An elliptical cross-sectional profile revolved about the z-axis.
size | <decimal-list-2|decimal> The profile size. A list [x, y] of decimals or a single decimal for (x=y). |
core | <decimal-list-2|decimal> The profile core. A list [x, y] of decimals or a single decimal for (x=y). |
r | <decimal> The rotation radius. |
l | <decimal-list-2|decimal> The elongation length. A list [x, y] of decimals or a single decimal for (x=y) |
t | <decimal-list-2|decimal> The profile thickness. A list [x, y] of decimals or a single decimal for (x=y). |
a1 | <decimal> The profile start angle in degrees. |
a2 | <decimal> The profile stop angle in degrees. |
co | <decimal-list-2> Core offset. A list [x, y] of decimals. |
cr | <decimal> Core z-rotation. |
pa | <decimal> The profile pitch angle in degrees. |
ra | <decimal> The rotation sweep angle in degrees. |
m | <integer> The section render mode. An 8-bit encoded integer that indicates the revolution sections to render. |
profile | <boolean> Show profile only (do not extrude). |
Thickness t
core = size - t
; when t
and size
are given. size = core + t
; when t
and core
are given.Example
Definition at line 659 of file shapes3d.scad.
module torus_rp | ( | size | , |
core | , | ||
r | , | ||
l | , | ||
t | , | ||
co | , | ||
cr | = 0 , |
||
vr | , | ||
vr1 | , | ||
vr2 | , | ||
vrm | = 0 , |
||
vrm1 | , | ||
vrm2 | , | ||
pa | = 0 , |
||
ra | = 360 , |
||
m | = 255 , |
||
center | = false , |
||
profile | = false |
||
) |
A rectangular cross-sectional profile revolved about the z-axis.
size | <decimal-list-2|decimal> The profile size. A list [x, y] of decimals or a single decimal for (x=y). |
core | <decimal-list-2|decimal> The profile core. A list [x, y] of decimals or a single decimal for (x=y). |
r | <decimal> The rotation radius. |
l | <decimal-list-2|decimal> The elongation length. A list [x, y] of decimals or a single decimal for (x=y) |
t | <decimal-list-2|decimal> The profile thickness. A list [x, y] of decimals or a single decimal for (x=y). |
co | <decimal-list-2> Core offset. A list [x, y] of decimals. |
cr | <decimal> Core z-rotation. |
vr | <decimal-list-4|decimal> The profile default corner rounding radius. A list [v1r, v2r, v3r, v4r] of decimals or a single decimal for (v1r=v2r=v3r=v4r). Unspecified corners are not rounded. |
vr1 | <decimal-list-4|decimal> The profile outer corner rounding radius. |
vr2 | <decimal-list-4|decimal> The profile core corner rounding radius. |
vrm | <integer> The default corner radius mode. A 4-bit encoded integer that indicates each corner finish. Use bit value 0 for fillet and 1 for chamfer. |
vrm1 | <integer> The outer corner radius mode. |
vrm2 | <integer> The core corner radius mode. |
pa | <decimal> The profile pitch angle in degrees. |
ra | <decimal> The rotation sweep angle in degrees. |
m | <integer> The section render mode. An 8-bit encoded integer that indicates the revolution sections to render. |
center | <boolean> Rotate about profile center. |
profile | <boolean> Show profile only (do not extrude). |
Thickness t
core = size - t
; when t
and size
are given. size = core + t
; when t
and core
are given.Example
Definition at line 520 of file shapes3d.scad.
module torus_tp | ( | size | , |
core | , | ||
r | , | ||
l | , | ||
co | , | ||
cr | = 0 , |
||
vr | , | ||
vr1 | , | ||
vr2 | , | ||
pa | = 0 , |
||
ra | = 360 , |
||
m | = 255 , |
||
centroid | = false , |
||
incenter | = false , |
||
profile | = false |
||
) |
A triangular cross-sectional profile revolved about the z-axis.
size | <decimal-list-3|decimal> The size. A list [s1, s2, s3] of decimals or a single decimal for (s1=s2=s3). |
core | <decimal-list-3|decimal> The core. A list [s1, s2, s3] of decimals or a single decimal for (s1=s2=s3). |
r | <decimal> The rotation radius. |
l | <decimal-list-2|decimal> The elongation length. A list [x, y] of decimals or a single decimal for (x=y) |
co | <decimal-list-2> Core offset. A list [x, y] of decimals. |
cr | <decimal> Core z-rotation. |
vr | <decimal-list-3|decimal> The default vertex rounding radius. A list [v1r, v2r, v3r] of decimals or a single decimal for (v1r=v2r=v3r). |
vr1 | <decimal-list-3|decimal> The outer vertex rounding radius. |
vr2 | <decimal-list-3|decimal> The core vertex rounding radius. |
pa | <decimal> The profile pitch angle in degrees. |
ra | <decimal> The rotation sweep angle in degrees. |
m | <integer> The section render mode. An 8-bit encoded integer that indicates the revolution sections to render. |
centroid | <boolean> Rotate about profile centroid. |
incenter | <boolean> Rotate about profile incenter. |
profile | <boolean> Show profile only (do not extrude). |
Example
Definition at line 592 of file shapes3d.scad.