DisplayConduit Show Clipping Plane Fills?

Hello,

How do I add clipping fills to rhino objects that exist in the display conduit but NOT the rhino model.

Is this what I need to use, get the fill surfaces and then add those surfaces to my display conduit objects in Draw methods?

https://developer.rhino3d.com/api/rhinocommon/rhino.docobjects.rhinoobject/getfillsurfaces#(rhinoobject,clippingplaneobject)

Or do I simply need to adjust the Display.PreviewAttributes such as in the code snip below:

Here you can see geometry in the scene that is properly “poched” but the geometry next to it that lives in the display conduit is properly being clipped but gets no fill:


        @staticmethod
        def GeometryPreview():
            attr = Display.PreviewAttributes()
            attr.CurveColor = System.Drawing.Color.White  #Utils.ParseHexColor(UI.drawing_colors.get("new"), 255)
            attr.CurveThickness = 2
            attr.ObjectColor = System.Drawing.Color.White  #Utils.ParseHexColor(UI.drawing_colors.get("new"), 200)
            attr.ColorSource = Rhino.DocObjects.ObjectColorSource.ColorFromObject
            attr.TextColor = Color.White
            attr.CustomGroundPlaneShadowOnly = True

            # Clipping specific attributes
            attr.ClippingFillColor = Color.Blue
            attr.ClippingShadeColor = Color.Red
            attr.ClippingEdgeColor = Color.Magenta
            attr.ClippingEdgeThickness = 10

            attr.Material.Diffuse = Color.White
            attr.Material.Transparency = 0.8

            # attr.CullBackfaces = True
            # attr.CastShadows = True
            # attr.AmbientLightingColor = System.Drawing.Color.Red
            # attr.IgnoreHighlights = True
            return attr

Any feedback pointing me in the right direction would be greatly appreciated,

Thank you all!

I don’t think there currently is a way to do this. The clipping data is all computed and cached on Rhino objects since it is a pretty heavy set of calculations that we don’t want to do every frame. I’ll have to ponder how we would even support something like this in conduits.

1 Like

Thanks for your response @stevebaer ,

Does this mean that the clipped rhino objs already have the “fill surface” in their data when clipped?

I ask this because what you are seeing above does consist of breps as Rhino objects (created from Brep.CreateFromSweep)

For what it’s worth I don’t clip the geometry until after it’s drawn. I’m not trying to clip geometry that is being drawn during OnDynamicDraw

Thanks Steve