Skip to content

Commit

Permalink
[Arch] - To allow exportIFC.py to work properly on sketch, which use …
Browse files Browse the repository at this point in the history
…only 1st face / wire.

Not fusing baseface in getExtrusionData(); fusing solids execute()

Forum Discussion - Arch Wall - Based on Sketch Issues

https://forum.freecadweb.org/viewtopic.php?f=39&t=31235&p=343444#p343444
  • Loading branch information
paullee0 authored and yorikvanhavre committed Nov 11, 2019
1 parent a7ad04b commit 720d40a
Showing 1 changed file with 50 additions and 21 deletions.
71 changes: 50 additions & 21 deletions src/Mod/Arch/ArchWall.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,13 @@ def setProperties(self, obj):
obj.addProperty("App::PropertyInteger","Face","Wall",QT_TRANSLATE_NOOP("App::Property","The face number of the base object used to build this wall"))
if not "Offset" in lp:
obj.addProperty("App::PropertyDistance","Offset","Wall",QT_TRANSLATE_NOOP("App::Property","The offset between this wall and its baseline (only for left and right alignments)"))
if not "Refine" in lp:
obj.addProperty("App::PropertyEnumeration","Refine","Wall",QT_TRANSLATE_NOOP("App::Property","Select whether or not and the method to remove splitter of the Wall. Currently Draft removeSplitter and Part removeSplitter available but may not work on complex sketch."))
obj.Refine = ['No','DraftRemoveSplitter','PartRemoveSplitter']

# See getExtrusionData(), removeSplitters are no longer used
#if not "Refine" in lp:
# obj.addProperty("App::PropertyEnumeration","Refine","Wall",QT_TRANSLATE_NOOP("App::Property","Select whether or not and the method to remove splitter of the Wall. Currently Draft removeSplitter and Part removeSplitter available but may not work on complex sketch."))
# obj.Refine = ['No','DraftRemoveSplitter','PartRemoveSplitter']
# TODO - To implement in Arch Component ?

if not "MakeBlocks" in lp:
obj.addProperty("App::PropertyBool","MakeBlocks","Blocks",QT_TRANSLATE_NOOP("App::Property","Enable this to make the wall generate blocks"))
if not "BlockLength" in lp:
Expand Down Expand Up @@ -600,8 +604,18 @@ def execute(self,obj):
for b in bplates:
b.Placement = extdata[2].multiply(b.Placement)
b = b.extrude(extv)
shps.append(b)
base = Part.makeCompound(shps)

# See getExtrusionData() - not fusing baseplates there - fuse solids here
# Remarks - If solids are fused, but exportIFC.py use underlying baseplates w/o fuse, the result in ifc look slightly different from in FC.
#shps.append(b)
if shps:
shps = shps.fuse(b) #shps.fuse(b)
else:
shps=b
# TODO - To let user to select whether to fuse (slower) or to do a compound (faster) only ?
#base = Part.makeCompound(shps)
base = shps

else:
bplates.Placement = extdata[2].multiply(bplates.Placement)
base = bplates.extrude(extv)
Expand Down Expand Up @@ -960,23 +974,38 @@ def getExtrusionData(self,obj):
sh.fix(0.1,0,1) # fixes self-intersecting wires
f = Part.Face(sh)
if baseface:
if layers:
if layers[i] >= 0:
baseface.append(f)
else:
baseface = baseface.fuse(f)
if obj.Refine == 'DraftRemoveSplitter':
s = DraftGeomUtils.removeSplitter(baseface)
if s:
baseface = s
elif obj.Refine == 'PartRemoveSplitter':
baseface = baseface.removeSplitter()

# To allow exportIFC.py to work properly on sketch, which use only 1st face / wire, do not fuse baseface here
# So for a sketch with multiple wires, each returns individual face (rather than fusing together) for exportIFC.py to work properly
# "ArchWall - Based on Sketch Issues" - https://forum.freecadweb.org/viewtopic.php?f=39&t=31235
#
baseface.append(f)
# The above make Refine methods below (in else) useless, regardless removeSpitters yet to be improved for cases do not work well

''' Whether layers or not, all baseface.append(f) '''

#if layers:
# if layers[i] >= 0:
# baseface.append(f)
#else:
#baseface = baseface.fuse(f)
#if obj.Refine == 'DraftRemoveSplitter':
# s = DraftGeomUtils.removeSplitter(baseface)
# if s:
# baseface = s
#elif obj.Refine == 'PartRemoveSplitter':
# baseface = baseface.removeSplitter()
else:
if layers:
if layers[i] >= 0:
baseface = [f]
else:
baseface = f
baseface = [f]

''' Whether layers or not, all baseface = [f] '''

#if layers:
# if layers[i] >= 0:
# baseface = [f]
#else:
#baseface = f

if baseface:
base,placement = self.rebase(baseface)
else:
Expand Down

0 comments on commit 720d40a

Please sign in to comment.