Programming a new geometry

I would like to program a new geometry. Its name would be ‘Graph’ and it represents a visible graph on the rhino viewport. Like the other rhino geometries I want it to have its own commands. In certain way it would be like a curve geometry, in which there wouldbe posible to connect more than two lines for each node.
I would like to use this geometry as reference in grasshopper, too.

So, this is my question: Where do I start from?

Hi ELM,

Hmm, not sure about idea “on the viewport” do you mean in model space or in screen space like some kind of HUD ?

Maybe try here and here ?

I developed something like this and you don’t need geometry at all, just information. Well, I preferred like that bc I can automate their positions using a simple particle system, but you can do it with geometry, I guess.

For my case, I use a DisplayConduit to visualize it and if you want to interact with it in rhino scene you need a MouseCallback and do all the logic.

https://developer.rhino3d.com/api/RhinoCommon/html/Methods_T_Rhino_UI_MouseCallback.htm

For GH it’s different, you have to create the GH wrap of your data type (which inherits from GH_Goo) and a parameter that receives this, and also, override the display methods.

https://developer.rhino3d.com/api/grasshopper/html/fbfe5e40-ba8d-4e53-97c6-27572e049835.htm

Thank you, the second link is useful to me.
I can code simple stand-alone programs in c#. But this is different.
I mean, I´d have to anchor it to the rhino-app in some way, I am right?

Thank you, but it wouldn’t work for me. Imagine it like if it were a pipe-system embebed in a building´s structure. Or a neuron circuit in a model of an insect.
It has to be integrated with the view. For the purpose of rendering it could be converted to curves, the graph manteining the structure.

Best place to start with a plugin dev will be here :wink:

This seems perfect
Thank you!
(I hope to find an example creating a new geometry, though)

By the way, I was refering to “model space”

@ELM take a look here :wink:

great, thank you very much!