omdl  v1.0
OpenSCAD Mechanical Design Library
Revolutions

Select 2D shapes revolved about the z-axis. More...

+ Collaboration diagram for Revolutions:

Files

file  revolved.scad
 Select 2D shapes revolved about the z-axis.
 

Functions and/or Modules

module torus_rectangle_c (r, pa=0, ra=360, l, m=255, size, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
 A rectangular cross-sectional profile revolved about the z-axis. More...
 
module torus_ellipse_cs (r, pa=0, ra=360, l, m=255, size, core, t, a1=0, a2=0, co, cr=0)
 An elliptical cross-sectional profile revolved about the z-axis. More...
 
module torus_pg_trapezoid (r, pa=0, ra=360, l, m=255, b=1, h, sl=1, a=90, vr, vrm=1, vfn, center=false)
 A trapezoidal cross-sectional profile revolved about the z-axis. More...
 

Usage Details

Select 2D shapes revolved about the z-axis.

Requires:
include <omdl-base.scad>;
include <shapes/revolved.scad>;
Revolutions
IIIIII
torus_ellipse_cs()
torus_pg_trapezoid()
torus_rectangle_c()

Function and/or Module Documentation

◆ torus_rectangle_c()

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

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

Translate, rotate, and revolve a 2d shape about the z-axis with linear elongation.

Parameters
r<decimal> The rotation radius.
pa<decimal> The profile pitch angle in degrees.
ra<decimal> The rotation sweep angle in degrees.

Object example

extrude_rotate_tr( r=50, pa=45, ra=270 ) square( [10,5], center=true );
module extrude_rotate_tr(r, pa=0, ra=360)
Translate, rotate, and revolve a 2d shape about the z-axis.
Definition: extrude.scad:457
extrude_rotate_tr
Parameters
l<decimal-list-2 | decimal> The elongation length. A list [x, y] of decimals or a single decimal for (x=y)
m<integer> The section render mode. An 8-bit encoded integer that indicates the revolution sections to render. Bit values 1 enables the corresponding section and bit values 0 are disabled. Sections are assigned to the bit position in counter-clockwise order.

When the parameter l is not specified, the shape profile is revolved using extrude_rotate_tr(). When the parameter l is specified, the shape profile may be linearly extruded along the the x-axis and y-axis, with the linear extrusion lengths specified by l, and is revolved 90 degrees to transition between the axes. In this mode, the parameter ra is defined to be 90 for all corners and the parameter m controls which of the eight path sections to render during the 360 degree revolution.

Object example

extrude_rotate_trl( r=25, l=[5, 50], pa=45, m=31 ) square( [10,5], center=true );
module extrude_rotate_trl(r, pa=0, ra=360, l, m=255)
Translate, rotate, and revolve a 2d shape about the z-axis with linear elongation.
Definition: extrude.scad:562
extrude_rotate_trl

A rectangle with a removed rectangular core.

Parameters
size<decimal-list-2 | decimal> A list [x, y] of decimals or a single decimal for (x=y).
core<decimal-list-2 | decimal> A list [x, y] of decimals or a single decimal for (x=y).
t<decimal-list-2 | decimal> 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 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 outer corner rounding radius.
vr2<decimal-list-4 | decimal> The 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 round and 1 for chamfer.
vrm1<integer> The outer corner radius mode.
vrm2<integer> The core corner radius mode.
center<boolean> Center about origin.

Thickness t

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

Object example

rectangle_c( size=[40,25], t=[15,5], vr1=[0,0,10,10], vr2=2.5, vrm2=3, co=[0,5], center=true );
module rectangle_c(size=1, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
A rectangle with a removed rectangular core.
Definition: common_2d.scad:595
rectangle_c

Object example

torus_rectangle_c( size=[40,20], core=[35,20], r=40, l=[90,60], co=[0,2.5], vr=4, vrm=15, m=63, center=true );
module torus_rectangle_c(r, pa=0, ra=360, l, m=255, size, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
A rectangular cross-sectional profile revolved about the z-axis.
Definition: revolved.scad:458
torus_rectangle_c

Definition at line 457 of file revolved.scad.

+ Here is the call graph for this function:

◆ torus_ellipse_cs()

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

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

Translate, rotate, and revolve a 2d shape about the z-axis with linear elongation.

Parameters
r<decimal> The rotation radius.
pa<decimal> The profile pitch angle in degrees.
ra<decimal> The rotation sweep angle in degrees.

Object example

extrude_rotate_tr( r=50, pa=45, ra=270 ) square( [10,5], center=true );
extrude_rotate_tr
Parameters
l<decimal-list-2 | decimal> The elongation length. A list [x, y] of decimals or a single decimal for (x=y)
m<integer> The section render mode. An 8-bit encoded integer that indicates the revolution sections to render. Bit values 1 enables the corresponding section and bit values 0 are disabled. Sections are assigned to the bit position in counter-clockwise order.

When the parameter l is not specified, the shape profile is revolved using extrude_rotate_tr(). When the parameter l is specified, the shape profile may be linearly extruded along the the x-axis and y-axis, with the linear extrusion lengths specified by l, and is revolved 90 degrees to transition between the axes. In this mode, the parameter ra is defined to be 90 for all corners and the parameter m controls which of the eight path sections to render during the 360 degree revolution.

Object example

extrude_rotate_trl( r=25, l=[5, 50], pa=45, m=31 ) square( [10,5], center=true );
extrude_rotate_trl

A sector of an ellipse with a removed elliptical core.

Parameters
size<decimal-list-2 | decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry).
core<decimal-list-2 | decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry).
t<decimal-list-2 | decimal> A list [x, y] of decimals or a single decimal for (x=y).
a1<decimal> The start angle in degrees.
a2<decimal> The stop angle in degrees.
co<decimal-list-2> Core offset. A list [x, y] of decimals.
cr<decimal> Core z-rotation.

Thickness t

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

Object example

ellipse_cs( size=[25,40], t=[10,5], a1=90, a2=180, co=[10,0], cr=45);
module ellipse_cs(size=1, core, t, a1=0, a2=0, co, cr=0)
A sector of an ellipse with a removed elliptical core.
Definition: common_2d.scad:963
ellipse_cs

Object example

torus_ellipse_cs( size=[20,15], t=[2,4], r=50, a1=0, a2=180, pa=90, ra=270, co=[0,2] );
module torus_ellipse_cs(r, pa=0, ra=360, l, m=255, size, core, t, a1=0, a2=0, co, cr=0)
An elliptical cross-sectional profile revolved about the z-axis.
Definition: revolved.scad:506
torus_ellipse_cs

Definition at line 505 of file revolved.scad.

+ Here is the call graph for this function:

◆ torus_pg_trapezoid()

module torus_pg_trapezoid ( ,
pa  = 0,
ra  = 360,
,
= 255,
= 1,
,
sl  = 1,
= 90,
vr  ,
vrm  = 1,
vfn  ,
center  = false 
)

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

Translate, rotate, and revolve a 2d shape about the z-axis with linear elongation.

Parameters
r<decimal> The rotation radius.
pa<decimal> The profile pitch angle in degrees.
ra<decimal> The rotation sweep angle in degrees.

Object example

extrude_rotate_tr( r=50, pa=45, ra=270 ) square( [10,5], center=true );
extrude_rotate_tr
Parameters
l<decimal-list-2 | decimal> The elongation length. A list [x, y] of decimals or a single decimal for (x=y)
m<integer> The section render mode. An 8-bit encoded integer that indicates the revolution sections to render. Bit values 1 enables the corresponding section and bit values 0 are disabled. Sections are assigned to the bit position in counter-clockwise order.

When the parameter l is not specified, the shape profile is revolved using extrude_rotate_tr(). When the parameter l is specified, the shape profile may be linearly extruded along the the x-axis and y-axis, with the linear extrusion lengths specified by l, and is revolved 90 degrees to transition between the axes. In this mode, the parameter ra is defined to be 90 for all corners and the parameter m controls which of the eight path sections to render during the 360 degree revolution.

Object example

extrude_rotate_trl( r=25, l=[5, 50], pa=45, m=31 ) square( [10,5], center=true );
extrude_rotate_trl

A polygon trapezoid with individual vertex rounding and arc facets.

Parameters
b<decimal-list-2 | decimal> The base lengths. A list [b1, b2] of 2 decimals or a single decimal for (b1=b2).
h<decimal> The perpendicular height between bases. Takes precedence over l when both are specified. When neither h nor l is specified, l defaults to 1.
l<decimal> The left side leg length. Used only when h is not specified; the resulting height is l × sin(a).
a<decimal> The angle in degrees between the lower base and the left leg. When h is specified, restricted to [45, 135] to keep the upper-left vertex above the lower base.
o<point-2d> The origin offset coordinate [x, y].
cw<boolean> Polygon vertex ordering.
Returns
<points-2d> A list of exactly 4 coordinate points [[x, y], ...] defining the trapezoid vertices.

The four vertices are computed from the origin o as follows: p1 = o (lower-left), p2 = upper-left leg endpoint, p3 = p2 + [b2, 0] (upper-right), p4 = o + [b1, 0] (lower-right). The lower base has length b1 and the upper base has length b2.

When both h and l are specified, h takes precedence and the actual leg length is derived from h and a. When only l is given, the perpendicular height is l × sin(a). If h is specified, the angle a is restricted to the range [45, 135] to keep the upper-left vertex above the lower base.

Special cases: when b is a single decimal (b1 = b2) and a = 90 the result is a rectangle; when additionally b1 = h the result is a square. When a ≠ 90 and b1 = b2 the result is a parallelogram.

See Wikipedia for more general information on trapezoids.

Parameters
vr<decimal-list-4 | decimal> The vertices rounding radius.
vrm<integer-list-4 | integer> The vertices rounding mode.
vfn<integer-list-4> The vertices arc fragment number.
center<boolean> Center origin at trapezoid centroid.

Each vertex may be assigned an individual rounding radius, rounding mode, and facet number as described in polygon_round_eve_all_p by using the parameters: vr, vrm, and vfn. When vr is undefined, no rounding is performed on the polygon vertices.

Object example

pg_trapezoid( b=[50,20], l=25, a=45, vr=2, center=true);
module pg_trapezoid(b=1, h, l=1, a=90, o=origin2d, vr, vrm=1, vfn, center=false)
A polygon trapezoid with individual vertex rounding and arc facets.
Definition: polygon.scad:724
pg_trapezoid
Parameters
sl<decimal> The left side leg length of the trapezoid polygon l.

Object example

torus_pg_trapezoid( b=[20,30], sl=30, a=45, vr=[5,5,5,5], vrm=[2,1,4,3], r=40, l=[90,60], m=63, center=true );
module torus_pg_trapezoid(r, pa=0, ra=360, l, m=255, b=1, h, sl=1, a=90, vr, vrm=1, vfn, center=false)
A trapezoidal cross-sectional profile revolved about the z-axis.
Definition: revolved.scad:550
torus_pg_trapezoid

Definition at line 549 of file revolved.scad.

+ Here is the call graph for this function: