![]() |
omdl
v0.9.8
OpenSCAD Mechanical Design Library
|
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... | |
Basic 2D shape.
| Requires: |
|---|
| include <omdl-base.scad>; |
| I | II | III |
|---|---|---|
![]() | ![]() | ![]() |
| IV | V | VI |
![]() | ![]() | ![]() |
| VII | VIII | IX |
![]() | ![]() | ![]() |
| module ellipse | ( | size | ) |
An ellipse.
| size | <decimal-list-2 | decimal> A list [rx, ry] of decimals or a single decimal for (rx=ry). |
Object example
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:| module ellipse_c | ( | size | , |
| core | , | ||
| t | , | ||
| co | , | ||
| cr | = 0 |
||
| ) |
An ellipse with a removed elliptical core.
| 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
Definition at line 842 of file basic_2d.scad.
Here is the call graph for this function:| module ellipse_cs | ( | size | , |
| core | , | ||
| t | , | ||
| a1 | = 0, |
||
| a2 | = 0, |
||
| co | , | ||
| cr | = 0 |
||
| ) |
A sector of an ellipse with a removed elliptical core.
| 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
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:| module ellipse_s | ( | size | , |
| a1 | = 0, |
||
| a2 | = 0 |
||
| ) |
An ellipse sector.
| 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
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:| module ngon | ( | n | , |
| r | , | ||
| vr | |||
| ) |
An n-sided equiangular/equilateral regular polygon.
| n | <integer> The number of sides. |
| r | <decimal> The ngon vertex radius. |
| vr | <decimal> The vertex rounding radius. |
Object example
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:| module rectangle | ( | size | , |
| vr | , | ||
| vrm | = 0, |
||
| center | = false |
||
| ) |
A rectangle with corner rounds or chamfers.
| 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
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:| 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.
| 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
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:| module rhombus | ( | size | , |
| vr | , | ||
| center | = false |
||
| ) |
A rhombus.
| 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
See Wikipedia for more information.
Definition at line 664 of file basic_2d.scad.
Here is the call graph for this function:
Here is the caller graph for this function:| module star2d | ( | size | , |
| n | = 5, |
||
| vr | |||
| ) |
A two-dimensional star.
| 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
Definition at line 1011 of file basic_2d.scad.
Here is the call graph for this function: