Skip to content

Instantly share code, notes, and snippets.

@yorikvanhavre
Created February 27, 2015 20:50
Show Gist options
  • Select an option

  • Save yorikvanhavre/64876b365a462b1a12cc to your computer and use it in GitHub Desktop.

Select an option

Save yorikvanhavre/64876b365a462b1a12cc to your computer and use it in GitHub Desktop.
Add a SoClipPlane to the FreeCAD view with Pivy
>>> from pivy import coin
>>> sg=Gui.ActiveDocument.ActiveView.getSceneGraph()
>>> clip = coin.SoClipPlane()
>>> clip.on.setValue(False)
>>> plane = coin.SbPlane(coin.SbVec3f(0,0,1),1000)
>>> plane
<pivy.coin.SbPlane; proxy of <Swig Object of type 'SbPlane *' at 0x7fd8424b62a0> >
>>> clip.plane.setValue(plane)
>>> sg.addChild(clip)
>>> clip.on.setValue(True)
>>> sg.removeChild(clip)
>>> sg.insertChild(clip,0)
>>> sg.removeChild(clip)
>>> o=App.ActiveDocument.Section
>>> o.Proxy.getNormal(o)
Vector (-0.0, -0.0, 1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment