Elements icon indicating copy to clipboard operation
Elements copied to clipboard

Profiles in a Model don't seem to render in glTF

Open MarkThorley opened this issue 5 years ago • 6 comments

When a model consists of both elements and profiles, it seems the profiles don't render when exported to glTF.

MarkThorley avatar Mar 11 '19 14:03 MarkThorley

How do you want the profiles to render? As lines? Can you show me some screenshots of what you expect?

ikeough avatar Mar 12 '19 22:03 ikeough

Yes ideally as lines. If materials can then be added to these lines in a similar way to solids that would be great.

MarkThorley avatar Mar 13 '19 10:03 MarkThorley

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?

ikeough avatar Mar 13 '19 21:03 ikeough

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.

MarkThorley avatar Mar 14 '19 09:03 MarkThorley

Is this issue related to #1117? Can we consolidate?

ikeough avatar Mar 21 '19 13:03 ikeough

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 ?

radumg avatar Apr 10 '19 19:04 radumg

See ModelCurve.

ikeough avatar Apr 14 '23 23:04 ikeough