gumyr / cq_warehouse

A cadquery parametric part collection
Apache License 2.0
107 stars 23 forks source link

Allow Assembly.add to add multiple instances of another Assembly #50

Open gumyr opened 2 years ago

gumyr commented 2 years ago

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.