feat(occtkit): measure-deviation verb + metrics boundingBoxOptimal#59
Merged
Conversation
Adds the two introspection capabilities OCCTMCP's Swift server grew, so the
Node server (an occtkit-verb wrapper) can reach surface parity.
- `measure-deviation <a.brep> <b.brep> [--deflection D] [--max-samples N]`:
directed + symmetric surface Hausdorff. Meshes both shapes (deflection
defaults to 0.5% of the a-shape bbox diagonal), then for each sampled vertex
of one finds the exact closest point on the other's triangles (KD-tree
nearest vertices → incident triangles → point-to-triangle, Ericson). Reports
{max,rms,mean,worstPoint,samples} per direction + symmetricHausdorff. The
certify-a-reconstruction metric measure-distance can't give (min-only).
- `metrics --metrics ...,boundingBoxOptimal`: opt-in tight extent
(BRepBndLib::AddOptimal); the default Bnd_Box over-reports curved B-spline
faces (control-point hull). Default-all unchanged. (OCCTMCP #44)
Verified: coaxial cylinders Δr=0.5 → symmetricHausdorff ≈0.52; optimal box
tight vs Bnd_Box epsilon.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Brings two introspection capabilities to occtkit so OCCTMCP's Node server (an occtkit-verb wrapper) can reach parity with the Swift server, which already has both in-process.
measure-deviation <a.brep> <b.brep> [--deflection D] [--max-samples N]Directed + symmetric surface deviation (one-sided / symmetric Hausdorff).
measure-distancereturns the minimum gap — ≈0 for an overlapping reconstruction-vs-source pair, useless as a fidelity figure. This samples each shape's tessellated surface and projects onto the other's triangles:--deflectiondefaults to 0.5% of the a-shape bbox diagonal.{max, rms, mean, worstPoint, samples}forfromToTo/toToFrom+symmetricHausdorff.--max-samples(default 20000) stride-subsamples the source.metrics --metrics …,boundingBoxOptimalOpt-in tight extent (
BRepBndLib::AddOptimal). The defaultBnd_Boxover-reports curved B-spline faces (control-point hull); the optimal box is tight for curved geometry and equal for planar. Default-all set unchanged. (OCCTMCP #44)Verification
Built
-c release; tested with generated BREPs:symmetricHausdorff≈ 0.52 (the radial gap)boundingBoxOptimaltight (5.5/20) vsBnd_Boxepsilon; omitted unless requestedREADME introspection row + Makefile
VERBSupdated.🤖 Generated with Claude Code