Closed
Description
CSG currently patches the JSCAD modeling library in order to retain colour data between operations. If I recall correctly, the unmodified library resets colours to its default shade of blue after each operation.
With the patch applied, the union of two Shapes in CSG normally retains their various colours. However, the patch does not cover all cases.
If non-touching Shapes are unioned, one of them reverts to the default blue.
Snippet to reproduce issue:
import {
silver, crimson, black,
cube, cone, sphere,
intersect, union, scale, translate,
render_grid_axes
} from "csg";
const base = intersect(
scale(cube(silver), 1, 1, 0.3),
scale(cone(crimson), 1, 1, 3)
);
const snowglobe = union(
translate(sphere(black), 0, 0, 0.5),
base
);
render_grid_axes(snowglobe);