omdl  v0.9.5
OpenSCAD Mechanical Design Library
Extrude

Shape extrusion tools. More...

+ Collaboration diagram for Extrude:

Files

file  extrude.scad
 Shape extrusion tools.
 

Functions

module extrude_rotate_tr (r, pa=0, ra=360)
 Translate, rotate, and revolve a 2d shape about the z-axis. More...
 
module extrude_rotate_trs (r, pa=0, ra=360, s, m=0)
 Translate, rotate, scale, and revolve a 2d shape about the z-axis. More...
 
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. More...
 
module extrude_linear_uss (h, center=false, c=true, ha=0)
 Linearly extrude a 2d shape with uniformly-spaced profile scaling. More...
 
module extrude_linear_mss (h, center=false, c=true)
 Linearly extrude a 2d shape with multi-segment uniformly-spaced profile scaling. More...
 

Detailed Description

Shape extrusion tools.

Requires:
include <omdl-base.scad>;
Extrude
IIIIII
extrude_linear_mss()
extrude_linear_uss()
extrude_rotate_tr()
IVV
extrude_rotate_trl()
extrude_rotate_trs()

Function Documentation

◆ extrude_linear_mss()

module extrude_linear_mss ( ,
center  = false,
= true 
)

Linearly extrude a 2d shape with multi-segment uniformly-spaced profile scaling.

Parameters
h<datastruct-list-n | decimal> A data structure or a single decimal.
center<boolean> Center extrusion about origin.
c<boolean> conditional.

When c is true, apply the transformation to the children objects, otherwise return the children unmodified.

Data structure syntax

The scaled extrusion can be divided across as many segments (n) as desired with each being specified by a data structure using the syntax of the function extrude_linear_uss(). Scaling for multiple segments are placed in a list and each segment is processed sequentially, in the listed order, until all n-segments have been linearly extruded and stacked.

Note
As with extrude_linear_uss(), each scale factor can be either a single decimal or a list of two decimals to scale x and y independently. When the scale factor is a single decimal, both dimensions are scaled equally.

Object example

extrude_linear_mss( h=[[10, [1.25, 1]], 20, [35, [for (i=[90:-1:10]) sin(i)]]], center=true) circle(15);
module extrude_linear_mss(h, center=false, c=true)
Linearly extrude a 2d shape with multi-segment uniformly-spaced profile scaling.
Definition: extrude.scad:748
extrude_linear_mss

Definition at line 747 of file extrude.scad.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extrude_linear_uss()

module extrude_linear_uss ( ,
center  = false,
= true,
ha  = 0 
)

Linearly extrude a 2d shape with uniformly-spaced profile scaling.

Parameters
h<datastruct | decimal> A data structure or a single decimal.
center<boolean> Center extrusion about origin.
c<boolean> conditional.
ha<decimal> An extrusion height adjustment value.

When c is true, apply the transformation to the children objects, otherwise return the children unmodified.

Data structure syntax

h[n] type description
0 <decimal> total extrusion height
1 <decimal-list-n> list of one or more scale factors

Each scale factor can be either a single decimal or a list of two decimals to scale x and y independently. When the scale factor is a single decimal, both dimensions are scaled equally.

When h is a decimal, or a list with a single decimal, the shape is linearly extruded to the height specified by the decimal value without scaling. When h is a list, the first element of h specifies the extrusion height and the second element of h specifies the scale factor, or scale factors in the case that the second element is a list, When s list of scaling factors is specified, the scale factors are applied sequentially with uniform spacing along the linear extrusion height.

Note
The parameter ha may be used to add (small) values to the extrusion height to construct overlapping shapes when multiple extrusions are stacked.

Object example

extrude_linear_uss( [10, [1,1/2,[1,1/2],[1/4,1/2]]], center=true) circle( d=10 );
module extrude_linear_uss(h, center=false, c=true, ha=0)
Linearly extrude a 2d shape with uniformly-spaced profile scaling.
Definition: extrude.scad:666
extrude_linear_uss

Definition at line 665 of file extrude.scad.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extrude_rotate_tr()

module extrude_rotate_tr ( ,
pa  = 0,
ra  = 360 
)

Translate, rotate, and revolve a 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.

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

Definition at line 456 of file extrude.scad.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extrude_rotate_trl()

module extrude_rotate_trl ( ,
pa  = 0,
ra  = 360,
,
= 255 
)

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 );
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

Definition at line 561 of file extrude.scad.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extrude_rotate_trs()

module extrude_rotate_trs ( ,
pa  = 0,
ra  = 360,
,
= 0 
)

Translate, rotate, scale, and revolve a 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.

Object example

extrude_rotate_tr( r=50, pa=45, ra=270 ) square( [10,5], center=true );
extrude_rotate_tr
Parameters
s<decimal-list-2 | decimal> The start and end scale factor. A list [s1, s2] of decimals or a single decimal for (s1=s2)
m<integer> The facet number mode (either 0 or 1). With m = 1, fewer scaled-steps are generated during the revolution.

When the parameter s is not specified, the shape profile is revolved using extrude_rotate_tr(). When the parameter s is specified, the shape profile is scaled from s1 to s2 along the revolution path.

Object example

extrude_rotate_trs( r=50, pa=45, ra=180, s=[1, 3] ) circle( 5, center=true );
module extrude_rotate_trs(r, pa=0, ra=360, s, m=0)
Translate, rotate, scale, and revolve a 2d shape about the z-axis.
Definition: extrude.scad:494
extrude_rotate_trs

Definition at line 493 of file extrude.scad.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: