Skip to content

Measure parallel-face distance with automatic annotation planes - #14347

Draft
nicboone8 wants to merge 1 commit into
mainfrom
fix/gdt-parallel-face-distance
Draft

nicboone8 wants to merge 1 commit into
mainfrom
fix/gdt-parallel-face-distance

Conversation

@nicboone8

@nicboone8 nicboone8 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Distance annotations between two parallel planar faces now choose a display plane containing their common normal automatically. Point-and-click users can select both faces, invoke GDT Distance, and leave Frame Plane on Automatic. The generated KCL preserves both face references and omits framePlane, allowing the runtime to recalculate the orientation as the model changes.

Pair this with engine #5249, which corrects the measured endpoints: a 12 mm sideways offset plus a 5 mm plane separation displays 5 mm, rather than 13 mm. Deploy the engine correction before shipping this app behavior. There are no new engine commands, fields, or schema changes; KCL uses existing FaceIsPlanar and hidden MakePlane commands with its existing internal Plane type.

Explicit display planes must contain the measurement direction; incompatible planes produce a diagnostic. Nonparallel/curved face pairs and edge measurements retain their existing measurement semantics. The command handles primitive face/edge selections, permits omitted tolerance, preserves Automatic when editing, and uses centered model-scaled distance placement. The placement work overlaps #14285 and should be reconciled before merging. #14308 remains independent and is not a prerequisite.

Regression coverage includes generated KCL through the real command codemod, edit round trips without tolerance, automatic/explicit planes, opposite normals, and rotated normals. All 127 targeted app tests and 28 Rust GD&T tests passed; the updated WebAssembly built and these app tests ran against it. Engine-backed visual validation remains pending a dev engine with #5249 and a Zoo dev token; the C++ engine tests have not been run locally.

For a point-and-click smoke check, paste the following without its final gdt::distance call, select lowerTop and upperBottom in the scene (rotate between selections if needed), and apply GDT Distance with Automatic and no tolerance. Expect 5.000 mm. Move the upper circle sideways or reverse the selection order; the value must remain 5 mm. The complete snippet also tests the direct KCL path:

@settings(defaultLengthUnit = mm, kclVersion = 2)

lowerSketch = sketch(on = XY) {
  perimeter = circle(start = [5mm, 0mm], center = [0mm, 0mm])
}
lower = extrude(region(segments = [lowerSketch.perimeter]), length = 2mm, tagEnd = $lowerTop)

upperPlane = offsetPlane(XY, offset = 7mm)
upperSketch = sketch(on = upperPlane) {
  perimeter = circle(start = [15mm, 0mm], center = [12mm, 0mm])
}
upper = extrude(region(segments = [upperSketch.perimeter]), length = 2mm, tagStart = $upperBottom)

gdt::distance(from = lowerTop, to = upperBottom, fontSize = 1mm)

Addresses #11623 together with engine #5249. The display plane is kept distinct from measurement semantics, as discussed in #10607.

Product documentation: documentation #1069.

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modeling-app Ready Ready Preview Oct 2, 2026 8:45pm UTC

Request Review

@codspeed

codspeed Bot commented Oct 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 157 untouched benchmarks
⏩ 131 skipped benchmarks1


Comparing fix/gdt-parallel-face-distance (68e08d5) with main (3a03c28)2

Open in CodSpeed

Footnotes

  1. 131 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (da59d35) during the generation of this report, so 3a03c28 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

This branch was successfully deployed

1 active deployment
Preview — 68e08d55 Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant