Wipeout command: How to access View Background colour / gradient?

Hi all.

I’m poking around with RhinoCommon and C#, trying to get an understanding of how it all fits together. I thought I’d start with trying to create a wipeout command. Functionally it takes a boundary curve, then applies the background of the viewport to occlude any object behind the wipeout.

First I thought I could use a hatch, but after some exploring and testing it seems I would not be able to set the hatch fill to the views background.

Next, I had AI scratch together some code that uses a display conduit to occlude the objects behind the wipeout. This works, but only with a colour fill. I can’t work out how to access the viewports background.

Where should I look to access the active views background?

Cheers.

https://developer.rhino3d.com/api/rhinocommon/rhino.applicationsettings.appearancesettings/viewportbackgroundcolor

Thanks @dale this has got me in the right track.

Out of curiosity. How hard / complicated is it to occlude objects that appear behind a rectangle I draw on the screen. I don’t have a good idea of the problem scope but I want to know if it’s very complicated and I should probably work on simpler functions for now, and work up to it.

Hi @stuart.crake,
Here is a similar work flow to create the illusion of a non-rectangular detail in Rhino 8 and earlier.(Non-rectangular details are now supported in Rhino 9 WIP)

You can use this method on the model geometry, as well as on the layout.

  1. Basically, create a solid white hatch on a layer with a white display and print color.
  2. You can prioritize it to be see on the top of the geometry with the DrawOrder commands:
    BringToFront or BringForward
  3. Trim to a boundary curve leaving the hatch to mask the other geometry.

4. Set Print Preview on the viewport
5. Print.

See how it is done here:

Let us know if it works for you.

Sincerely,
Mary Ann Fugier

Hi, @mary,

Thanks for this. I am familiar with approaches to masking detail elements, and I really like the new set detail border. It’s always good to see new drafting tools added!

This post was more about learning RhinoCommon by setting a task and attempting to solve it. I think it might be beyond my level for now though.

Cheers