def __init__(self,layer,points): DocumentObject.__init__(self) FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython","Face",self,self) self.addProperty("App::PropertyLinkList","Edges","Base","End point") #self.addProperty("App::PropertyLink","Layer","Base", "The layer this point is in") #self.Layer=layer.getobj() layer.registerFace(self) edges = self.getOrCreateEdges(points) if not edges: raise UnimplementedError, "Cannot add a face by noncircular edgeset" self.Edges = map(lambda x: x.getobj(), edges) self.createGeometry()
def __init__(self,layer,vect=None): DocumentObject.__init__(self) FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython","Point",self,self) self.addProperty("App::PropertyVector","Coordinates","Base","Coordinates") #self.addProperty("App::PropertyLinkList","Edges","Base", "Edges using this point") #self.addProperty("App::PropertyLink","Layer","Base", "The layer this point is in") layer.registerPoint(self) if vect is None: vect=FreeCAD.Base.Vector(0,0,0) self.activate() self.Coordinates=vect self.show() self.createGeometry()
def __init__(self,mesh,name=None): DocumentObject.__init__(self) if name == None: name = self.getDefaultName() FreeCAD.ActiveDocument.addObject("App::FeaturePython","Layer",self,self) self.addProperty("App::PropertyLinkList","Edges","Base", "Edges") self.addProperty("App::PropertyLinkList","Points","Base", "Points") self.addProperty("App::PropertyLinkList","Faces","Base", "Faces") self.addProperty("App::PropertyLinkList","Layers","Base", "Faces") #self.addProperty("App::PropertyLink","Mesh","Base", "The mesh this point is in") #self.Mesh=mesh.getobj() mesh.registerLayer(self) self.Label = name
def __init__(self, mesh, name=None): DocumentObject.__init__(self) if name == None: name = self.getDefaultName() FreeCAD.ActiveDocument.addObject("App::FeaturePython", "Layer", self, self) self.addProperty("App::PropertyLinkList", "Edges", "Base", "Edges") self.addProperty("App::PropertyLinkList", "Points", "Base", "Points") self.addProperty("App::PropertyLinkList", "Faces", "Base", "Faces") self.addProperty("App::PropertyLinkList", "Layers", "Base", "Faces") #self.addProperty("App::PropertyLink","Mesh","Base", "The mesh this point is in") #self.Mesh=mesh.getobj() mesh.registerLayer(self) self.Label = name
def __init__(self,layer,start,end,crease=None): DocumentObject.__init__(self) FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython","Edge",self,self) self.addProperty("App::PropertyLink","Start","Base","Start point") self.addProperty("App::PropertyLink","End","Base","End point") #self.addProperty("App::PropertyLink","Layer","Base", "The layer this point is in") self.addProperty("App::PropertyEnumeration","Creased","Base","Creased?").Creased=["Creased","Normal"] #self.addProperty("App::PropertyLinkList","Faces","Base", "Faces using this edge") #self.Layer=layer.getobj() layer.registerEdge(self) self.Start=start.getobj() self.End=end.getobj() self.setCreased(crease) self.createGeometry()
def __init__(self): DocumentObject.__init__(self) History.__init__(self) FreeCAD.ActiveDocument.addObject("App::FeaturePython","Mesh",self,self) self.addProperty("App::PropertyLinkList","Layers","Base", "Layers")
def __init__(self): DocumentObject.__init__(self) History.__init__(self) FreeCAD.ActiveDocument.addObject("App::FeaturePython", "Mesh", self, self) self.addProperty("App::PropertyLinkList", "Layers", "Base", "Layers")