I try to serialize CadQuery like discussed hier with e.g. this code:
from multiprocessing import Pool
import cadquery as cq
from cq_serialize import register as register_cq_helper
register_cq_helper()
def make_box(size: float):
return cq.Workplane("XY").box(size, size, size).findSolid()
with Pool() as p:
boxes = p.map(make_box, range(1, 10))
Sadly, it looks like in CadQuery Version: 2.3.0.dev0 the module cq_serialize
seems to be gone or renamed. At least i get a ModuleNotFoundError: No module named 'cq_serialize'
error.
Also, in the github project is no clue for serialize
Is there any hint how to either import cq_serialize
, or how to achieve parallelization in CadQuery?
If I just remove the register_cq_helper()
part the code will not terminate anymore. I assume it is required to handle some internal notify calls.
I don't want to blindly call CadQuery parallel as the kernel already now seems to crash sometimes.