You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
solidcore: DXF geometry as general kernel maths, DXF checks in ops dxf::{import, export} (#21398) - #21542
Three kernel modules were named for the DXF code they came from. Their maths moves, unchanged, into modules named for what it computes; the DXF-facing ops API becomes solidcore_ops::dxf::{import, export}, as with STEP; every caller changes, with no aliases.
Before
Kernel now
Ops now
prism::path_export
prism::arc_conversion
dxf::export
prism::export_geometry (bounds)
prism::bounds
dxf::export
prism::export_geometry (scale, translate)
prism::transform
dxf::export
prism::import_geometry
prism::transform, prism::arc_conversion
dxf::import
DxfPath, DxfPathStyle
PlanarPath, PathStyle
PathStyle
import_geometry::chord_coordinates
prism::transform
affine::chord_coordinates
prism::arc_conversion also takes the checks on degree fields and centre/major/ratio ellipses (finite_degrees, ellipse_support and four more).
collapsed_coordinate, a comparison, becomes an ops function. The other checks use to_radians, hypot or float subtraction, which ops' lints refuse (docs/layers.md §4), so they stay in the kernel and ops re-exports them.
chord_coordinates serves the airfoil reader, so its ops entry is affine.
git grep -E "import_geometry|export_geometry|path_export" over crates/, docs/, xtask/, solidcore/crates/ at 312c61e619: no hits.
Not run: the test suites of crates this change does not touch, doctests, publish dry run and the kernel rig, left to CI.
CI run 45528305825 at 3c8e763feb is red for two reasons outside this change. The fillets rig shard tested a CLI built on main b199ad8545 against the cases of main b6bed2ad52, where #20464 had re-derived every-pocket-rim-edges-r2, every-pocket-rim-edges-r5-as-deep-as-pocket and every-pocket-floor-and-rim-edges-r2 for the new Auto turn (the older CLI built the mitred corners, four faces fewer than each case now wants). craft-plugin-wasmnative::tests::an_importer_says_a_valid_file_is_not_supported printed ok and then aborted with SIGABRT; that crate depends on nothing this change touches. The other 19 failed tests are on tests/KNOWN_FAILING_TESTS.
Units: none (a move; no kernel result changes)
In scope: the prism::{export_geometry, path_export, import_geometry} row of #21392: kernel modules renamed and split, ops dxf::{import, export}, callers in crates/io and solidcore-ops.
Out of scope: the other rows of #21392 (#21441 and #21525 take two of them).
Screenshots of the behavior (when observable)
Nothing is observable: modules and type names move, results don't.
Integration status
upstream/main5acca8bf41 merged in: the crates/io conflicts from #21853 keep main's solidcraft_kernel::services path with our module names on it; b199ad8545 merges cleanly. upstream/main9ef680c87e merged in at 312c61e619: only the module lists in crates/kernel/src/services.rs and solidcore-ops/src/lib.rs conflicted (main added paper_gaps; path_export stays out, it lives in dxf). Open PRs on crates/io/src/dxf*.rs (#18382, #18393, #19567, #20861, #21452) don't touch these calls.
Co-written and tested with Claude Code (AI).
Summary by CodeRabbit
Refactor
Updated how DXF geometry is handled during import and export, including coordinate conversion, shape checks, and bounds calculations.
Existing validation and error handling remain unchanged; no change to user-visible behavior is noted.
Tests
Updated regression coverage for geometry conversion and encoding checks.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Geometry helpers are reorganized into prism kernel modules and DXF-specific import and export modules. I/O call sites and tests use the new APIs. The described conversion, validation, and error-handling behavior remains largely unchanged.
Prism APIs use generic planar-path types instead of DXF-named types. Bounds and transform helpers are organized in their own modules. Arc and ellipse validation helpers are added, and tests use the reorganized APIs.
Organize solidcore-ops APIs solidcore/crates/solidcore-ops/src/dxf.rs, solidcore/crates/solidcore-ops/src/dxf/*, solidcore/crates/solidcore-ops/src/affine.rs, solidcore/crates/solidcore-ops/src/lib.rs, solidcore/crates/solidcore-ops/src/import_geometry.rs, solidcore/crates/solidcore-ops/src/tests.rs, solidcore/crates/solidcore-ops/src/blend.rs
The crate exposes DXF import and export modules that use prism APIs. Chord-coordinate conversion is added to affine, and the former geometry modules are removed. The chamfer scale-fit path uses the prism transform API.
Update import and chord-coordinate callers crates/io/src/airfoil.rs, crates/io/src/dxf.rs, crates/io/src/dxf/text_entity.rs
Airfoil and DXF import callers use the affine and DXF import APIs for chord coordinates, scaling, ellipse support, and text validation.
This reorganizes DXF geometry modules without changing behavior. No concrete merge-blocking risk was found; remaining checks such as doctests are left to CI.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title names the main change: DXF geometry maths moves into general kernel modules, and DXF checks move into solidcore-ops dxf::{import, export}. The raw summary confirms the module renames, the ne…
Linked Issues check
Issue #21398 has three coding requirements, and the PR meets each one.
1. General maths in the kernel as prism::{bounds, transform, arc_conversion}: The kernel `solidcore/crates/solidcore/src/prism.r…
Out of Scope Changes check
All changed files relate to the module move the issue requests.
- Kernel renames and splits (prism/arc_conversion.rs, prism/bounds.rs, prism/transform.rs, prism/tests.rs): these carry the mov…
Description check
The description follows the template. It has a Change section that links issue #21398, states the module and API moves in a table, and gives the 'Changes a default: no' line. It includes a Test change…
Existing Defaults Unchanged
The check passes. The PR changes no UX default. Evidence: - The PR summary and the PR description describe a refactor. Modules and types move or rename: `prism::{path_export, export_geometry, import_g…
Full details: Title check
Explanation
The title names the main change: DXF geometry maths moves into general kernel modules, and DXF checks move into solidcore-ops dxf::{import, export}. The raw summary confirms the module renames, the new dxf::{import, export} ops modules, and the removal of import_geometry, export_geometry, and path_export. The title is 97 characters, slightly long, and uses an issue-tracker style prefix, but it describes a real, specific change.
Full details: Linked Issues check
Explanation
Issue #21398 has three coding requirements, and the PR meets each one.
General maths in the kernel as prism::{bounds, transform, arc_conversion}: The kernel solidcore/crates/solidcore/src/prism.rs declares these modules and removes export_geometry, import_geometry and path_export. Bounds, affine transform and arc conversion code moved there unchanged in arithmetic.
DXF rules in ops as dxf::{import, export}: solidcore-ops adds pub mod dxf with import and export submodules. dxf::import holds scale_point, collapsed_coordinate and ellipse_support. dxf::export holds the bounds, transform and admission entry points. The PR keeps finite_degrees and ellipse_support in the kernel, and docs/layers.md §4 bans hypot, to_radians and similar calls in ops. So the kernel keeps the arithmetic checks, and ops re-exports them. This is a justified split under the repository layer rules, not a gap.
Done-when criteria: crates/io callers (dxf.rs, dxf_out.rs, dxf_out/file_model/*, airfoil.rs) switch to solidcore_ops::dxf::{import, export} and affine::chord_coordinates. The old ops modules are deleted. No kernel module is named for a file format. The reported run of 1095 passing solidcraft-io DXF round-trip tests is in the PR description. I did not re-run it. Its result rests on the author's report.
All changed files relate to the module move the issue requests.
Kernel renames and splits (prism/arc_conversion.rs, prism/bounds.rs, prism/transform.rs, prism/tests.rs): these carry the moved maths. Type renames (DxfPath to PlanarPath, DxfPathStyle to PathStyle, DxfShape to PathShape) follow from removing the file-format names.
Ops files (dxf.rs, dxf/export.rs, dxf/export/bounds.rs, dxf/import.rs, blend.rs, lib.rs, import_geometry.rs deleted, tests.rs): these carry the ops side of the split and the caller update (blend.rs uses prism::transform::scale_value).
solidcore-ops/src/affine.rs gains chord_coordinates: this moves the airfoil reader helper out of the deleted import_geometry module. The PR gives this reason.
crates/io callers and crates/io/src/dxf/path.rs (DxfPathStyle as a re-export of PathStyle): the PR states this alias is the crate's own name. It is not a kernel or ops alias.
Test edits: they change only paths and two test names. No assertion changes are reported in the summary.
No change adds unrelated behaviour. The summary shows no arithmetic change in the moved functions.
Full details: Description check
Explanation
The description follows the template. It has a Change section that links issue #21398, states the module and API moves in a table, and gives the 'Changes a default: no' line. It includes a Test change line that explains why no assertions changed. Validation lists commands, results, and measured counts at specific commit heads. The screenshot section explains why no observable behavior exists, which the template allows for changes with no useful observable behavior. The integration status section records upstream commits, merge conflicts, and open PRs. The description is thorough. Minor gaps: the Change section opens with the issue reference and the table, not a plain-words summary for a newcomer, and the title line is absent from the description body (the title is set separately).
Full details: Existing Defaults Unchanged
Explanation
The check passes. The PR changes no UX default. Evidence: - The PR summary and the PR description describe a refactor. Modules and types move or rename: prism::{path_export, export_geometry, import_geometry} become prism::{arc_conversion, bounds, transform}. Ops modules become dxf::{import, export}. DxfPath/DxfPathStyle become PlanarPath/PathStyle. The author states "No arithmetic changes" and "Changes a default: no". - The changed crates/io files (dxf.rs, dxf_out.rs, airfoil.rs, text_entity.rs, file_model*, path.rs) only change import paths and call sites. None of the summaries show a changed default value, preference, shortcut, layout, or command behaviour. - The solidcore/ changes are kernel-side. Under the check's terms they are not UX defaults, even where they change internal validation helpers. The Changes a default field of the description matches the code. - Each change is a rename or move. Nothing is removed from user-facing behaviour, and the PR adds no new default. - Limitation: the local main is not an accurate merge base for the PR branch. A local git diff main...HEAD covers about 2,600 files, so I could not isolate the PR diff by git. I relied on the PR summary and description, which describe only the module moves above. The conclusion rests on those descriptions.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…f::{import, export} (tangency-labs#21398)
The kernel's prism::{export_geometry, path_export, import_geometry} become
prism::{bounds, transform, arc_conversion}, with DxfPath and DxfPathStyle
renamed PlanarPath and PathStyle. The ops modules export_geometry,
import_geometry and path_export become dxf::{import, export};
collapsed_coordinate, a comparison only, moves to ops. chord_coordinates
(the airfoil reader) is ops affine::chord_coordinates. Callers in
crates/io and ops blend switch over. No arithmetic changes.
Co-Authored-By: Claude Code <noreply@anthropic.com>
Conflicts: solidcore-ops affine.rs (main's same_sense beside chord_coordinates)
and solidcore prism.rs (main's gusset module beside the renamed modules).
Co-Authored-By: Claude Code <noreply@anthropic.com>
MarkusReichart
changed the title
[WIP] solidcore: DXF geometry as general kernel maths, DXF checks in ops dxf::{import, export} (#21398)
solidcore: DXF geometry as general kernel maths, DXF checks in ops dxf::{import, export} (#21398)
Nov 24, 2026
Thanks for this. It now conflicts with current main, mostly from #21853, which routes import and export through the kernel interface. GitHub runs no CI on a conflicting PR. Here's where it conflicts:
Thanks, @bherbruck. Merged upstream/main (5acca8bf41) in as 3c8e763feb, no force-push.
The eight crates/io files you listed (airfoil.rs, dxf.rs, dxf/text_entity.rs, dxf_out.rs, dxf_out/file_model.rs, dxf_out/file_model/bulges.rs, dxf_out/file_model/geometry.rs, dxf_out/path.rs) keep main's solidcraft_kernel::services path from Kernel: import and export call solidcore through SolidCraft's kernel interface #21853, with this PR's module names on it: services::dxf::{import, export} and services::affine::chord_coordinates.
crates/kernel/src/services.rs re-exports solidcore_ops::dxf in place of export_geometry, import_geometry and path_export, and the io row of the table in docs/design/kernel-layer.md names the new items.
Check at 3c8e763feb: cargo xtask fast --base upstream/main --no-tests gives "all checks passed". git grep finds no uses of the three old module names left. Tests are left to CI.
Heads-up, this is on us: main just moved SolidCraft's kernel calls behind its own kernel interface, so this branch no longer compiles once merged with main. The fix is mechanical: merge main, then change solidcore_ops::X to solidcraft_kernel::services::X (same names; solidcore_tess:: → solidcraft_kernel::services::tess::, solidcore_step:: → solidcraft_kernel::services::step::). If something you need is missing from services, say so here and we'll add it. If you'd rather we make the change on a branch for you, just say so.
…r, drop the re-export
Co-authored-by: MarkusReichart <52602624+MarkusReichart@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged main. Main re-exported solidcore_ops::import_geometry from the kernel services, but this PR moves those helpers into the DXF reader and deletes that module, so I dropped the re-export (nothing else uses it). cargo check on kernel, io, engine and doc with tests is clean.
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
approved-for-ciReviewed: run the full PR CI (build, tests, goldens, Clippy)ready to mergereviewed, every ask addressed; merge once CI is green
2 participants
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.
Change
Fixes #21398. Part of #21392.
Three kernel modules were named for the DXF code they came from. Their maths moves, unchanged, into modules named for what it computes; the DXF-facing ops API becomes
solidcore_ops::dxf::{import, export}, as with STEP; every caller changes, with no aliases.prism::path_exportprism::arc_conversiondxf::exportprism::export_geometry(bounds)prism::boundsdxf::exportprism::export_geometry(scale, translate)prism::transformdxf::exportprism::import_geometryprism::transform,prism::arc_conversiondxf::importDxfPath,DxfPathStylePlanarPath,PathStylePathStyleimport_geometry::chord_coordinatesprism::transformaffine::chord_coordinatesprism::arc_conversionalso takes the checks on degree fields and centre/major/ratio ellipses (finite_degrees,ellipse_supportand four more).collapsed_coordinate, a comparison, becomes an ops function. The other checks useto_radians,hypotor float subtraction, which ops' lints refuse (docs/layers.md §4), so they stay in the kernel and ops re-exports them.chord_coordinatesserves the airfoil reader, so its ops entry isaffine.crates/ioreaches them throughsolidcraft_kernel::services::dxf(main's path since Kernel: import and export call solidcore through SolidCraft's kernel interface #21853);servicesre-exportsdxfin place of the three old modules.crates/iokeeps its own word,DxfPathStyle(70 uses, mostly tests), aspub use ...::PathStyle as DxfPathStyle.dxf/export/bounds.rs, re-exported fromdxf::export, so git sees each file as a rename.No arithmetic changes, so no new test: the existing tests run under the new paths.
Why one PR: a move without aliases changes each definition and its callers together; most counted lines are functions moving between files.
Changes a default: no
Test change: no assertion changed; tests of moved functions use the new paths, and two test names drop the old module names.
Validation
At head
312c61e619(upstream/main9ef680c87emerged in):cargo xtask fast --base upstream/main --no-tests: "all checks passed".At the previous head
f03ef1bcff(upstream/mainc56fe82505):solidcore/: fmt,cargo clippy --workspace --all-targets -- -D warnings, wasm andscripts/ci: pass.cargo xtask fast --base upstream/main --no-tests: "all checks passed".cargo test -p solidcore -p solidcore-ops: 9505 passed, 0 failed, 75 skipped.cargo nextest run -p solidcraft-io(DXF round trips, now throughdxf::{import, export}): 1095 passed, 0 failed, 3 skipped.cargo run --profile goldens -p goldens:goldens: 283 unit(s), 283 passed, 0 failed.cargo deny check: pass.git grep -E "import_geometry|export_geometry|path_export"overcrates/,docs/,xtask/,solidcore/crates/at312c61e619: no hits.Not run: the test suites of crates this change does not touch, doctests, publish dry run and the kernel rig, left to CI.
CI run 45528305825 at
3c8e763febis red for two reasons outside this change. The fillets rig shard tested a CLI built on mainb199ad8545against the cases of mainb6bed2ad52, where #20464 had re-derivedevery-pocket-rim-edges-r2,every-pocket-rim-edges-r5-as-deep-as-pocketandevery-pocket-floor-and-rim-edges-r2for the new Auto turn (the older CLI built the mitred corners, four faces fewer than each case now wants).craft-plugin-wasmnative::tests::an_importer_says_a_valid_file_is_not_supportedprintedokand then aborted with SIGABRT; that crate depends on nothing this change touches. The other 19 failed tests are ontests/KNOWN_FAILING_TESTS.Units: none (a move; no kernel result changes)
In scope: the
prism::{export_geometry, path_export, import_geometry}row of #21392: kernel modules renamed and split, opsdxf::{import, export}, callers incrates/ioandsolidcore-ops.Out of scope: the other rows of #21392 (#21441 and #21525 take two of them).
Screenshots of the behavior (when observable)
Nothing is observable: modules and type names move, results don't.
Integration status
upstream/main5acca8bf41merged in: thecrates/ioconflicts from #21853 keep main'ssolidcraft_kernel::servicespath with our module names on it;b199ad8545merges cleanly.upstream/main9ef680c87emerged in at312c61e619: only the module lists incrates/kernel/src/services.rsandsolidcore-ops/src/lib.rsconflicted (main addedpaper_gaps;path_exportstays out, it lives indxf). Open PRs oncrates/io/src/dxf*.rs(#18382, #18393, #19567, #20861, #21452) don't touch these calls.Co-written and tested with Claude Code (AI).
Summary by CodeRabbit