-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow conversion of spatial elements to Geometry via BHoMGeometry component #488
Comments
I guess you can turn anything into a Geometry with the But I'd turn the question the other way around, can methods that take |
Yep, agreed, but one needs to know about the existence of Concerning your question, the methods that take |
Yeah - I think this is not a bad idea! The warning about loss of data is also smart |
I don't see a problem with that. In fact, using parameter components to cast objects is very much in the philosophy of GH (at least that's how I use them to cast string to int for example). This is not specific to |
Great! Is there a chance you could tackle that at some point @adecler? Defo not a priority, rather a nice to have. |
Sure. |
Sounds like a concensus on allowing casts to geometry if there is geometry calling the GetGeometry without necessitating another 'get geometry' method by the user. I agree with this. As an aside (not to hold up/necessarily influence this), one slight challenge to this is that we've talked in the past a lot about multiple goemetries/representations on an object. This (I think) is a very separate subject, and good to have another conversation soon about it @al-fisher . My thinking has developed a bit on this. Given the entity/atomic nature of the objects, and us using reflection, interfaces and attributes more and more so, I think alternative geometry can be derived/separate/fragmented, and that we do have 'one geometry' associated with an object, by default. Thoughts?! |
@rwemay you are right, an object can have a few geometrical representations. However, sticking to this issue, for each object we have only one representation at a time for GH/Dynamo preview purposes - this particular representation would be converted to geometry, which would also be intuitive for the end user. |
@al-fisher , session created and invite sent. You can find the related issue in admin as last time. |
Also see #366 |
Behaviour of this has improved by quite a bit since this issue was first raised I think:
Dont think it would be to difficult to add the behaviour asked for here though as well, by adding another casting operation. Happy for a quick discussion if we should do that or not, hence leaving open for now. |
Yes - agreed @IsakNaslundBh. We still have the ambiguity of multiple geometrical representations being possible from an object (i.e. 3D, Render etc.) - however this is clear in the framework that it is all handled by the relevant methods - so casting and IElement to BHoMGeometry through the component should simply call the |
Description:
One of my colleagues was just working with BHoM panels and asked me why couldn't we have a direct convert from an IElement to geometry.
As discussed with @IsakNaslundBh, this is a bit against the logic plus dangerous because of the risk of losing all properties etc. etc. But then, I believe this would be a nice bow towards the end user, possibly relatively easy to implement (we have
Geometry
methods in place for preview purposes). Additionally, conversion could record a warning and turn the component orange to inform the user about lost properties.@rwemay @al-fisher FYI
The text was updated successfully, but these errors were encountered: