gumyr / build123d

A python CAD programming library
Apache License 2.0
402 stars 75 forks source link

Can't transform colored shapes #179

Closed snoyer closed 1 year ago

snoyer commented 1 year ago

Color not being pickleable makes deepcopy, and therefore shape methods that return copies, fail if the color property is set

Reprodution:

from build123d import Color, Solid

box = Solid.make_box(1, 1, 1)

box2 = box.translate((1, 1, 1))  # ok

box.color = Color("red")
box2 = box.translate((1, 1, 1))  # TypeError: cannot pickle 'OCP.Quantity.Quantity_ColorRGBA' object
gumyr commented 1 year ago

Fixed. Thanks for pointing this out.