Skip to content
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

[QUESTION] How to read values from a Property Table? #241

Open
JamesGaskell opened this issue Jun 12, 2024 · 1 comment
Open

[QUESTION] How to read values from a Property Table? #241

JamesGaskell opened this issue Jun 12, 2024 · 1 comment
Labels
question Further information is requested

Comments

@JamesGaskell
Copy link

I'm using the SharpGLTF.Ext.3DTiles extension with Cesium and am able to build them and display them in Cesium reading values out of the property tables using conditions on the Cesium3DTileStyle.
This is how I'm building them following examples from this repo.

` var scene = new SceneBuilder("scene");
// mesh contains the vertices/triangles with a custom property vertex and Feature Id
scene.AddRigidMesh(mesh, transform);
var model = scene.ToGltf2();
var rootMetadata = model.UseStructuralMetadata();
var schema = rootMetadata.UseEmbeddedSchema("Schema");
var metadataClass = schema.UseClassMetadata("ClassMetadata");

// Values is a list of doubles
var propertyTable = metadataClass.AddPropertyTable(values.Length, "Property Table");

var heightMetaDataProperty = metadataClass.UseProperty("Value").WithFloat64Type();
propertyTable.UseProperty(heightMetaDataProperty).SetValues(propertyMaps.Heights);

var featureIdAttribute = new FeatureIDBuilder(values.Length, 0, propertyTable);
model.LogicalMeshes[0].Primitives[0].AddMeshFeatureIds(featureIdAttribute);`

But what I want to do now is read those values back out of the GLTF property table so I can update the model based on some user input and push it back to the cesium web client.
Based on 'src/SharpGLTF.Ext.3DTiles/README.md' and reading through unit tests I can read the feature Ids and access the StructuralMetadataClass and schema from the vertices but cannot find a way to get the "Value" array of doubles(/Float64s) from the property tables.
Have I missed something obvious? Is this possible?

@vpenades vpenades assigned vpenades and unassigned vpenades Jun 12, 2024
@bertt
Copy link
Contributor

bertt commented Jun 12, 2024

The 3D Tiles schema and values are stored separately.

So at the moment reading the values of the property tables back is not supported. Support can be added but it's some work to get right for all data types.

@vpenades vpenades added the question Further information is requested label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants