omdl  v0.6.1
OpenSCAD Mechanical Design Library
3d Shapes

Three-dimensional geometric shapes. More...

+ Collaboration diagram for 3d Shapes:

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...
 

Detailed Description

Three-dimensional geometric shapes.

Function Documentation

module cone ( ,
,
,
vr  ,
vr1  ,
vr2   
)

A cone.

Parameters
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

shapes3d_dim_qvga_diag_cone.png
cone
1  cone( h=25, r=10, vr=2 );

Definition at line 107 of file shapes3d.scad.

+ Here is the call graph for this function:

module cuboid ( size  ,
vr  ,
vrm  = 0,
center  = false 
)

A cuboid with edge, fillet, or chamfer corners.

Parameters
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

shapes3d_dim_qvga_diag_cuboid.png
cuboid
1  cuboid( size=[25,40,20], vr=5, center=true );

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
Note
Using fillet replaces all edges with a quarter circle of radius vr, inset [vr, vr] from the each edge.
Using chamfer replaces all edges with isosceles right triangles with side lengths equal to the corner rounding radius vr. Therefore the chamfer length will be vr*sqrt(2) at 45 degree angles.

Definition at line 172 of file shapes3d.scad.

+ Here is the call graph for this function:

module ellipsoid ( size  )

An ellipsoid.

Parameters
size<decimal-list-2|decimal> A list [w, h] of decimals or a single decimal for (w=h).

Example

shapes3d_dim_qvga_diag_ellipsoid.png
ellipsoid
1  ellipsoid( size=[40,25] );

Definition at line 257 of file shapes3d.scad.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

module ellipsoid_s ( size  ,
a1  = 0,
a2  = 0 
)

A sector of an ellipsoid.

Parameters
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

shapes3d_dim_qvga_diag_ellipsoid_s.png
ellipsoid_s
1  ellipsoid_s( size=[60,15], a1=0, a2=270 );

Definition at line 289 of file shapes3d.scad.

+ Here is the call graph for this function:

module pyramid_q ( size  ,
center  = false 
)

A pyramid with quadrilateral base.

Parameters
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

shapes3d_dim_qvga_diag_pyramid_q.png
pyramid_q
1  pyramid_q( size=[35,20,5], center=true );

Todo:
Support vertex rounding radius.

Definition at line 391 of file shapes3d.scad.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

module pyramid_t ( size  ,
center  = false 
)

A pyramid with trilateral base formed by four equilateral triangles.

Parameters
size<decimal> The face radius.
center<boolean> Center about origin.

Example

shapes3d_dim_qvga_diag_pyramid_t.png
pyramid_t
1  pyramid_t( size=20, center=true );

Todo:
Support vertex rounding radius.

Definition at line 347 of file shapes3d.scad.

module star3d ( size  ,
= 5,
half  = false 
)

A three-dimensional star.

Parameters
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

shapes3d_dim_qvga_diag_star3d.png
star3d
1  star3d( size=40, n=5, half=true );

Definition at line 437 of file shapes3d.scad.

+ Here is the call graph for this function:

module torus_ep ( size  ,
core  ,
,
,
,
a1  = 0,
a2  = 0,
co  ,
cr  = 0,
pa  = 0,
ra  = 360,
= 255,
profile  = false 
)

An elliptical cross-sectional profile revolved about the z-axis.

Parameters
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).
See also
rotate_extrude_tre for description of extrude parameters.

Thickness t

  • core = size - t; when t and size are given.
  • size = core + t; when t and core are given.

Example

shapes3d_dim_qvga_diag_torus_ep.png
torus_ep
1  torus_ep( size=[20,15], t=[2,4], r=50, a1=0, a2=180, pa=90, ra=270, co=[0,2] );

Definition at line 659 of file shapes3d.scad.

+ Here is the call graph for this function:

module torus_rp ( size  ,
core  ,
,
,
,
co  ,
cr  = 0,
vr  ,
vr1  ,
vr2  ,
vrm  = 0,
vrm1  ,
vrm2  ,
pa  = 0,
ra  = 360,
= 255,
center  = false,
profile  = false 
)

A rectangular cross-sectional profile revolved about the z-axis.

Parameters
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).
See also
rotate_extrude_tre for description of extrude parameters.

Thickness t

  • core = size - t; when t and size are given.
  • size = core + t; when t and core are given.

Example

shapes3d_dim_qvga_diag_torus_rp.png
torus_rp
1  torus_rp( size=[40,20], core=[35,20], r=40, l=[90,60], co=[0,2.5], vr=4, vrm=15, center=true );

Definition at line 520 of file shapes3d.scad.

+ Here is the call graph for this function:

module torus_tp ( size  ,
core  ,
,
,
co  ,
cr  = 0,
vr  ,
vr1  ,
vr2  ,
pa  = 0,
ra  = 360,
= 255,
centroid  = false,
incenter  = false,
profile  = false 
)

A triangular cross-sectional profile revolved about the z-axis.

Parameters
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).
See also
rotate_extrude_tre for description of extrude parameters.

Example

shapes3d_dim_qvga_diag_torus_tp.png
torus_tp
1  torus_tp( size=40, core=30, r=60, co=[0,-4], vr=4, pa=90, ra=270, centroid=true );

Note
The outer and inner triangles centroids are aligned prior to the core removal.

Definition at line 592 of file shapes3d.scad.

+ Here is the call graph for this function: