Skip to content

Commit

Permalink
Change ArchWall WidthsOfWall attribute to OverrideWidth
Browse files Browse the repository at this point in the history
- following discussion at github
  • Loading branch information
paullee0 authored and yorikvanhavre committed Jul 13, 2019
1 parent 589a2ac commit f39ffe5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Mod/Arch/ArchWall.py
Expand Up @@ -536,8 +536,8 @@ def setProperties(self,obj):
obj.addProperty("App::PropertyLength","Width","Wall",QT_TRANSLATE_NOOP("App::Property","The width of this wall. Not used if this wall is based on a face"))

# To be combined into Width when PropertyLengthList is available
if not "WidthsOfWall" in lp:
obj.addProperty("App::PropertyFloatList","WidthsOfWall","Wall",QT_TRANSLATE_NOOP("App::Property","The widths of each segment of wall (The 1st value override 'Width' attribute for 1st segment of wall; if a value is zero, 1st value of 'WidthsOfWall' attribute will be followed)")) # see DraftGeomUtils.offsetwire()
if not "OverrideWidth" in lp:
obj.addProperty("App::PropertyFloatList","OverrideWidth","Wall",QT_TRANSLATE_NOOP("App::Property","This override Width attribute to set width of each segment of wall (The 1st value override 'Width' attribute for 1st segment of wall; if a value is zero, 1st value of 'OverrideWidth' will be followed)")) # see DraftGeomUtils.offsetwire()

if not "Height" in lp:
obj.addProperty("App::PropertyLength","Height","Wall",QT_TRANSLATE_NOOP("App::Property","The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid"))
Expand Down Expand Up @@ -798,9 +798,9 @@ def getExtrusionData(self,obj):

# TODO currently layers were not supported when len(basewires) > 0
width = 0
if obj.WidthsOfWall:
if obj.WidthsOfWall[0]:
width = obj.WidthsOfWall[0]
if obj.OverrideWidth:
if obj.OverrideWidth[0]:
width = obj.OverrideWidth[0]
if not width:
if obj.Width:
width = obj.Width.Value
Expand Down Expand Up @@ -905,7 +905,7 @@ def getExtrusionData(self,obj):
dvec2 = DraftVecUtils.scaleTo(dvec,off)
wire = DraftGeomUtils.offsetWire(wire,dvec2)

w2 = DraftGeomUtils.offsetWire(wire,dvec,False, False, obj.WidthsOfWall)
w2 = DraftGeomUtils.offsetWire(wire,dvec,False, False, obj.OverrideWidth)

w1 = Part.Wire(Part.__sortEdges__(wire.Edges))
sh = DraftGeomUtils.bind(w1,w2)
Expand All @@ -922,7 +922,7 @@ def getExtrusionData(self,obj):
dvec2 = DraftVecUtils.scaleTo(dvec,off)
wire = DraftGeomUtils.offsetWire(wire,dvec2)

w2 = DraftGeomUtils.offsetWire(wire,dvec,False, False, obj.WidthsOfWall)
w2 = DraftGeomUtils.offsetWire(wire,dvec,False, False, obj.OverrideWidth)

w1 = Part.Wire(Part.__sortEdges__(wire.Edges))
sh = DraftGeomUtils.bind(w1,w2)
Expand All @@ -938,10 +938,10 @@ def getExtrusionData(self,obj):
else:
dvec.multiply(width/2) ## TODO width Value should be of no use (width/2), width Direction remains 'in use'

widthsOfWallHalfen = [i/2 for i in obj.WidthsOfWall]
w1 = DraftGeomUtils.offsetWire(wire,dvec,False, False, widthsOfWallHalfen)
overrideWidthHalfen = [i/2 for i in obj.OverrideWidth]
w1 = DraftGeomUtils.offsetWire(wire,dvec,False, False, overrideWidthHalfen)
dvec = dvec.negative()
w2 = DraftGeomUtils.offsetWire(wire,dvec,False, False, widthsOfWallHalfen)
w2 = DraftGeomUtils.offsetWire(wire,dvec,False, False, overrideWidthHalfen)

sh = DraftGeomUtils.bind(w1,w2)
if sh:
Expand Down

0 comments on commit f39ffe5

Please sign in to comment.