Skip to content

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

@JamesGaskell

Description

@JamesGaskell

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?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions