RS274X includes an area fill command - G36 starts area fill and G37 terminates it. All draw commands issued between a G36 and G37 are for the purpose of defining a polygon's boundary and have zero width. Once the internal region of the polygon is defined, the rasterizer fills the interior with pixels. This approach is very efficient for defining complex shapes precisely to the resolution of the rasterizer. Determining the Interior of an Area Fill PolygonOne occasionally encounters polygons where the interior region is not so clearly defined. This is normally due to either self intersection or self-touching edges. There are many different edge sequences that can generate such a polygon; the rasterizer has been designed to produce the same results no matter the edge order. The following examples were rasterized using GBR_RIP; the original vector data and the rasterized results are shown side by side. This should aid the gbr_rip user in troubleshooting images that do not appear to be correct. On the left of each illustration is the vector data annotated with the order in which the edges are "drawn". On the right is the resulting raster image produced by gbr_rip. You can download the RS274X file containing these examples, rs274x_illegals.art 19KB. Example 1Example 1 - this is a classic case of a self intersecting polygon. The polygon "winds" in the CCW direction. The resulting triangular region is clear. Example 2Example 2 - A slightly more complicated self intersecting polygon. Example 3Example 3 - A self-touching polygon. Points 2 and 5 have identical coordinates. Example 4Example 4 - A self-intersecting polygon. Example 5Example 5 - This looks like a re-entrant polygon but is actually a self intersecting polygon. Example 5b - If one perturbs the coordinates slightly it is clear that this polygon crosses over itself at coordinates 2/9. Example 6Example 6 - This looks identical to example 3 but the edges are drawn in a different order making it "self-intersecting" and not self touching. Example 7Example 7 - A complex re-entrant polygon. Example 8Example 8 - A simple bow tie self intersecting polygon. Example 9Example 9 - A re-entrant polygon Example 10Example 10 - A self intersecting polygon. Example 11Example 11 - A self intersecting polygon. Example 11b - Detail view of lower right corner. |
G-Codes | D-Codes | M-Codes | Mass Parameters | Extended Mass Parameters | 274X Area Fill |