[Rhino6/C++] custom object drawing does not use the object bounding box anymore

In Rhino 5, I used to be able to report a larger bounding box for my custom object so that any curves etc. drawn outside the object’s geometry bounding box in the MyCustomObject::Draw(CRhinoDisplayPipeline&) functions are still visible when the object itself moves out of the viewport frustum. This seems no longer to be the case.

Now in Rhino6, when I move the object out of the frustum, all other things that are drawn are no longer visible, because the Draw function of the object is no longer called. For example: I mirror the section curves of a hull in the XZ-center plane to show them on both sides, even though the hull only has a surface on one side because it is symmetric. As soon as the half-hull is no longer visible in the viewport, the mirrored curves also disappear (even though their position is most definitely still inside the viewport frustum), most likely because the drawing routines think the object is no longer visible and cull it from the scene. As said, in Rhino 5, I reported the mirred bounding box in the custom object BoundinBox() functions and this solved the problem. This does not work anymore.

@stevebaer @dale What is the best way to get this working in V6?

I’ve just checked the Rhino 5 code; when I override MyCustomObject::BoundingBox(const CRhinoViewPort*) const the display pipeline picks up the bounding box from that function.

I have moved all drawing routines to a display conduit where I can also override the channel attributes’ bounding box in the SC_CALCBOUNDINGBOX channel. With this workaround, the problem goes away.

Still, it looks like a problem that needs to be addressed. In short: the display pipeline does not take an overridden custom object’s bounding box into account and culls it from the scene as soon as its base bounding box is no longer in the view.

Logged at https://mcneel.myjetbrains.com/youtrack/issue/RH-51365