Skip to content

Commit

Permalink
svg writer util
Browse files Browse the repository at this point in the history
  • Loading branch information
rms80 committed Apr 25, 2018
1 parent 8c74495 commit f7622ca
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions io/SVGWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,27 @@ public static void QuickWrite(List<GeneralPolygon2d> polygons, string sPath, dou
}


public static void QuickWrite(List<GeneralPolygon2d> polygons1, string color1, float width1,
List<GeneralPolygon2d> polygons2, string color2, float width2,
string sPath)
{
SVGWriter writer = new SVGWriter();
Style style1 = SVGWriter.Style.Outline(color1, width1);
Style style1_holes = SVGWriter.Style.Outline(color1, width1/2);
foreach (GeneralPolygon2d poly in polygons1) {
writer.AddPolygon(poly.Outer, style1);
foreach (var hole in poly.Holes)
writer.AddPolygon(hole, style1_holes);
}
Style style2 = SVGWriter.Style.Outline(color2, width2);
Style style2_holes = SVGWriter.Style.Outline(color2, width2 / 2);
foreach (GeneralPolygon2d poly in polygons2) {
writer.AddPolygon(poly.Outer, style2);
foreach (var hole in poly.Holes)
writer.AddPolygon(hole, style2_holes);
}
writer.Write(sPath);
}



Expand Down

0 comments on commit f7622ca

Please sign in to comment.