Skip to content

Commit

Permalink
[ArchSpace] Improve Space Creation and ensureBase
Browse files Browse the repository at this point in the history
Refer to discussion at -
FreeCAD#18917

Like Wall and Stairs, Space should do without Base. Base validity tested in execute() prevented the desired and documented behaviour.

EnsureBase() is remarked out in execute() and to be run in getShape(). With this improvement, if there is no Base, or Base is not valid, Space would be created if it could be defined by obj.Boundaries.
  • Loading branch information
paullee0 authored and yorikvanhavre committed Jan 10, 2025
1 parent fe597c1 commit 73f0e16
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/Mod/BIM/ArchSpace.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,11 @@ def execute(self,obj):

if self.clone(obj):
return
if not self.ensureBase(obj):
return

# Space can do without Base. Base validity is tested in getShape() code below.
# Remarked out ensureBase() below
#if not self.ensureBase(obj):
# return
self.getShape(obj)

def onChanged(self,obj,prop):
Expand Down Expand Up @@ -324,11 +327,11 @@ def getShape(self,obj):
#print("starting compute")

# 1: if we have a base shape, we use it
if obj.Base:
if hasattr(obj.Base,'Shape'):
if obj.Base.Shape.Solids:
shape = obj.Base.Shape.copy()
shape = shape.removeSplitter()
# Check if there is obj.Base and its validity to proceed
if self.ensureBase(obj):
if obj.Base.Shape.Solids:
shape = obj.Base.Shape.copy()
shape = shape.removeSplitter()

# 2: if not, add all bounding boxes of considered objects and build a first shape
if shape:
Expand Down

0 comments on commit 73f0e16

Please sign in to comment.