Skip to content

chore(#118): bump OCCTSwift floor to 3.0.0 - #119

Merged
gsdali merged 1 commit into
mainfrom
chore/118-occtswift-3.0.0
Aug 19, 2026
Merged

chore(#118): bump OCCTSwift floor to 3.0.0#119
gsdali merged 1 commit into
mainfrom
chore/118-occtswift-3.0.0

Conversation

@gsdali

@gsdali gsdali commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

What & why

OCCTSwift v3.0.0 shipped
2026-08-18 with two breaking changes. Selector.SubShapeType.compsolid renamed .compSolid
needed no source change here (this repo already used the surviving ShapeType.compSolid
spelling). Shape.bounds/.size/.center, Wire.bounds, Edge.bounds, Face.bounds became
Optional (they used to fabricate (0,0,0)-(0,0,0) for a shape with no bounding box,
indistinguishable from a genuine zero-size shape at the origin). Every call site here now
unwraps: QueryTopology/LoadBrep/MeasureDeviation/RenderPreview/Metrics throw a named
ScriptError on a nil bounding box; the two recipe edge-selector predicates return false
rather than fabricate a match.

Closes #118

This is not ready to release yet, by design. The rest of the cohort
(OCCTSwiftTools/Mesh/IO/AIS) has not shipped an OCCTSwift-3.0.0-compatible release, and
OCCTSwiftAIS additionally has 3 of its own unfixed .bounds call sites, so CI on this PR is
expected to fail (remote graph resolution) until they catch up — same situation as the 2.0.0
bump (see the new OKF decision entry, occtswift-3.0.0-floor-bump-blocked-on-cohort-releases.md,
for the full detail and how this was verified anyway: a local build with a temporary,
reverted-after-verification patch to the AIS sibling checkout). Merge review doesn't require a
resolvable graph, only the eventual release tag does.

Checklist

  • New or changed behavior is covered by a unit test in the same PR:
    Tests/OcctkitCommandTests/OptionalBoundsTests.swift constructs a genuinely void shape
    (the intersection of two disjoint boxes) and asserts the new throw paths fire instead of
    fabricating a zero-size box.

Notes for the reviewer

  • swift build, swift build --build-tests, swift test (12/12), and
    Scripts/recipe-check.sh against a release build (all 7 recipes match their reference
    output.brep exactly, Δvol 0.00e+00) all verified clean locally against the real v3.0.0
    OCCTSwift sibling checkout.
  • Package.resolved is intentionally left untouched, matching the Bump OCCTSwift floor to 2.0.0 #111 precedent: regenerating
    it now would either commit path-relative local-machine state or fail outright against remote.
  • Do not merge-and-tag a release until the cohort (Tools/Mesh/IO/AIS) ships its own 3.0.0-era
    repin — tracked in the OKF decision entry linked above.

Two breaking changes, both compile errors:

- Selector.SubShapeType.compsolid renamed .compSolid, consolidating four
  drifted Swift mirrors of TopAbs_ShapeEnum onto ShapeType. Zero source
  changes needed: this repo already spelled it ShapeType.compSolid.
- Shape.bounds/.size/.center, Wire.bounds, Edge.bounds, Face.bounds become
  Optional instead of fabricating (0,0,0)-(0,0,0) for a shape with no
  bounding box. Every call site now unwraps: QueryTopology/LoadBrep/
  MeasureDeviation/RenderPreview/Metrics throw a named ScriptError on a nil
  bounding box (a real error on a loaded BREP, not a state to paper over
  with ?? .zero); the two recipe edge-selector predicates return false on a
  nil bounds rather than fabricate a match.

Added Tests/OcctkitCommandTests/OptionalBoundsTests.swift, a regression
suite that constructs a genuinely void shape (the intersection of two
disjoint boxes) and asserts LoadBrepCommand.buildResponse and
MeasureDeviationCommand.defaultDeflection throw rather than fabricate a
zero-size box.

swift build, swift test (12/12), and the recipe smoke suite (all 7 recipes,
matching their reference output.brep exactly) all verified clean locally
against the real v3.0.0 sibling checkout.

The rest of the cohort (OCCTSwiftTools/Mesh/IO/AIS) has not yet released an
OCCTSwift-3.0.0-compatible version, and OCCTSwiftAIS has 3 of its own
unfixed .bounds call sites, so neither a fresh clone/CI run nor an as-is
local sibling build can resolve the full graph yet. Package.resolved is
left untouched, matching the #111 precedent. See the new OKF decision entry
for the full detail; this repo's release should wait for the cohort, same
situation as the 2.0.0 bump.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gsdali
gsdali merged commit 460b1d9 into main Aug 19, 2026
5 of 11 checks passed
@gsdali
gsdali deleted the chore/118-occtswift-3.0.0 branch August 19, 2026 08:11
@kilo-code-bot

kilo-code-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (14 files)
  • CLAUDE.md - Documentation updated for OCCTSwift 3.0.0 floor
  • Package.swift - Dependency bumped from 2.0.0 to 3.0.0 with detailed rationale
  • Sources/occtkit/Commands/LoadBrep.swift - Added nil check for shape.bounds, throws ScriptError
  • Sources/occtkit/Commands/MeasureDeviation.swift - Added nil check in defaultDeflection, throws ScriptError
  • Sources/occtkit/Commands/Metrics.swift - Added nil check for shape.bounds, throws ScriptError
  • Sources/occtkit/Commands/QueryTopology.swift - Added nil checks for face.bounds and edge.bounds, throws ScriptError
  • Sources/occtkit/Commands/RenderPreview.swift - Added nil check for shape.bounds, throws ScriptError
  • Tests/OcctkitCommandTests/OptionalBoundsTests.swift - New regression test for void shape bounds handling
  • okf/decisions/concave-edge-classifier-can-select-wrong-edges.md - Added note about OCCTSwift 3.0.0 bounds change
  • okf/decisions/index.md - Added reference to new decision entry
  • okf/decisions/occtswift-3.0.0-floor-bump-blocked-on-cohort-releases.md - New decision documenting cohort blocker
  • okf/log.md - Log entry for the bump
  • recipes/01-mounting-bracket/main.swift - Fixed edge selector to handle optional bounds
  • recipes/03-pipe-flange/main.swift - Fixed edge selector to handle optional bounds

Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 190.7K · Output: 10.6K · Cached: 397.4K

gsdali added a commit that referenced this pull request Aug 19, 2026
Package.resolved was last regenerated well before the 2.0.0/3.0.0 bumps
(occtswift pinned at 1.17.0, occtswiftais at 1.3.1) and was deliberately
left untouched across both floor-bump PRs (#111, #119) since remote
resolution was blocked either way at the time.

Now that the whole cohort has shipped 3.0.0-compatible releases, that
staleness became actively wrong: SwiftPM's resolver treats an existing
Package.resolved as a starting point and keeps a pinned version if it still
satisfies every declared constraint, even if the *manifest* constraints
don't capture real source compatibility. occtswiftais@1.3.1 satisfies
OCCTSwiftTools's `>= 1.6.1` constraint just fine on paper; its actual
Dimension.swift/AreaSelection.swift source still calls the now-Optional
`.bounds` the old, unwrapped way. Manifest-level resolution can't see that,
so main's tests/verbs CI kept failing post-v1.6.2 release even after
OCCTSwiftAIS v1.3.2 (with the real fix) was published.

Verified genuinely fresh (no local sibling checkouts, no stale lockfile) in
an isolated /tmp copy of this repo: `swift package resolve` + `swift build
--product occtkit` both clean, resolving occtswift 3.0.0 / occtswiftais
1.3.2 / occtswifttools 1.6.4 / occtswiftmesh 1.7.5 / occtswiftio 1.7.8 /
occtswiftviewport 1.1.27 throughout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

Bump OCCTSwift floor to 3.0.0

1 participant