Drawing on the foreground in Rhino

Hello everyone. Recently, I have developing a small tool to display 2d plots on all rhino views. Drawing the graph axis and drawing the points inside the graph worked, but i had that problem of zooming in and out. Basically when I zoom in/out i want to keep my plot unscaled. My idea was to take the new boundary and redraw the whole plot in relation to the boundary width and height. The problem here when I zoom in the box boundary gets to small so what the width and the height interval are too small and everything collapses. Is there another way to draw the plot with absolute parameters and keep the sized unchanged while zooming, or maybe draw the plot and exclude them from the zoom routine.

I will appreciate all cool ideas. Thanks for reading my thread.

how did you develop this tool? maybe if you could provide a screen shot from the situation.

Well I am inheriting from DisplayConduit and overriding the CalculateBoundingBox and the DrawForeground methods. In both I ask the API for the near and far planes and then build a plane in the middle. Finally I used the constructed Plane and I pass it the class, which take care of the drawing the objects.

CalBound Forground viewPort

you should recategorise your main tag to developer to get appropriate help.

1 Like

Thanks, I just have changed it

Hi @med.ayssar,

Use the 2d drawing function on DisplayPipleline, which draw based on screen coordinates.

– Dale

Thank you for the reply, but using only 2d drawing function, will give me certain restrictions (i.e rotating a text). But I have solved the problem using the current view size (the zoomed view) and from that view I create my drawing plane using the near and far rectangles