fix: drop imported models onto the workplane centre - #91
Open
FutuRiata wants to merge 1 commit into
Open
Conversation
Every importer places the imported shape at a fixed offset: x: 10, z: -10, The same pair is repeated in stlImport, objImport and svgImport. By the time this object is built, the geometry has already been centred on its own bounding box in X and Z and seated on the plane in Y — so the work of bringing the model to the origin is done, and the last step deliberately undoes part of it. The offset does not scale with anything. On a 35 mm part it is visible; on a 190 mm model it reads as a rounding error rather than a decision. It is also awkward to undo: the shape panel has no X or Y field, so the only numeric way to move a shape is the arrow keys, one snap step per press — and the direction depends on the current camera angle. Zeroing the pair puts the model where the user is already looking. Users arriving from other browser CAD tools expect exactly that. If the offset exists so that an imported model does not land on top of a primitive created at the origin, the offset is still the wrong lever: it is in the way every time and helps in one narrow case. Offsetting the *new primitive* when the spot is taken would fit better. 264 tests pass unchanged.
mhaeu
pushed a commit
to mhaeu/SketchForge-3D
that referenced
this pull request
Sep 9, 2026
Every importer places the imported shape at a fixed offset: x: 10, z: -10, The same pair is repeated in stlImport, objImport and svgImport. By the time this object is built, the geometry has already been centred on its own bounding box in X and Z and seated on the plane in Y — so the work of bringing the model to the origin is done, and the last step deliberately undoes part of it. The offset does not scale with anything. On a 35 mm part it is visible; on a 190 mm model it reads as a rounding error rather than a decision. It is also awkward to undo: the shape panel has no X or Y field, so the only numeric way to move a shape is the arrow keys, one snap step per press — and the direction depends on the current camera angle. Zeroing the pair puts the model where the user is already looking. Users arriving from other browser CAD tools expect exactly that. If the offset exists so that an imported model does not land on top of a primitive created at the origin, the offset is still the wrong lever: it is in the way every time and helps in one narrow case. Offsetting the *new primitive* when the spot is taken would fit better. 264 tests pass unchanged. Applied-from: Formsmith746#91 (upstream nicht gemergt) Applied-by: Claude Opus 5 <noreply@anthropic.com>
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.
Every importer places the imported shape at a fixed offset:
The same pair is repeated in
stlImport.ts,objImport.tsandsvgImport.ts.By the time this object is built the geometry has already been centred on its own bounding box in X and Z and seated on the plane in Y — the work of bringing the model to the origin is done, and the last step deliberately undoes part of it.
Two reasons this is worth changing:
It does not scale with anything. On a 35 mm part the offset is visible; on a 190 mm model it reads as a rounding error rather than a decision.
It is awkward to undo. The shape panel has no X or Y field, so the only numeric way to move a shape is the arrow keys, one snap step per press — and the direction depends on the current camera angle. Returning an import to the centre is ten presses per axis.
Users arriving from other browser CAD tools expect the import to land where they are already looking.
If the offset exists so that an imported model does not land on top of a primitive created at the origin, the offset still seems like the wrong lever: it is in the way every time and helps in one narrow case. Offsetting the new primitive when the spot is taken would fit better — happy to look at that instead if you prefer.
Six lines changed across three files. All 264 tests pass unchanged;
tsc --noEmitis clean.