omdl  v0.6.1
OpenSCAD Mechanical Design Library
2d Extrusions

Extruded two-dimensional geometric shapes. More...

+ Collaboration diagram for 2d Extrusions:

Files

file  shapes2de.scad
 Linearly extruded two-dimensional basic shapes.
 

Functions

module erectangle (size, h, vr, vrm=0, center=false)
 An extruded rectangle with edge, fillet, and/or chamfer corners. More...
 
module erectangle_c (size, core, h, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
 An extruded rectangle with a removed rectangular core. More...
 
module erhombus (size, h, vr, center=false)
 An extruded rhombus. More...
 
module etriangle_ppp (v1, v2, v3, h, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by three vertices. More...
 
module etriangle_lp (v, h, vr, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by a list of its three vertices. More...
 
module etriangle_sss (s1, s2, s3, h, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by its three side lengths. More...
 
module etriangle_ls (v, h, vr, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by a list of its three side lengths. More...
 
module etriangle_ls_c (vs, vc, h, co, cr=0, vr, vr1, vr2, centroid=false, incenter=false, center=false)
 A general triangle specified by its sides with a removed triangular core. More...
 
module etriangle_sas (s1, a, s2, h, x=1, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by two sides and the included angle. More...
 
module etriangle_asa (a1, s, a2, h, x=1, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by a side and two adjacent angles. More...
 
module etriangle_aas (a1, a2, s, h, x=1, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded general triangle specified by a side, one adjacent angle and the opposite angle. More...
 
module etriangle_ss (x, y, h, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded right-angled triangle specified by its opposite and adjacent side lengths. More...
 
module etriangle_sa (x, y, aa, oa, h, vr, v1r, v2r, v3r, centroid=false, incenter=false, center=false)
 An extruded right-angled triangle specified by a side length and an angle. More...
 
module engon (n, r, h, vr, center=false)
 An extruded n-sided equiangular/equilateral regular polygon. More...
 
module eellipse (size, h, center=false)
 An extruded ellipse. More...
 
module eellipse_c (size, core, h, t, co, cr=0, center=false)
 An extruded ellipse with a removed elliptical core. More...
 
module eellipse_s (size, h, a1=0, a2=0, center=false)
 An extruded ellipse sector. More...
 
module eellipse_cs (size, core, h, t, a1=0, a2=0, co, cr=0, center=false)
 An extruded sector of an ellipse with a removed elliptical core. More...
 
module estar2d (size, h, n=5, vr, center=false)
 An extruded two-dimensional star. More...
 

Detailed Description

Extruded two-dimensional geometric shapes.

Function Documentation

module eellipse ( size  ,
,
center  = false 
)

An extruded ellipse.

Parameters
size<decimal-list-2|decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_eellipse.png
eellipse
1  eellipse( size=[25, 40], h=20, center=true );

Definition at line 777 of file shapes2de.scad.

+ Here is the call graph for this function:

module eellipse_c ( size  ,
core  ,
,
,
co  ,
cr  = 0,
center  = false 
)

An extruded 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).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
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.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Thickness t

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

Example

shapes2de_dim_qvga_diag_eellipse_c.png
eellipse_c
1  eellipse_c( size=[25,40], core=[16,10], co=[0,10], cr=45, h=20, center=true );

Definition at line 817 of file shapes2de.scad.

+ Here is the call graph for this function:

module eellipse_cs ( size  ,
core  ,
,
,
a1  = 0,
a2  = 0,
co  ,
cr  = 0,
center  = false 
)

An extruded 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).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
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.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Thickness t

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

Example

shapes2de_dim_qvga_diag_eellipse_cs.png
eellipse_cs
1  eellipse_cs( size=[25,40], t=[10,5], a1=90, a2=180, co=[10,0], cr=45, h=20, center=true );

Definition at line 897 of file shapes2de.scad.

+ Here is the call graph for this function:

module eellipse_s ( size  ,
,
a1  = 0,
a2  = 0,
center  = false 
)

An extruded ellipse sector.

Parameters
size<decimal-list-2|decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
a1<decimal> The start angle in degrees.
a2<decimal> The stop angle in degrees.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_eellipse_s.png
eellipse_s
1  eellipse_s( size=[25,40], h=20, a1=90, a2=180, center=true );

Definition at line 852 of file shapes2de.scad.

+ Here is the call graph for this function:

module engon ( ,
,
,
vr  ,
center  = false 
)

An extruded n-sided equiangular/equilateral regular polygon.

Parameters
n<decimal> The number of sides.
r<decimal> The ngon vertex radius.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal> The vertex rounding radius.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_engon.png
engon
1  engon( n=6, r=25, h=20, vr=6, center=true );

See Wikipedia for more information.

Definition at line 747 of file shapes2de.scad.

+ Here is the call graph for this function:

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

An extruded rectangle with edge, fillet, and/or chamfer corners.

Parameters
size<decimal-list-2|decimal> A list [x, y] of decimals or a single decimal for (x=y).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal-list-4|decimal> The 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.
vrm<integer> The corner radius mode. A 4-bit encoded integer that indicates each corner finish. Use bit value 0 for fillet and 1 for chamfer.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_erectangle.png
erectangle
1  erectangle( size=[25,40], vr=5, vrm=3, h=20, center=true );

Definition at line 114 of file shapes2de.scad.

+ Here is the call graph for this function:

module erectangle_c ( size  ,
core  ,
,
,
co  ,
cr  = 0,
vr  ,
vr1  ,
vr2  ,
vrm  = 0,
vrm1  ,
vrm2  ,
center  = false 
)

An extruded 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).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
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 fillet and 1 for chamfer.
vrm1<integer> The outer corner radius mode.
vrm2<integer> The core corner radius mode.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Thickness t

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

Example

shapes2de_dim_qvga_diag_erectangle_c.png
erectangle_c
1  erectangle_c( size=[40,20], t=[10,1], co=[0,-6], cr=10, vr=5, vrm1=12, h=30, center=true );

Definition at line 168 of file shapes2de.scad.

+ Here is the call graph for this function:

module erhombus ( size  ,
,
vr  ,
center  = false 
)

An extruded rhombus.

Parameters
size<decimal-list-2|decimal> A list [w, h] of decimals or a single decimal for (w=h).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal-list-4|decimal> The 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.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_erhombus.png
erhombus
1  erhombus( size=[40,25], h=10, vr=[3,0,3,9], center=true );

Definition at line 217 of file shapes2de.scad.

+ Here is the call graph for this function:

module estar2d ( size  ,
,
= 5,
vr  ,
center  = false 
)

An extruded two-dimensional star.

Parameters
size<decimal-list-2|decimal> A list [l, w] of decimals or a single decimal for (size=l=2*w).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
n<decimal> The number of points.
vr<decimal-list-3|decimal> The vertex rounding radius. A list [v1r, v2r, v3r] of decimals or a single decimal for (v1r=v2r=v3r).
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_estar2d.png
estar2d
1  estar2d( size=[40, 15], h=15, n=5, vr=2, center=true );

Definition at line 937 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_aas ( a1  ,
a2  ,
,
,
= 1,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by a side, one adjacent angle and the opposite angle.

Parameters
a1<decimal> The opposite angle 1 in degrees.
a2<decimal> The adjacent angle 2 in degrees.
s<decimal> The side length.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
x<decimal> The side to draw on the positive x-axis (x=1 for s).
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_aas.png
etriangle_aas
1  etriangle_aas( a1=60, a2=30, s=40, h=20, vr=2, centroid=true, center=true );

Definition at line 599 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_asa ( a1  ,
,
a2  ,
,
= 1,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by a side and two adjacent angles.

Parameters
a1<decimal> The adjacent angle 1 in degrees.
s<decimal> The side length adjacent to the angles.
a2<decimal> The adjacent angle 2 in degrees.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
x<decimal> The side to draw on the positive x-axis (x=1 for s).
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_asa.png
etriangle_asa
1  etriangle_asa( a1=30, s=50, a2=60, h=20, vr=2, centroid=true, center=true );

Definition at line 546 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_lp ( ,
,
vr  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by a list of its three vertices.

Parameters
v<point-2d-list-3> A list [v1, v2, v3] of points [x, y].
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal-list-3|decimal> The vertex rounding radius. A list [v1r, v2r, v3r] of decimals or a single decimal for (v1r=v2r=v3r).
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

t = triangle_sss2lp( 30, 40, 50 );
r = [2, 4, 6];
etriangle_lp( v=t, h=5, vr=r );

Definition at line 304 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_ls ( ,
,
vr  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by a list of its three side lengths.

Parameters
v<decimal-list-3> A list [s1, s2, s3] of decimals.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal-list-3|decimal> The vertex rounding radius. A list [v1r, v2r, v3r] of decimals or a single decimal for (v1r=v2r=v3r).
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

t = triangle_sss2lp( 3, 4, 5 );
s = triangle_lp2ls( t );
etriangle_ls( v=s, h=5, vr=2 );

Definition at line 393 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_ls_c ( vs  ,
vc  ,
,
co  ,
cr  = 0,
vr  ,
vr1  ,
vr2  ,
centroid  = false,
incenter  = false,
center  = false 
)

A general triangle specified by its sides with a removed triangular core.

Parameters
vs<decimal-list-3|decimal> The size. A list [s1, s2, s3] of decimals or a single decimal for (s1=s2=s3).
vc<decimal-list-3|decimal> The core. A list [s1, s2, s3] of decimals or a single decimal for (s1=s2=s3).
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
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.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_ls_c.png
etriangle_ls_c
1  etriangle_ls_c(vs=50, vc=30, h=15, co=[0,-10], cr=180, vr=[2,2,8], centroid=true, center=true);

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

Definition at line 440 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_ppp ( v1  ,
v2  ,
v3  ,
,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by three vertices.

Parameters
v1<point-2d> A point [x, y] for vertex 1.
v2<point-2d> A point [x, y] for vertex 2.
v3<point-2d> A point [x, y] for vertex 3.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_ppp.png
etriangle_ppp
1  etriangle_ppp( v1=[0,0], v2=[5,25], v3=[40,5], h=20, vr=2, centroid=true, center=true );

Definition at line 254 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_sa ( ,
,
aa  ,
oa  ,
,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded right-angled triangle specified by a side length and an angle.

Parameters
x<decimal> The length of the side along the x-axis.
y<decimal> The length of the side along the y-axis.
aa<decimal> The adjacent angle in degrees.
oa<decimal> The opposite angle in degrees.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_sa.png
etriangle_sa
1  etriangle_sa( x=40, aa=30, h=20, vr=2, centroid=true, center=true );

Note
When both x and y are given, both triangles are rendered.
When both aa and oa are given, aa is used.

Definition at line 700 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_sas ( s1  ,
,
s2  ,
,
= 1,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by two sides and the included angle.

Parameters
s1<decimal> The length of the side 1.
a<decimal> The included angle in degrees.
s2<decimal> The length of the side 2.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
x<decimal> The side to draw on the positive x-axis (x=1 for s1).
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_sas.png
etriangle_sas
1  etriangle_sas( s1=50, a=60, s2=30, h=20, vr=2, centroid=true, center=true );

Definition at line 493 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_ss ( ,
,
,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded right-angled triangle specified by its opposite and adjacent side lengths.

Parameters
x<decimal> The length of the side along the x-axis.
y<decimal> The length of the side along the y-axis.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_ss.png
etriangle_ss
1  etriangle_ss( x=30, y=40, h=20, vr=2, centroid=true, center=true );

Definition at line 648 of file shapes2de.scad.

+ Here is the call graph for this function:

module etriangle_sss ( s1  ,
s2  ,
s3  ,
,
vr  ,
v1r  ,
v2r  ,
v3r  ,
centroid  = false,
incenter  = false,
center  = false 
)

An extruded general triangle specified by its three side lengths.

Parameters
s1<decimal> The length of the side 1 (along the x-axis).
s2<decimal> The length of the side 2.
s3<decimal> The length of the side 3.
h<decimal-list-3:9|decimal> A list of decimals or a single decimal to specify simple extrusion height.
vr<decimal> The default vertex rounding radius.
v1r<decimal> Vertex 1 rounding radius.
v2r<decimal> Vertex 2 rounding radius.
v3r<decimal> Vertex 3 rounding radius.
centroid<boolean> Center centroid at origin.
incenter<boolean> Center incenter at origin.
center<boolean> Center about origin.
See also
linear_extrude_uls for a description on specifying h.

Example

shapes2de_dim_qvga_diag_etriangle_sss.png
etriangle_sss
1  etriangle_sss( s1=30, s2=40, s3=50, h=20, vr=2, centroid=true, center=true );

Definition at line 343 of file shapes2de.scad.

+ Here is the call graph for this function: