refactor triangulate_paths.py example
@@ -10,6 +10,13 @@ CWD = Path("~/Desktop/Outbox").expanduser()
if not CWD.exists():
CWD = Path(".")
+# ------------------------------------------------------------------------------
+# This example shows how triangulate arbitrary path objects, a doughnut in this
+# special case.
+# ------------------------------------------------------------------------------
+
+
+def main():
doc = ezdxf.new()
msp = doc.modelspace()
@@ -23,3 +30,7 @@ for index, points in enumerate(path.triangulate([circle1, circle0])):
zoom.extents(msp)
doc.saveas(CWD / "triangulated_doughnut.dxf")
+
+
+if __name__ == "__main__":
+ main()
