omdl  v0.5
OpenSCAD Mechanical Design Library
Extrusions

Shape Extrusions. More...

+ Collaboration diagram for Extrusions:

Files

file  transform.scad
 Shape transformation functions.
 

Functions

module st_rotate_extrude (r, pa=0, ra=360, profile=false)
 Revolve the 2D shape about the z-axis. More...
 
module st_rotate_extrude_elongate (r, l, pa=0, ra=360, m=255, profile=false)
 Revolve the 2D shape about the z-axis with linear elongation. More...
 
module st_linear_extrude_scale (h, center=false)
 Linearly extrude 2D shape with extrusion upper and lower scaling. More...
 

Detailed Description

Shape Extrusions.

Function Documentation

module st_linear_extrude_scale ( ,
center  = false 
)

Linearly extrude 2D shape with extrusion upper and lower scaling.

Parameters
h<vector|decimal> A vector of decimals or a single decimal to specify simple extrusion height.
center<boolean> Center extrusion about origin.

When h is a decimal, the shape is extruded linearly as normal. To scale the upper and lower slices of the extrusion, h must be assigned a vector with a minimum of three decimal values as described in the following table.

sym h[n] default description
h 0 total extrusion height
n1 1 (+z) number of scaled extrusion slices
h1 2 (+z) extrusion scale percentage
x1 3 -h1 (+z) x-dimension scale percentage
y1 4 x1 (+z) y-dimension scale percentage
n2 5 n1 (-z) number of scaled extrusion slices
h2 6 h1 (-z) extrusion scale percentage
x2 7 x1 (-z) x-dimension scale percentage
y2 8 y1 (-z) y-dimension scale percentage

Example

transform_dim_qvga_diag_st_linear_extrude_scale.png
st_linear_extrude_scale
1  st_linear_extrude_scale( [5,10,15,-5], center=true ) square( [20,15], center=true );

Note
When symmetrical scaling is desired, shape must be centered about origin.

Definition at line 230 of file transform.scad.

module st_rotate_extrude ( ,
pa  = 0,
ra  = 360,
profile  = false 
)

Revolve the 2D shape about the z-axis.

Parameters
r<decimal> The rotation radius.
pa<decimal> The profile pitch angle in degrees.
ra<decimal> The rotation sweep angle in degrees.
profile<boolean> Show profile only (do not extrude).

Example

transform_dim_qvga_diag_st_rotate_extrude.png
st_rotate_extrude
1  st_rotate_extrude( r=50, pa=45, ra=270 ) square( [10,5], center=true );

Definition at line 103 of file transform.scad.

module st_rotate_extrude_elongate ( ,
,
pa  = 0,
ra  = 360,
= 255,
profile  = false 
)

Revolve the 2D shape about the z-axis with linear elongation.

Parameters
r<decimal> The rotation radius.
l<vector|decimal> The elongation length. A vector [x, y] of decimals or a single decimal for (x=y)
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. Bit values 1 enables the corresponding section and bit values 0 are disabled. Sections are assigned to the bit position in counter-clockwise order.
profile<boolean> Show profile only (do not extrude).

Example

transform_dim_qvga_diag_st_rotate_extrude_elongate.png
st_rotate_extrude_elongate
1  st_rotate_extrude_elongate( r=25, l=[5, 50], pa=45, m=31 ) square( [10,5], center=true );

Note
When elongating (l > 0), ra is ignored. However, m may be used to control which complete revolution section to render.

Definition at line 139 of file transform.scad.