Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Arch: Fixed section plane's clipping - fixes #2063
  • Loading branch information
yorikvanhavre committed Dec 28, 2015
1 parent 353b2df commit ed037c1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Mod/Arch/ArchSectionPlane.py
Expand Up @@ -270,9 +270,14 @@ def onChanged(self,vobj,prop):
norm = vobj.Object.Proxy.getNormal(vobj.Object)
mp = vobj.Object.Shape.CenterOfMass
mp = DraftVecUtils.project(mp,norm)
dist = mp.Length + 0.1 # to not clip exactly on the section object
dist = mp.Length #- 0.1 # to not clip exactly on the section object
norm = norm.negative()
plane = coin.SbPlane(coin.SbVec3f(norm.x,norm.y,norm.z),-dist)
if mp.getAngle(norm) > 1:
dist += 1
dist = -dist
else:
dist -= 0.1
plane = coin.SbPlane(coin.SbVec3f(norm.x,norm.y,norm.z),dist)
self.clip.plane.setValue(plane)
sg.insertChild(self.clip,0)
else:
Expand Down

0 comments on commit ed037c1

Please sign in to comment.