gumyr / cq_warehouse

A cadquery parametric part collection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow Assembly.add to add multiple instances of another Assembly

gumyr opened this issue · comments

When using cq_warehouse.bearing one creates an assembly for each bearing instance with auto assigned named objects. If multiple instances of the same bearing is added to another assembly, this operation will fail on the second instance as the names for both instances are the same. The condition of clashing auto-generated names should be detected and new auto-generated names should be generated for the second instance. The regex for uuid detection is: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.

A new Assembly.add() method should be created that detects objects with only auto-generated names and renames them before continuing in the adding process.