feat(occtkit): --allow-invalid on load-brep / import (OCCTSwift 1.8.0)#60
Merged
Conversation
An in-progress reconstruction (a compound of loose analytic faces, possibly
with a few invalid faces) was refused by load-brep / import because the BREP
write gated on shape.isValid — so it could never be loaded to be measured.
Add --allow-invalid (JSON: allowInvalid) to both verbs, threaded through
GraphIO.writeBREP to OCCTSwift 1.8.0's Exporter.writeBREP(allowInvalid:), which
skips the validity gate. Default off preserves the gate. Bumps the OCCTSwift
floor to 1.8.0.
Verified: a bowtie (self-intersecting) face is rejected without the flag
("Shape is invalid or empty") and loaded with isValid:false under it. Enables
OCCTMCP #41 (measure an imperfect reconstruction).
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.
An in-progress reconstruction — a compound of loose analytic faces, possibly with a few invalid faces — was refused by
load-brep/import, because the BREP write gated onshape.isValid. So it could never be loaded to be measured.Change
Add
--allow-invalid(JSON:allowInvalid) to both verbs, threaded throughGraphIO.writeBREPto OCCTSwift 1.8.0'sExporter.writeBREP(allowInvalid:), which skips the validity gate. Default off preserves the gate. OCCTSwift floor → 1.8.0.Verification
A bowtie (self-intersecting) polygon face — deterministically invalid:
load-brep <bowtie.brep>→ "Shape is invalid or empty" (gate)load-brep <bowtie.brep> --allow-invalid→ succeeds, body reportsisValid: falseEnables OCCTMCP #41 (load + measure an imperfect reconstruction). Built
-c release.🤖 Generated with Claude Code