deadsy / sdfx

A simple CAD package using signed distance functions
MIT License
541 stars 52 forks source link

Faster Dual Contouring implementation #42

Closed Yeicor closed 2 years ago

Yeicor commented 2 years ago

This is another implementation of Dual Contouring (DC) like the one at #41. Advantages:

  1. Simpler: less code and more documented. It doesn't include octrees or mesh simplification as it can be applied later.
  2. Faster: 42s --> 10s on cylinder_head example.
  3. Any number of cells supported as it doesn't use octrees.
  4. Better control over quality and performance, and prints helpful warnings.

It has the same problem of small intersecting triangles as the previous implementation (DC has this disadvantage), but it is good enough for my use case.