145 assert( (rx <= 0) || (rx > 0) && (rx >= sx),
"(+) x-radius less than x-side" );
146 assert( (ry <= 0) || (ry > 0) && (ry >= sy),
"(+) y-radius less than y-side" );
148 cwx = (ry > 0) ?
true :
false;
149 cwy = (rx > 0) ?
true :
false;
153 [
"arc_pv", [[ 0, +ry], [-sx, +sy]/2, cwx]],
154 [
"arc_pv", [[-rx, 0], [-sx, -sy]/2, cwy]],
155 [
"arc_pv", [[ 0, -ry], [+sx, -sy]/2, cwx]],
156 [
"arc_pv", [[+rx, 0], [+sx, +sy]/2, cwy]]
161 p = (center ==
true) && is_undef( o ) ? c
162 : (center ==
true) && !is_undef( o ) ?
translate_p(c, o)
163 : (center == false) && is_undef( o ) ?
translate_p(c, [sx, sy]/2)
268 ? [[-rx,-ry], [-rx,ry], [rx,ry], [rx,-ry]]/2
269 : [[0,0], [0,ry], [rx,ry], [rx,0]];
309 ? [[-rx,0], [0,ry], [rx,0], [0,-ry]]
310 : [[rx*2,ry], [rx,ry*2], [0,ry], [rx,0]];
346 z = (center ==
true) ?
origin2d : [r, r];
413 l = (cm == 0) ? undef
x_axis_ci
<integer> The coordinate axis index for the Euclidean space x-axis.
origin2d
<point-2d> The origin point coordinate in 2d Euclidean space.
x_axis2d_uv
<vector-2d> The unit vector of the positive x-axis in 2d Euclidean space.
y_axis2d_uv
<vector-2d> The unit vector of the positive y-axis in 2d Euclidean space.
grid_fine
OpenSCAD fine grid limit.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not defined.
function translate_p(c, v)
Translate all coordinates dimensions.
function polygon_trapezoid_p(b=1, h, l=1, a=90, o=origin2d, cw=true)
Compute the coordinates for a rounded trapezoid in 2D space.
function polygon_regular_p(n, r, a, c=origin2d, o=0, vr, cw=true)
Compute coordinates for an n-sided regular polygon in 2D.
function polygon_round_eve_all_p(c, vr=0, vrm=1, vfn, w=true, cw=true)
Compute coordinates that round all of the vertices between each adjacent edges in 2D.
function polygon_round_eve_p(r=1, m=1, c=origin2d, v1=x_axis2d_uv, v2=y_axis2d_uv, fn, cw=true)
Compute coordinates for a constant radius vertex round between two edge vectors in 2D.
function polygon_centroid(c, p)
Compute the center of mass of a polygon in a Euclidean 2d-space.
function polygon_turtle_p(s, i=origin2d, c=0)
Generate list of coordinate points from simple operation step notation.
function polygon_elliptical_sector_p(r=1, c=origin2d, v1=x_axis2d_uv, v2=x_axis2d_uv, s=true, fn, cw=true)
Compute coordinates for an elliptical sector in 2D.
function triangle_sas2sss(v)
Compute the side lengths of a triangle given two sides and the included angle.
function triangle_asa2sss(v)
Compute the side lengths of a triangle given a side and two adjacent angles.
function triangle_centroid(c, d=2)
Compute the centroid of a triangle.
function triangle_aas2sss(v)
Compute the side lengths of a triangle given a side, one adjacent and the opposite angle.
function triangle_circumcenter(c, d=2)
Compute the coordinate of a triangle's circumcenter.
function triangle2d_sss2ppp(v, a=x_axis_ci, cw=true)
Compute a set of vertex coordinates for a triangle given its side lengths in 2D.
function triangle2d_incenter(c)
Compute the center coordinate of a triangle's incircle in 2D.
module pg_ngon(n=3, r=1, o, vr, vrm=1, vfn, center=true)
A n-sided regular polygon with vertex rounding.
module pg_trapezoid(b=1, h, l=1, a=90, o=origin2d, vr, vrm=1, vfn, center=false)
A polygon trapezoid with individual vertex rounding and arc facets.
module pg_elliptical_sector(r=1, c=origin2d, v1=x_axis2d_uv, v2=x_axis2d_uv, s=true)
A polygon elliptical sector.
module pg_rectangle_rs(size=1, o, sr, center=false)
A polygon rectangle with side rounding.
module pg_corner_round(r=1, m=1, c=origin2d, v1=x_axis2d_uv, v2=y_axis2d_uv)
A polygon edge round with constant radius between two vectors.
module pg_triangle_sas(v, a=x_axis_ci, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by size-angle-size with vertex rounding.
module pg_rhombus(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rhombus with vertex rounding.
module pg_triangle_asa(v, a=x_axis_ci, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by angle-size-angle with vertex rounding.
module pg_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.
module pg_triangle_sss(v, a=x_axis_ci, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by three side lengths with vertex rounding.
module pg_triangle_ppp(c, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by three coordinate points with vertex rounding.
module pg_triangle_aas(v, a=x_axis_ci, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by angle-angle-size with vertex rounding.