zalo / CascadeStudio

A Full Live-Scripted CAD Kernel in the Browser
https://zalo.github.io/CascadeStudio/
MIT License
998 stars 122 forks source link

Avoid calling Reversed() when mirroring #123

Closed Billiam closed 2 years ago

Billiam commented 2 years ago

Mirror() appears to work, but I think it's adding some weird reversing artifacts.

It changes the face rendering in Three, may be causing some degenerate facets in exported STLs, and mirrored shapes can (but don't always) disappear when union-ing with non-reversed shapes if they had overlapping volumes instead of coplanar faces. :shrug:

Using BRepBuilderAPI_Transform with the transform seems to both not require reversing, and leaves correctly facing faces that seem to union correctly.

Example

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/zalo/cascade-studio/97qKy13bJZFDqyso4kTh6VnA8jMy
✅ Preview: https://cascade-studio-git-fork-billiam-feature-improve-mirror-zalo.vercel.app

zalo commented 2 years ago

Looks good to me! I wonder if the rest of the transformation commands would benefit from using this BuilderAPI…