Skip to content

Commit

Permalink
Merge pull request #874 from mlampert/feature/arch-panel-scale
Browse files Browse the repository at this point in the history
Arch: Added Scale property to PanelSheet.
  • Loading branch information
yorikvanhavre committed Jul 13, 2017
2 parents 828793f + 870f3eb commit 01eaca1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Mod/Arch/ArchPanel.py
Expand Up @@ -968,6 +968,7 @@ def __init__(self, obj):
obj.addProperty("App::PropertyPercent","FillRatio","Arch",QT_TRANSLATE_NOOP("App::Property","The fill ratio of this sheet"))
obj.addProperty("App::PropertyBool","MakeFace","Arch",QT_TRANSLATE_NOOP("App::Property","If True, the object is rendered as a face, if possible."))
obj.addProperty("App::PropertyAngle","GrainDirection","Arch",QT_TRANSLATE_NOOP("App::Property","Specifies an angle for the wood grain (Clockwise, 0 is North)"))
obj.addProperty("App::PropertyFloat","Scale","Arch", QT_TRANSLATE_NOOP("App::Property","Specifies the scale applied to each panel view."))
obj.Proxy = self
self.Type = "PanelSheet"
obj.TagSize = 10
Expand All @@ -977,6 +978,7 @@ def __init__(self, obj):
obj.MakeFace = False
obj.FontFile = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetString("FontFile","")
obj.setEditorMode("FillRatio",2)
obj.Scale = 1.0

def execute(self, obj):
import Part
Expand Down Expand Up @@ -1020,6 +1022,7 @@ def execute(self, obj):
textshape.rotate(textshape.BoundBox.Center,Vector(0,0,1),obj.TagRotation.Value)
self.sheettag = textshape
base = Part.Compound([base,textshape])
base.scale(obj.Scale, FreeCAD.Vector())
obj.Shape = base
obj.Placement = pl
obj.FillRatio = int((subarea/area)*100)
Expand All @@ -1040,12 +1043,14 @@ def getOutlines(self,obj,transform=False):
w = w[0]
if transform:
w.Placement = obj.Placement.multiply(w.Placement)
w.scale(obj.Scale, FreeCAD.Vector())
outp.append(w)
if not ispanel:
if p.isDerivedFrom("Part::Feature"):
for w in p.Shape.Wires:
if transform:
w.Placement = obj.Placement.multiply(w.Placement)
w.scale(obj.Scale, FreeCAD.Vector())
outp.append(w)
return outp

Expand All @@ -1063,6 +1068,7 @@ def getHoles(self,obj,transform=False):
w = w[1]
if transform:
w.Placement = obj.Placement.multiply(w.Placement)
w.scale(obj.Scale, FreeCAD.Vector())
outp.append(w)
return outp

Expand All @@ -1082,11 +1088,13 @@ def getTags(self,obj,transform=False):
w = w[2]
if transform:
w.Placement = obj.Placement.multiply(w.Placement)
w.scale(obj.Scale, FreeCAD.Vector())
outp.append(w)
if self.sheettag is not None:
w = self.sheettag.copy()
if transform:
w.Placement = obj.Placement.multiply(w.Placement)
w.scale(obj.Scale, FreeCAD.Vector())
outp.append(w)

return outp
Expand Down

0 comments on commit 01eaca1

Please sign in to comment.