Repository navigation
feat(exchange): export_step_in for bodies in a unit other than metres - #35
Open
Basnederveen wants to merge 1 commit into
Open
Basnederveen wants to merge 1 commit into
Basnederveen wants to merge 1 commit into
Conversation
export_step takes a body's coordinates as metres and scales them to the
file unit. A body built in millimetres had no way to say so: exporting
it as millimetres multiplied every coordinate by 1000 (a 100 mm plate
came out 100 m wide).
export_step_in(brep, model_unit, unit) takes the unit the body is built
in ("metre" or "millimetre") and scales from it to the file unit once.
export_step keeps its behaviour and delegates with model_unit = "metre".
The scale is a fixed table, so metre bodies export the same digits as
before. export_bodies takes the model unit; the world graph passes
"metre".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VFZvqx1RmXzPtbL9VXP4H7
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.
What
export_steptakes a body's coordinates as metres and scales them to the file unit. A body built in millimetres had no way to say so: exporting it as millimetres multiplied every coordinate by 1000, so a 100 mm plate came out 100 m wide.export_step_in(brep, model_unit, unit)takes the unit the body is built in ("metre"or"millimetre") and scales from it to the file unit once.export_step(brep, unit)keeps its behaviour and delegates withmodel_unit = "metre".InvalidGeometrytoo.export_bodiesgets the model unit as a parameter. The world graph passes"metre", so world-graph STEP export (and its binding) behaves as before. A model-unit option there could follow if wanted.Tests
exchange::step::tests::a_body_in_millimetres_exports_unscaled_in_millimetres: a millimetre body exported to millimetres is the metre export digit for digit except theSI_UNITprefix; the default path still scales; millimetre to metre scales the report's bounds by 1e-3; unknown file or model units are refused.cargo fmt --check,cargo clippy --all-targets -D warnings: clean.cargo test --all-targets --no-fail-fast(withCI=true, Windows x86_64): 786 pass, 0 fail, 1 ignored. Cleanmaingives 785 pass, 0 fail, the same 1 ignored; the extra test is the new one.npm run check:source,check:duplicates,check:cycles: clean.check:apinot run (needs the SDK build); no TypeScript or binding signature changes.Files
main/opengeometry/src/exchange/step/mod.rsmain/opengeometry/src/exchange/step/tests.rsmain/opengeometry/src/exchange/mod.rsmain/opengeometry/src/world_graph/export.rs🤖 Generated with Claude Code