Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight negative regions when rendering using Manifold #5047

Open
kintel opened this issue Mar 16, 2024 · 2 comments
Open

Highlight negative regions when rendering using Manifold #5047

kintel opened this issue Mar 16, 2024 · 2 comments

Comments

@kintel
Copy link
Member

kintel commented Mar 16, 2024

When using the (default) CGAL Nef polyhedron backend, F6 rendering results in "negative surfaces" (cutouts) being rendering in a different color. We should implement the same for the Manifold backend.

Example for a difference between a sphere and a cube:
Screenshot 2024-03-16 at 19 43 01

A similar feature is demoed on https://manifoldcad.org/#Tetrahedron%20Puzzle

A related opportunity with Manifold is to also support preserving color() in F6 rendering. A prototype has shown that this is doable in OpenSCAD. Keep that in mind when solving this ticket by making the rendering backend flexible enough to handle multiple colors.

@gsohler
Copy link
Member

gsohler commented Mar 17, 2024

kintel, see this one

https://github.com/gsohler/openscad/blob/color/src/geometry/manifold/ManifoldGeometry.cc#L114-L117
triangle points runIndex[0-1] -> yellow
triangle points runIndex[2-3] -> green

@gsohler
Copy link
Member

gsohler commented Mar 17, 2024

BTW my code is wrong
for(int i=0;i<mesh.runIndex.size()-1;i++) {

should be:

for(int i=0;i<mesh.runIndex.size();i+=2) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants