Created
February 27, 2015 20:50
-
-
Save yorikvanhavre/64876b365a462b1a12cc to your computer and use it in GitHub Desktop.
Add a SoClipPlane to the FreeCAD view with Pivy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> 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