Skip to content

Commit

Permalink
Draft: Shape2Dview now supports buildingparts
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Aug 16, 2019
1 parent d9cfd35 commit 33cb9ce
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/Mod/Draft/Draft.py
Expand Up @@ -5491,17 +5491,29 @@ def execute(self,obj):
if obj.ViewObject:
if obj.ViewObject.Visibility == False:
return False
import DraftGeomUtils
import Part, DraftGeomUtils
obj.positionBySupport()
pl = obj.Placement
if obj.Base:
if getType(obj.Base) == "SectionPlane":
if obj.Base.Objects:
if getType(obj.Base) in ["BuildingPart","SectionPlane"]:
objs = []
if getType(obj.Base) == "SectionPlane":
objs = obj.Base.Objects
cutplane = obj.Base.Shape
else:
objs = obj.Base.Group
cutplane = Part.makePlane(1000,1000,FreeCAD.Vector(-500,-500,0))
m = 1500
if obj.Base.ViewObject and hasattr(obj.Base.ViewObject,"CutMargin"):
m = obj.Base.ViewObject.CutMargin.Value
cutplane.translate(FreeCAD.Vector(0,0,m))
cutplane.Placement = cutplane.Placement.multiply(obj.Base.Placement)
if objs:
onlysolids = True
if hasattr(obj.Base,"OnlySolids"):
onlysolids = obj.Base.OnlySolids
import Arch, Part, Drawing
objs = getGroupContents(obj.Base.Objects,walls=True)
objs = getGroupContents(objs,walls=True)
objs = removeHidden(objs)
shapes = []
if hasattr(obj,"FuseArch") and obj.FuseArch:
Expand Down Expand Up @@ -5537,7 +5549,7 @@ def execute(self,obj):
clip = False
if hasattr(obj.Base,"Clip"):
clip = obj.Base.Clip
cutp,cutv,iv = Arch.getCutVolume(obj.Base.Shape,shapes,clip)
cutp,cutv,iv = Arch.getCutVolume(cutplane,shapes,clip)
cuts = []
opl = FreeCAD.Placement(obj.Base.Placement)
proj = opl.Rotation.multVec(FreeCAD.Vector(0,0,1))
Expand Down

0 comments on commit 33cb9ce

Please sign in to comment.