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

Fix CSG Union Color Loss #287

Merged

Conversation

joeng03
Copy link
Contributor

@joeng03 joeng03 commented Mar 12, 2024

Description

Fixes #227

As described in the issue, the union operation does not preserve the color of one of the solids when they are non-intersecting. Upon inspection of the JSCAD code, I realized that there is a separate function to handle non-intersecting unions, and the toPolygons function was not called with the option of preserving the individual colors of a polygon using the boolean parameter colorizePolygons. This has been rectified in this PR.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Running the snippet provided in #227

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@joeng03 joeng03 closed this Mar 12, 2024
@joeng03 joeng03 force-pushed the joeng03/fix-csg-union-color-loss branch from 6843109 to fcb0402 Compare March 12, 2024 13:46
@joeng03 joeng03 reopened this Mar 12, 2024
@joeng03 joeng03 merged commit 5d762b0 into source-academy:master Mar 12, 2024
4 checks passed
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.

[CSG]: Non-touching unions fail to retain some colours
2 participants