Change ArchWall WidthsOfWall attribute to OverrideWidth
- following discussion at github
This commit is contained in:
committed by
Yorik van Havre
parent
589a2ac4f5
commit
f39ffe5707
@@ -536,8 +536,8 @@ class _Wall(ArchComponent.Component):
|
||||
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"))
|
||||
@@ -798,9 +798,9 @@ class _Wall(ArchComponent.Component):
|
||||
|
||||
# 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
|
||||
@@ -905,7 +905,7 @@ class _Wall(ArchComponent.Component):
|
||||
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)
|
||||
@@ -922,7 +922,7 @@ class _Wall(ArchComponent.Component):
|
||||
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)
|
||||
@@ -938,10 +938,10 @@ class _Wall(ArchComponent.Component):
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user