Map auto-hole regions into KCL artifacts#12414
Closed
Irev-Dev wants to merge 4 commits into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Consume the engine's hole_region_mappings response data when creating regions so auto-created cutout loops are represented as inner region paths. The selected outer loop continues to use region_mapping, while each hole mapping rebuilds the corresponding inner path and segment artifacts. This preserves the source sketch tags for generated hole side faces and lets face API edge specifiers resolve tags like plateRegion.tags.hole after extrusion. Also point kittycad-modeling-cmds at the pushed modeling-api branch for the new response field and add a simulation fixture covering chamfering an edge between an end cap and an auto-hole side face.
The branch temporarily points kittycad-modeling-cmds at the modeling-api PR branch. Cargo can resolve that from Cargo.lock, but nix build vendors git dependencies as fixed-output derivations and requires an explicit output hash. Add the outputHashes entry for kittycad-modeling-cmds 0.2.211 so the kcl-language-server derivation can vendor the dependency in CI.
Point-and-click selection can land on either a generated auto-hole region segment or the original sketch segment that produced it. The generated segment has the sweep and adjacency data needed for edge tagging, while the original sketch segment may not. Teach artifact graph selection helpers to resolve inner region paths through outerPathId, and to follow originalSegId mappings from source sketch segments to generated region segments for sweep and common-face lookup. Cover the direct inner-path selection case plus source-segment sweep and common-face resolution.
Merging this PR will not alter performance
Comparing Footnotes
|
e97c869 to
7249e91
Compare
Contributor
Author
|
superseded by #12467 |
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
hole_region_mappingsdata returned by the engine forregion(...).plateRegion.tags.hole, resolve to the generated side face after extrusion.kittycad-modeling-cmdsatKittyCAD/modeling-api#1272so this branch can build against the response shape it needs.Why
Take the following part:
When this part is made by extruding a single region with holes inside it, those holes are automatically cut out by the engine. Before this change, modeling app only rebuilt the selected outer region loop from
region_mapping.That meant the app did not have KCL paths or artifact graph paths for auto-created hole loops. So even once the engine knew that the hole side face came from the original sketch circle, the modeling app could not preserve that relationship all the way through to face tags or later refactors.
This PR wires that data through. The selected outer loop still uses
region_mapping, while each auto-created cutout loop is represented fromhole_region_mappings.It also wires the point-and-click path through the same relationship. In practice, selecting a cutout edge can hand the command code either the generated region segment or the original sketch segment that produced it. The generated segment has the sweep and adjacency data needed for tagging, while the original sketch segment often does not, so selection helpers now follow
originalSegIdback to the generated region segment when needed.Implementation
region(...)now readshole_region_mappingsfromCreateRegionandCreateRegionFromQueryPoint.pathsand stores auto-created cutout loops ininner_paths.outer_path_id.inner_path_id.outerPathId.originalSegIdfrom a source sketch segment to the generated region segment so it can use the generated segment's common faces.Alternative considered
Point-and-click behavior
outerPathIdto the swept outer region path.getCommonEdge.originalSegIdpoints at the selected source segment, then use that generated segment for sweep and common-face lookup.Why the Mermaid snapshot changes
Path.seg_idsfor region paths.Segment.path_id, but the region path itself did not list those segments.Path.seg_idsandSegment.path_id. Once both directions exist for the same path and segment pair, it deduplicates the relationship into an undirected-looking---edge.Path <--x SegmentbecomingPath --- Segment, reflecting that region paths now own their segments in both directions.Relies on https://github.com/KittyCAD/engine/pull/4777, can't merge until it is (and kittycad.ts is updated).
Screenshare.-.2026-07-13.1_05_11.PM.mp4