DXF export: polygon directions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

DXF export: polygon directions

Lars Kruse

I just noticed that OpenSCAD (r568) changes the direction of all polygons to
clockwise during a DXF export. This behaviour was introduced in r57 (at least
that's what "svn blame" tells me). The comment next to the crucial lines is
this one:

480 /*!
481     Ensures that all paths have the same vertex ordering.
482     FIXME: CW or CCW?
483 */
484 void DxfData::fixup_path_direction()

This unified vertex ordering is problematic, if you want to distinguish "inner"
polygons from "outer" polygons. E.g. see the following OpenSCAD code snippet,
that I used for testing:

  difference() {

uncommenting all calls of this function did not help - all polygons still point
along the same direction.
Does anybody of you have an idea, where to change the order of vertices
according to their inner/outer state?
This would be really helpful for people who want to modify complicated 2D models
with Inkscape. Additionally it would help whenever you want to use PyCAM (a
CAM software for generating GCode - I am one of the developers) with the
generated DXF files.
Any ideas or hints?


PS: is there any kind of bug tracker for OpenSCAD available?