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

Consider auto-generating the structure classes #20

Closed
javagl opened this issue Apr 17, 2023 · 3 comments
Closed

Consider auto-generating the structure classes #20

javagl opened this issue Apr 17, 2023 · 3 comments

Comments

@javagl
Copy link
Contributor

javagl commented Apr 17, 2023

The structure directory contains very basic structures for the handling of 3D Tiles data. These classes are plain old objects, without any functionality (i.e. no functions - only plain properties). These classes had been created manually in the 3d-tiles-validator, and then moved into the 3d-tiles-tools for the 0.2.0 release.

The structure of these classes directly corresponds to the 3D Tiles specification JSON schema. Therefore, it would probably make sense to replace these classes by classes that are auto-generated from the schema. The benefits here would be to

  1. be sure that the structures match the schema (although I'm pretty sure that they already do, and if they don't, that's usually intentional, and done for a reason, and may require tweaking any auto-generation proces...)
  2. have documentation for these classes

Of course, quick websearches show that there are tools for that, e.g. https://www.npmjs.com/package/json-schema-to-typescript - but ... further tests may be necessary before tackling this - for example, this library links to "json-schema-04", and we'll need one that supports much more recent schema versions.

@javagl
Copy link
Contributor Author

javagl commented May 3, 2023

While the bulk of the structure classes is now auto-generated (as of #32 ), I'll leave this issue open, because we might 1. want to try other tools that wetzel, and 2. still have to sort out some details for the "Batch Table", "Feature Table" and "Style" classes (see #36 )

@javagl
Copy link
Contributor Author

javagl commented May 20, 2023

First versions of the BatchTable/FeatureTable/Style classes have been integrated via #36 .

I'll still leave this issue open for a moment, because the state of wetzel that generated these classes is not perfect: It was still necessary to manually add some imports in the resulting classes. Resolving this within wetzel may not have the best effort-to-usefulness ratio, because as soon as these classes are "settled", there should never be a reason to re-generate them...

@javagl
Copy link
Contributor Author

javagl commented Jul 21, 2023

Trying to fix the import handling in wetzel does not seem to be the most productive thing right now. It would be nice to have, iff CesiumGS/wetzel#87 is ever supposed to become a real feature. But for now, I'll close this one.

@javagl javagl closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant