Arch: Fixed Arch example - fixes #1789
This commit is contained in:
parent
cb5a807990
commit
3f607d73a4
Binary file not shown.
|
@ -110,6 +110,10 @@ class _SectionPlane:
|
|||
if hasattr(obj.ViewObject,"DisplayLength"):
|
||||
l = obj.ViewObject.DisplayLength.Value
|
||||
h = obj.ViewObject.DisplayHeight.Value
|
||||
elif hasattr(obj.ViewObject,"DisplaySize"):
|
||||
# old objects
|
||||
l = obj.ViewObject.DisplaySize.Value
|
||||
h = obj.ViewObject.DisplaySize.Value
|
||||
else:
|
||||
l = 1
|
||||
h = 1
|
||||
|
@ -213,6 +217,10 @@ class _ViewProviderSectionPlane:
|
|||
if hasattr(vobj,"DisplayLength"):
|
||||
ld = vobj.DisplayLength.Value/2
|
||||
hd = vobj.DisplayHeight.Value/2
|
||||
elif hasattr(vobj,"DisplaySize"):
|
||||
# old objects
|
||||
ld = vobj.DisplaySize.Value/2
|
||||
hd = vobj.DisplaySize.Value/2
|
||||
else:
|
||||
ld = 1
|
||||
hd = 1
|
||||
|
@ -273,6 +281,9 @@ class _ArchDrawingView:
|
|||
self.onChanged(obj,"Source")
|
||||
if not hasattr(self,"svg"):
|
||||
return ''
|
||||
if not hasattr(self,"direction"):
|
||||
p = FreeCAD.Placement(obj.Source.Placement)
|
||||
self.direction = p.Rotation.multVec(FreeCAD.Vector(0,0,1))
|
||||
linewidth = obj.LineWidth/obj.Scale
|
||||
st = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetFloat("CutLineThickness",2)
|
||||
da = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetString("archHiddenPattern","30,10")
|
||||
|
|
|
@ -274,6 +274,9 @@ class Renderer:
|
|||
|
||||
def isInside(self,vert,face):
|
||||
"Returns True if the vert is inside the face in Z projection"
|
||||
|
||||
if not face:
|
||||
return False
|
||||
|
||||
# http://paulbourke.net/geometry/insidepoly/
|
||||
count = 0
|
||||
|
@ -298,6 +301,9 @@ class Renderer:
|
|||
face1 = self.flattenFace(face1)
|
||||
face2 = self.flattenFace(face2)
|
||||
|
||||
if (not face1) or (not face2):
|
||||
return False
|
||||
|
||||
# first we check if one of the verts is inside the other face
|
||||
for v in face1[0].Vertexes:
|
||||
if self.isInside(v,face2):
|
||||
|
|
Loading…
Reference in New Issue
Block a user