
polygon2d_vertices_round3_p
Description
Multi-mode Polygon Rounding Function.Round the vertices of a polygon in 2d space. Generates a new rounded polygon. #### Assumptions Assumes polygon is defined in 2D space on the x-y plane. There should be no repeating adjacent vertices along the polygon path (ie: no adjacent vertex with identical coordinates). Any vertex determined to be collinear with its adjacent previous and next vertex is returned unmodified. #### Function Parameters ~~~ function polygon2d_vertices_round3_p ( c, vr, vrm, vfn, w, cw ) ~~~ arg | def | description :----:|:----:|:-------------------------------------- c | | A list of *n* 2d cartesian coordinates vr | 0 | The vertices rounding radius. vrm | 1 | The vertices rounding mode. vfn | | The vertices arc fragment number. w | true | Wrap-at-end during 3-point coordinate selection. cw | true | Polygon vertex ordering. #### Vertex Rounding Modes Each vertex may be individually rounded using one of the following modes: vrm | name | description :---:|:-------------------:|:-------------------------------------- 0 | none | return vertex unchanged 1 | round | previous to next edge round 2 | e-hollow / i-circle | previous to next edge inverse round 3 | n-fillet | next edge pass return fillet 4 | p-fillet | previous edge pass return fillet 5 | chamfer | previous to next edge bevel 6 | e-circle / i-hollow | previous to next edge inverse round 7 | n-round | next edge pass return round 8 | p-round | previous edge pass return round 9 | n-chamfer | next edge pass return bevel 10 | p-chamfer | previous edge pass return bevel Vertex arc fragments can be specified using \p vfn. When any \p vnfn is \b undef, the special variables \p $fa, \p $fs, and \p $fn control facet generation. Each vertex is processed using 3-point (the previous and following vertex). The resulting triangle \ref triangle2d_incenter "incircles" and \ref triangle2d_excenter "excircles" are used to create the round and fillet \ref polygon2d_arc_p "arc" segments. All arcs and chamfers use constant radius. \b Example: ~~~~ c = [[1,1], [1,10], [10,12], [18,2]]; r = [1,1,5,8]; m = [2,3,4,3]; n = [3, 8, undef, undef]; p = polygon2d_vertices_round3_p(c=c, vr=r, vrm=m, vfn=n); polygon( p ); ~~~~
Statistics
Likes
3
Downloads
0