Arch: minor improvements in panel
This commit is contained in:
parent
9af4df3ce5
commit
7318a1d443
|
@ -312,7 +312,7 @@ class Component:
|
|||
pass
|
||||
|
||||
def getSiblings(self,obj):
|
||||
"returns a list of objects with the same base as this object"
|
||||
"returns a list of objects with the same type and same base as this object"
|
||||
if not hasattr(obj,"Base"):
|
||||
return []
|
||||
if not obj.Base:
|
||||
|
@ -323,7 +323,8 @@ class Component:
|
|||
if o.Base:
|
||||
if o.Base.Name == obj.Base.Name:
|
||||
if o.Name != obj.Name:
|
||||
siblings.append(o)
|
||||
if Draft.getType(o) == Draft.getType(obj):
|
||||
siblings.append(o)
|
||||
return siblings
|
||||
|
||||
def getAxis(self,obj):
|
||||
|
|
|
@ -258,6 +258,7 @@ class _Panel(ArchComponent.Component):
|
|||
obj.addProperty("App::PropertyLength","Width","Arch",translate("Arch","The width of this element, if not based on a profile"))
|
||||
obj.addProperty("App::PropertyLength","Thickness","Arch",translate("Arch","The thickness or extrusion depth of this element"))
|
||||
obj.addProperty("App::PropertyInteger","Sheets","Arch",translate("Arch","The number of sheets to use"))
|
||||
obj.addProperty("App::PropertyLength","Offset","Arch",translate("Arch","The offset between this panel and its baseline"))
|
||||
obj.Sheets = 1
|
||||
self.Type = "Panel"
|
||||
|
||||
|
@ -307,9 +308,13 @@ class _Panel(ArchComponent.Component):
|
|||
self.BaseProfile = base
|
||||
self.ExtrusionVector = normal
|
||||
base = base.extrude(normal)
|
||||
elif (len(base.Wires) == 1):
|
||||
if base.Wires[0].isClosed():
|
||||
base = Part.Face(base.Wires[0])
|
||||
elif base.Wires:
|
||||
closed = True
|
||||
for w in base.Wires:
|
||||
if not w.isClosed():
|
||||
closed = False
|
||||
if closed:
|
||||
base = ArchCommands.makeFace(base.Wires)
|
||||
self.BaseProfile = base
|
||||
self.ExtrusionVector = normal
|
||||
base = base.extrude(normal)
|
||||
|
@ -341,6 +346,11 @@ class _Panel(ArchComponent.Component):
|
|||
b.translate(n)
|
||||
bases.append(b)
|
||||
base = Part.makeCompound(bases)
|
||||
|
||||
if base and normal and hasattr(obj,"Offset"):
|
||||
if obj.Offset.Value:
|
||||
v = DraftVecUtils.scaleTo(normal,obj.Offset.Value)
|
||||
base.translate(v)
|
||||
|
||||
# process subshapes
|
||||
base = self.processSubShapes(obj,base,pl)
|
||||
|
|
|
@ -968,6 +968,12 @@ def makeCopy(obj,force=None,reparent=False):
|
|||
ArchWindow._Window(newobj)
|
||||
if gui:
|
||||
ArchWindow._ViewProviderWindow(newobj.ViewObject)
|
||||
elif (getType(obj) == "Panel") or (force == "Panel"):
|
||||
import ArchPanel
|
||||
newobj = FreeCAD.ActiveDocument.addObject(obj.TypeId,getRealName(obj.Name))
|
||||
ArchPanel._Panel(newobj)
|
||||
if gui:
|
||||
ArchPanel._ViewProviderPanel(newobj.ViewObject)
|
||||
elif (getType(obj) == "Sketch") or (force == "Sketch"):
|
||||
newobj = FreeCAD.ActiveDocument.addObject("Sketcher::SketchObject",getRealName(obj.Name))
|
||||
for geo in obj.Geometry:
|
||||
|
|
Loading…
Reference in New Issue
Block a user