Cylinder stock - #130
Merged
Merged
Cylinder stock#130
Conversation
ShapeStock keys its geometry on a JSON string of the figure and builds from the parsed copy. JSON writes NaN and Infinity as null, so a non-finite scalar allowance reached boxStockBounds as null and threw TypeError. The key now encodes non-finite numbers as strings and the parse restores them, so every non-finite figure throws RangeError. A resolved BoxStockInput declares the preview options (offset, allowance, dimensions, position, positionOffset) as never; they were accepted and silently ignored. orientedBoxStockGeometry normalises the frame axis and projects refDirection square to it before building the basis, so a non-unit or skewed frame no longer scales or shears the block. A zero refDirection throws RangeError. The Changeset and README note that StockProps is now a union type alias.
JustinSGray
approved these changes
Oct 2, 2026
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.
Summary
Stock, accepting exactly one ofgeometry,glb,boxorcylinder.Breaking changes
Remove
BoxStockandBoxStockProps. Replace them with:Existing
<Stock geometry={geometry} />usage remains supported.StockPropsis now a union type alias rather than an interface, sointerface X extends StockPropsno longer compiles. Usetype X = StockProps & { … }, orStockAppearancePropsfor the shared appearance props alone.Public package release
@toolpath/viewer.