omdl
v0.6.1
OpenSCAD Mechanical Design Library
|
Mathematical functions for other shapes. More...
Files | |
file | math_oshapes.scad |
Other shapes mathematical functions. | |
Functions | |
function | rpolygon_lp (n, r, a, vr, cw=true) |
Compute the coordinates for an n-sided regular polygon. More... | |
function | rpolygon_area (n, r, a) |
Compute the area of an n-sided regular polygon. More... | |
function | rpolygon_perimeter (n, r, a) |
Compute the perimeter of an n-sided regular polygon. More... | |
Mathematical functions for other shapes.
function rpolygon_area | ( | n | , |
r | , | ||
a | |||
) |
Compute the area of an n-sided regular polygon.
n | <integer> The number of sides. |
r | <decimal> The vertex circumradius of the circumcircle. |
a | <decimal> The inradius of the incircle. |
The radius can be specified by either the circumradius r
or the inradius a
. If both are specified, r
is used.
function rpolygon_lp | ( | n | , |
r | , | ||
a | , | ||
vr | , | ||
cw | = true |
||
) |
Compute the coordinates for an n-sided regular polygon.
n | <integer> The number of sides. |
r | <decimal> The vertex circumradius of the circumcircle. |
a | <decimal> The inradius of the incircle. |
vr | <decimal> The vertex rounding radius. |
cw | <boolean> Use clockwise point ordering. |
The radius can be specified by either the circumradius r
or the inradius a
. If both are specified, r
is used.
Example
function rpolygon_perimeter | ( | n | , |
r | , | ||
a | |||
) |
Compute the perimeter of an n-sided regular polygon.
n | <integer> The number of sides. |
r | <decimal> The vertex circumradius of the circumcircle. |
a | <decimal> The inradius of the incircle. |
The radius can be specified by either the circumradius r
or the inradius a
. If both are specified, r
is used.