Elements
Elements copied to clipboard
Profiles in a Model don't seem to render in glTF
When a model consists of both elements and profiles, it seems the profiles don't render when exported to glTF.
How do you want the profiles to render? As lines? Can you show me some screenshots of what you expect?
Yes ideally as lines. If materials can then be added to these lines in a similar way to solids that would be great.
I think I was rendering profiles at one point, but there are cases where you really don't want them. There are a couple of places that we could allow you to conditionally set whether profiles are shown:
- As a property on the Profile:
myProfile.Render = true
. - As a default parameter on
Model.SaveGlb
:myModel.SaveGlb(bool renderProfiles = false)
.
The former would allow you to control, per profile, and could be added as part of the IProfileProvider
interface. The latter would allow you to set the behavior for all profiles.
Materials for profiles is a different story. What kind of capability do you want? Just the ability to set the color of the Profile? Can you give me an example of how you'd use this capability?
I think as a default property on the model.SaveGlb would be fine for my use case. At the moment I will only instruct adding profiles to the model when I wish to render them, but if its a property on the profile itself that would give even greater flexibility. In regards to materials, yes just the ability to set colours is all I had in mind really.
Is this issue related to #1117? Can we consolidate?
related to #117 , use-case is the same : rendering site boundary line (affectionately know as the red line
🤓 )
instead of adding a bool renderProfiles
as a parameter to ToGltf()
(as changed in 2.2), we should consider making SerialisationSettings
class that can hold some of these preferences (there's bound to be a few others come up). This pattern is not too dissimilar to Newtonsoft & other libs.
What do you think @ikeough ?
See ModelCurve
.