Refactor meshly library for improved encoding/decoding with nested Packable cache support#13
Merged
afshawnlotfi merged 3 commits intomainfrom Jan 14, 2026
Merged
Conversation
- Updated Python tests to verify encoding returns bytes instead of arrays. - Modified JAX support tests to use new array_type parameter for loading meshes. - Adjusted packable tests to ensure encode produces bytes and added consistency checks. - Revised TypeScript README to reflect changes from loading to decoding meshes. - Enhanced array utility functions for loading and decoding arrays from zip files. - Removed obsolete utility classes and methods related to zip file operations. - Implemented custom field decoding in the Packable class for better extensibility. - Updated Mesh class to handle custom field configurations and decoding for vertices and indices.
- Introduced CacheLoader and CacheSaver types for handling cached Packables. - Updated Packable class to support saving and loading nested Packables with caching. - Implemented cache deduplication for identical nested Packables. - Enhanced ArrayUtils to skip Packable instances during extraction. - Added tests for nested Packable caching functionality. - Updated TypeScript definitions and README to reflect new cache support features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the meshly library to improve the encoding/decoding architecture and adds cache support for nested Packables in both Python and TypeScript.
Encoding/Decoding Improvements
encode()to returnbytesinstead of arrays for consistencyArrayUtilsfor loading and decoding arrays from zip filesCustomFieldConfigpattern inPackableclass for extensibilityNested Packable Cache Support
CacheLoaderandCacheSavercallback types for flexible cache backendsReadHandler.create_cache_loader()andWriteHandler.create_cache_saver()for easy filesystem cachingCacheLoadertype andcacheLoaderparameter todecode()methodsTesting
array_typeparameterDocumentation
CacheLoader/CacheSaverto API referencePython Tests: 148 passing ✅
TypeScript Tests: 15 passing ✅