Hi Folks,
i’m working on a plugin for Rhino/Grasshopper with extensive use of UserData and discovered, that Rhino.Geometry.Plane class is not inheriting GeometryBase, so it doesn’t inherit the UserData or UserDictionary properties.
Is there a chance, that this could be added to RhinoCommon in the future?
If not, i’ll try some workaround, with a generic database object, which holds data + id of the desired planes.
At runtime i can refer to the data for that plane in db with the plane id.
My question here would be, how to obtain some kind of id? The GetHashCode() method will not work, since it changes every time the plane coordinates change.
Since rhinocommon is wrapping unmanaged code, may there be a pinned memory location for any plane object?
Could i use a memory pointer to track the plane object.
It’s not necessary, that data is stored when rhino closes. Since it will be a grasshopper plugin, the db will be generated each time that plane object has been created in memory. Its ID must be consistent only at runtime.
I hope this description explains the concept. Don’t hesitate to ask any questions, if it’s not clear.
Plane in RhinoCommon is a struct data type and does not wrap any unmanaged code. This is similar to a Point3d which is just 3 doubles. We aren’t going to change this to support UserData since the overhead for common usage would be significant.
One possible solution for you may be to use the PlaneSurface class instead of Plane
Ok i understand. It would have bad influence on performance for common usage. It’s not worth it. Was a bad idea
I did some tests with PlaneSurface, the problem is the Grasshopper workflow. Since components with plane inputs are converting the PlaneSurface to Plane, the UserDictionary ect. is gone.
Alright, i’ll find some other solution.
Thanks a lot anyway!