Collinear facet detection

Wednesday, May 16, 2012 - 14:53

|

When CAD programs export STL files, sometimes they include "null" polygons that have all nodes on a single line. This is a bug of the exporting program, most probably caused by the fact that coordinates can be stored with more precision in the memory than in a file.

For example, the following two polygons are NULL polygons:

Polygon1:

  • Point1 (0,0,0)
  • Point2 (1,0,0)
  • Point3 (1,0,0)

This is invalid because point 2 and 3 are on the same coordinates, thus it is not a triangle.

Polygon2:

  • Point1 (0,0,0)
  • Point2 (1,0,0)
  • Point2 (2,0,0)

This is invalid because all points are on the line (0,0,0) -> (2,0,0).

As the above collinearity is the most frequent cause of "non-simple polygons", this is now detected when loading a file. You will get an option to delete them:

Image

If, after deleting these, there are other non-simple polygons, you will of course get the old dialog offering to vertex-shift those.