Skip to content

feat(occtkit): --allow-invalid on load-brep / import (OCCTSwift 1.8.0)#60

Merged
gsdali merged 1 commit into
mainfrom
feat/allow-invalid-import
Jun 20, 2026
Merged

feat(occtkit): --allow-invalid on load-brep / import (OCCTSwift 1.8.0)#60
gsdali merged 1 commit into
mainfrom
feat/allow-invalid-import

Conversation

@gsdali

@gsdali gsdali commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

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.

Change

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. 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 reports isValid: false

Enables OCCTMCP #41 (load + measure an imperfect reconstruction). Built -c release.

🤖 Generated with Claude Code

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>
@gsdali gsdali merged commit 4859b27 into main Jun 20, 2026
0 of 2 checks passed
@gsdali gsdali deleted the feat/allow-invalid-import branch June 20, 2026 00:09
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