omdl  v0.9.5
OpenSCAD Mechanical Design Library
Basic 2d

Basic 2D shape. More...

+ Collaboration diagram for Basic 2d:

Files

file  basic_2d.scad
 Basic 2D shapes.
 

Functions

module rectangle (size, vr, vrm=0, center=false)
 A rectangle with corner rounds or chamfers. More...
 
module rectangle_c (size, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
 A rectangle with a removed rectangular core. More...
 
module rhombus (size, vr, center=false)
 A rhombus. More...
 
module ngon (n, r, vr)
 An n-sided equiangular/equilateral regular polygon. More...
 
module ellipse (size)
 An ellipse. More...
 
module ellipse_c (size, core, t, co, cr=0)
 An ellipse with a removed elliptical core. More...
 
module ellipse_s (size, a1=0, a2=0)
 An ellipse sector. More...
 
module ellipse_cs (size, core, t, a1=0, a2=0, co, cr=0)
 A sector of an ellipse with a removed elliptical core. More...
 
module star2d (size, n=5, vr)
 A two-dimensional star. More...
 

Detailed Description

Basic 2D shape.

Requires:
include <omdl-base.scad>;
Basic 2d
IIIIII
ellipse()
ellipse_c()
ellipse_cs()
IVVVI
ellipse_s()
ngon()
rectangle()
VIIVIIIIX
rectangle_c()
rhombus()
star2d()

Function Documentation

◆ ellipse()

module ellipse ( size  )

An ellipse.

Parameters
size<decimal-list-2 | decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry).

Object example

ellipse( size=[25, 40] );
module ellipse(size)
An ellipse.
Definition: basic_2d.scad:798
ellipse

Definition at line 797 of file basic_2d.scad.

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

◆ ellipse_c()

module ellipse_c ( size  ,
core  ,
,
co  ,
cr  = 0 
)

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).
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_c( size=[25,40], core=[16,10], co=[0,10], cr=45 );
module ellipse_c(size, core, t, co, cr=0)
An ellipse with a removed elliptical core.
Definition: basic_2d.scad:843
ellipse_c

Definition at line 842 of file basic_2d.scad.

+ Here is the call graph for this function:

◆ ellipse_cs()

module ellipse_cs ( size  ,
core  ,
,
a1  = 0,
a2  = 0,
co  ,
cr  = 0 
)

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, core, t, a1=0, a2=0, co, cr=0)
A sector of an ellipse with a removed elliptical core.
Definition: basic_2d.scad:961
ellipse_cs

Definition at line 960 of file basic_2d.scad.

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

◆ ellipse_s()

module ellipse_s ( size  ,
a1  = 0,
a2  = 0 
)

An ellipse sector.

Parameters
size<decimal-list-2 | decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry).
a1<decimal> The start angle in degrees.
a2<decimal> The stop angle in degrees.

Object example

ellipse_s( size=[25,40], a1=90, a2=180 );
module ellipse_s(size, a1=0, a2=0)
An ellipse sector.
Definition: basic_2d.scad:889
ellipse_s

Definition at line 888 of file basic_2d.scad.

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

◆ ngon()

module ngon ( ,
,
vr   
)

An n-sided equiangular/equilateral regular polygon.

Parameters
n<integer> The number of sides.
r<decimal> The ngon vertex radius.
vr<decimal> The vertex rounding radius.

Object example

ngon( n=6, r=25, vr=6 );
module ngon(n, r, vr)
An n-sided equiangular/equilateral regular polygon.
Definition: basic_2d.scad:760
ngon

See Wikipedia for more information.

Definition at line 759 of file basic_2d.scad.

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

◆ rectangle()

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

A rectangle with corner rounds or chamfers.

Parameters
size<decimal-list-2 | decimal> A list [x, y] of decimals or a single decimal for (x=y).
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 round and 1 for chamfer.
center<boolean> Center about origin.

Object example

rectangle( size=[25,40], vr=[0,10,10,5], vrm=4, center=true );
module rectangle(size, vr, vrm=0, center=false)
A rectangle with corner rounds or chamfers.
Definition: basic_2d.scad:471
rectangle

Corner round is of constant radius vr. A corner chamfer replaces the last vr length of the corners edge with an isosceles right triangle with a chamfer length of (vr * sqrt(2)) cut at 45 degrees.

Definition at line 470 of file basic_2d.scad.

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

◆ rectangle_c()

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

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, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
A rectangle with a removed rectangular core.
Definition: basic_2d.scad:595
rectangle_c

Definition at line 594 of file basic_2d.scad.

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

◆ rhombus()

module rhombus ( size  ,
vr  ,
center  = false 
)

A rhombus.

Parameters
size<decimal-list-2 | decimal> A list [w, h] of decimals or a single decimal for (w=h).
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.

Object example

rhombus( size=[40,25], vr=[2,4,2,4], center=true );
module rhombus(size, vr, center=false)
A rhombus.
Definition: basic_2d.scad:665
rhombus

See Wikipedia for more information.

Definition at line 664 of file basic_2d.scad.

+ Here is the call graph for this function:

◆ star2d()

module star2d ( size  ,
= 5,
vr   
)

A two-dimensional star.

Parameters
size<decimal-list-2 | decimal> A list [l, w] of decimals or a single decimal for (size=l=2*w).
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).

Object example

star2d( size=[40, 15], n=5, vr=2 );
module star2d(size, n=5, vr)
A two-dimensional star.
Definition: basic_2d.scad:1012
star2d

Definition at line 1011 of file basic_2d.scad.

+ Here is the call graph for this function: