source-academy / modules

Modules that can be imported by programs in Source Academy, an online experiential environment for computational thinking
Apache License 2.0
8 stars 28 forks source link

Fix CSG Union Color Loss #287

Closed joeng03 closed 7 months ago

joeng03 commented 7 months ago

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.

How Has This Been Tested?

Running the snippet provided in #227

Checklist: