strusoft / femdesign-api

FEM-Design API
https://femdesign-api-docs.onstrusoft.com/
MIT License
38 stars 20 forks source link

3d Model in Rhino/Grasshopper #396

Open Marco-Pellegrino opened 2 years ago

Marco-Pellegrino commented 2 years ago

It might be helpful to give to the user a 3d view of their model inside Grasshopper

andosca commented 2 years ago

How? :)

Marco-Pellegrino commented 2 years ago

One option would be to create a specific Model.View Component where we can plot:

image

Other approach would be to show the 3d model every time you "show/hide" a component. i.e. Beam -> it will show the beam when preview is on i.e. Support -> it will show the support when preview is on

andosca commented 2 years ago

Ok. But you would show it in Rhino? So basically showing a physical or symbolical representation of the elements instead of their point/line/surface?

Marco-Pellegrino commented 2 years ago

Yes. The idea is to render the 3d geometry in Rhino. Not only point/line/surface but the phisical entities of the object. Some Extrusion view should help the user to understand if the beam have the right local axis for example

xRadne commented 2 years ago

I would love to have this! 😍 But I think it would be easier and better to use the grasshopper interfaces that Grasshopper provides.

We could probably implement casting to Goo quite easily with our FemDesign.Grasshopper.Convert class. Have a look at GH_GeometricGoo>, IGH_Param and IGH_PreviewObject these are very handy for implementing geometry preview. This is what makes a c# class show up in the rhino window.

https://www.grasshopper3d.com/forum/topics/custom-parameter-output-preview etc

Edit: Oups, sorry you said "Not only point/line/surface but the physical entities of the objects". This is also good!

Marco-Pellegrino commented 2 years ago

I am not sure what it might be the best approach for c# but in Python I was overriding the DrawViewportWires() method and it was working well.

If approved, we will discuss the approach