Use the new volmdlr GLB viewer in the knapsack tutorial (require volmdlr>=0.22.2)#55
Open
pgibertini wants to merge 1 commit into
Open
Use the new volmdlr GLB viewer in the knapsack tutorial (require volmdlr>=0.22.2)#55pgibertini wants to merge 1 commit into
pgibertini wants to merge 1 commit into
Conversation
pgibertini
force-pushed
the
feat/volmdlr-0.22.2-new-viewer
branch
3 times, most recently
from
July 22, 2026 19:20
a58e062 to
b7a562b
Compare
- pyproject: require volmdlr>=0.22.2.
- add a @volmdlr_view (model.json v2.6 + GLB) display to each class, alongside
the existing @cad_view (Babylon). Import VolumeModel from volmdlr.model (the
display-capable class in 0.22.2; volmdlr.core.VolumeModel is a stub) and name
it with the object name so the viewer tree root shows it.
- KnapsackPackage.volmdlr_primitives: delegate to self.items (an Items wrapper)
anchored at "{reference_path}/items", so item paths resolve as
#/items/items/{i} via get_in_object_from_path (were #/items/{i}, which hit the
Items wrapper and failed). Geometry unchanged.
reference_path is threaded through volmdlr_primitives and the export root.
https://claude.ai/code/session_01MkzWt77anKrfiZb7Te7syn
pgibertini
force-pushed
the
feat/volmdlr-0.22.2-new-viewer
branch
from
July 22, 2026 19:21
b7a562b to
f912d03
Compare
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.
Adds the new
@volmdlr_viewdisplay (model.json v2.6 + content-addressed GLBs, introduced in volmdlr 0.22.2) to the knapsack tutorial, alongside the existing@cad_view(Babylonbabylon_data).Changes
pyproject.toml: requirevolmdlr>=0.22.2(was commented out).knapsack_problem.py:VolumeModelfromvolmdlr.model(the display-capable class in 0.22.2;volmdlr.core.VolumeModelis a stub withoutbabylon_data/volmdlr_view).volmdlr_view(@volmdlr_view) method to each class next to itscadview(@cad_view), returningVolumeModel(...).volmdlr_view(reference_path=...).reference_paththreaded throughvolmdlr_primitivesand the export root, so a clicked part resolves on the live object viaget_in_object_from_path.Both displays are kept so the tutorial shows the Babylon and GLB viewers side by side.
Depends on volmdlr!423 (v0.22.2) and dessia_common!139 (VolmdlrView forwards reference_path).
https://claude.ai/code/session_01MkzWt77anKrfiZb7Te7syn