RS Wish : Enable/Disable clipping plane


#1

Hi @Dale,

We have one more for the heap for the clipping plane handling in RhinoScript:

ClippingPlaneState([strView],strClipPlane,[blnEnable])
where: strView - optional, name of the view, current vport if omitted
strClipPlane - clipping plane ID
blnEnable - True to enable, False to disable, if omitted, method would return the current state of the clipping plane in given vport.

cheers,

–jarek


(Dale Fugier) #2

Hi Jarek,

It is currently not possible to enable/disable clipping planes.

https://mcneel.myjetbrains.com/youtrack/issue/RH-34047

Until this is implemented, you won’t see a RhinoScript method to do so.

– Dale


#3

Hi Dale,

thanks, I see that something has to change deeper in the code to have it exposed in RS…
The main thing I can’t find a workaround for is checking if a clipping plane is enabled in given vport.

EDIT: there actually IS a way to check for clipping plane being enabled in current vport: using the EnableClippingPlane command on ClippingPlane that is already enabled results in a “Viewport already clipped by selected clipping plane” message in command line, and no message if it was disabled. So checking the command history holds the answer. This is an ugly workaround but would do for now. Still hope at some point we can get a clean a nice way to access this.

The enabling and disabling part could be done via selecting the clipping plane object and running “EnableClippingPlane / DisableClippingPlane” commands.

–jarek


(Dale Fugier) #4

https://mcneel.myjetbrains.com/youtrack/issue/RH-36377


(Brian Gillespie) #5

RH-36377 is fixed in the latest WIP


(Dale Fugier) #6

@Jarek, have you tried the above?


#7

Hi Dale,

I just tried the new method - thank you for adding it!

I see two issues with how it is now implemented:

  1. I don’t see a way to disable clipping in one vport only, but keep clipping in others.
  2. How can I tell if the clipping plane is enabled or disabled in the given vport?
    (also, it is not easy to add one view to the ‘clipped’ ones… if I use only one view, it would ‘unclip’ the others, so every time I’d need to keep a list of views that need to remain clipped…and with not being able to tell what’s clipping via script it makes is difficult.

In my initial suggestion, the method would take the ClippingPlaneID, strViewName/ID, True/False for enabled/disabled and return True/False for enabled/disabled. It would solve the above 2 issues. What do you think ?

–jarek


How do we remove viewportid from clipping plane
(Dale Fugier) #8

1.) Call Rhino.ClippingPlaneView to get an array of views clipped by the clipping plane
2.) Remove the target view from the array
3.) Call Rhino.ClippingPlaneView and pass the updated array

1.) Call Rhino.ClippingPlaneView to get an array of views clipped by the clipping plane
2.) See of the target view is in the array. If so, then the clipping plane is “enabled” for that view.

– Dale


#9

Got it - works great. Thanks! Where is my ‘solved’ checkbox ? : )