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

Copy the color of the polygons on difference operations #59

Merged

Conversation

breiler
Copy link

@breiler breiler commented Aug 13, 2024

With this change it will use the color of the intersecting shape to be used on the clipped plane of a shape:

CSG cube1 = new Cube(1)
        .toCSG()
        .move(-0.5, 0, 0)
        .setColor(Color.BLUE);

CSG cube2 = new Cube(1).toCSG().move(0.49, 0, 0)
        .setColor(Color.RED);

CSG model = cube1.difference(cube2).scale(0.4);

Which will result in this blue cube with one red face:
Screencast from 2024-08-13 19-27-15.webm

This can now be used in a bit more complex operations:
Screencast from 2024-08-13 19-32-14.webm

Adresses the issue #56

@madhephaestus madhephaestus merged commit 830f0ae into NeuronRobotics:development Aug 17, 2024
1 check passed
@madhephaestus
Copy link
Member

released in 1.6.3!

@breiler
Copy link
Author

breiler commented Aug 17, 2024

Excellent, thanks!

@breiler breiler deleted the copy-color-on-difference branch November 11, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants