omdl
v0.9.5
OpenSCAD Mechanical Design Library
|
Shape extrusion tools. More...
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... | |
Shape extrusion tools.
Requires: |
---|
include <omdl-base.scad>; |
I | II | III |
---|---|---|
IV | V | |
module extrude_linear_mss | ( | h | , |
center | = false , |
||
c | = true |
||
) |
Linearly extrude a 2d shape with multi-segment uniformly-spaced profile scaling.
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.
Object example
Definition at line 747 of file extrude.scad.
module extrude_linear_uss | ( | h | , |
center | = false , |
||
c | = true , |
||
ha | = 0 |
||
) |
Linearly extrude a 2d shape with uniformly-spaced profile scaling.
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.
ha
may be used to add (small) values to the extrusion height to construct overlapping shapes when multiple extrusions are stacked.Object example
Definition at line 665 of file extrude.scad.
module extrude_rotate_tr | ( | r | , |
pa | = 0 , |
||
ra | = 360 |
||
) |
Translate, rotate, and revolve a 2d shape about the z-axis.
r | <decimal> The rotation radius. |
pa | <decimal> The profile pitch angle in degrees. |
ra | <decimal> The rotation sweep angle in degrees. |
Object example
Definition at line 456 of file extrude.scad.
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.
r | <decimal> The rotation radius. |
pa | <decimal> The profile pitch angle in degrees. |
ra | <decimal> The rotation sweep angle in degrees. |
Object example
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
Definition at line 561 of file extrude.scad.
module extrude_rotate_trs | ( | r | , |
pa | = 0 , |
||
ra | = 360 , |
||
s | , | ||
m | = 0 |
||
) |
Translate, rotate, scale, and revolve a 2d shape about the z-axis.
r | <decimal> The rotation radius. |
pa | <decimal> The profile pitch angle in degrees. |
ra | <decimal> The rotation sweep angle in degrees. |
Object example
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
Definition at line 493 of file extrude.scad.