Support "Assemble them all" trajectory generation from CAD

This commit is contained in:
IDONTSUDO 2023-06-18 15:33:16 +00:00 committed by Igor Brylyov
parent 47773be8d4
commit a38c3bec5a
42 changed files with 537 additions and 119 deletions

View file

@ -0,0 +1,34 @@
import BOPTools.JoinFeatures
import FreeCAD as App
import uuid
class ConnectedPartModel:
name = None
id = None
solid = None
def __init__(self, part) -> None:
try:
self.id ='part' + str(uuid.uuid4())
j = BOPTools.JoinFeatures.makeConnect(name=self.id)
if (type(part) is list):
j.Objects = part
else:
j.Objects = [part]
j.Proxy.execute(j)
j.purgeTouched()
self.solid = j
App.ActiveDocument.recompute()
except Exception as e:
print(e)
pass
def remove(self):
try:
App.ActiveDocument.removeObject(self.solid.Label)
except Exception as e:
print(e)