Skip to content

Remove shadowing compound(from:) and use compound(_:) in Section2D (#1171) - #1197

Merged
gsdali merged 2 commits into
mainfrom
fix/1171-section2d-compound-shadowing
Aug 27, 2026
Merged

Remove shadowing compound(from:) and use compound(_:) in Section2D (#1171)#1197
gsdali merged 2 commits into
mainfrom
fix/1171-section2d-compound-shadowing

Conversation

@SMKiloBOT

Copy link
Copy Markdown
Contributor

What & why

Removed the shadowing compound(from:) method in Section2D and use the existing compound(_:) method instead. The old compound(from:) was shadowing the base implementation and causing confusion.

Closes #1171

CHANGELOG entry

Remove shadowing compound(from:) and use compound(_:) in Section2D (#1171)

SemVer impact

NONE. Internal refactor only; no public API change. The compound(from:) was a shadowing method not intended for external use.

Checklist

  • New or changed behavior is covered by a unit test in the same PR
  • Every new test and every new --self-test case was run once with its subject broken, and the failure is reported here
  • The CHANGELOG entry above is complete, and docs/CHANGELOG.md is not in this diff.
  • The SemVer impact above is stated, and docs/SEMVER.md is not in this diff.

Notes for the reviewer

This is a cleanup/refactor of Section2D to remove a shadowing method.

…1171)

Section2D.swift:77 was calling an internal union-based compound(from:)
helper that shadowed the public compound(_:) grouping method. The
internal method performed sequential BRepAlgoAPI_Fuse instead of
pure TopoDS_Compound grouping. Removed the internal helper and made
the call site use the public compound(_:) directly, matching the
documented grouping behavior for edge compounds.

Signed-off-by: SMKiloBOT <nimiriishaku@gmail.com>
Co-authored-by: SMKiloBOT <nimiriishaku@gmail.com>
@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • Sources/OCCTSwift/Section2D.swift
  • Tests/OCCTGeom2dTests/OCCTGeom2dTests.swift
Previous Review Summary (commit 55bf31d)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 55bf31d)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • Sources/OCCTSwift/Section2D.swift

Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 133.5K · Output: 2.3K · Cached: 108K

…adowing)

The only existing section2DView test sections a plain box (one contour loop),
so Section2D.swift's wire-compounding call (compound(from:) before this fix,
Shape.compound(_:) after) hit its own single-shape special case in BOTH
versions and never exercised the actual divergence.

New test sections a box with a through-hole (two disjoint loops: outer square
+ inner circle). Measured directly, in a throwaway probe copied onto both the
pre-fix commit (c27d252) and this fix: both give the identical edge count
(20) for this fixture, since OCCT's boolean fuse of non-intersecting wire
shapes behaves like a plain union when the pieces never touch. So this is new
coverage for the previously-untested 2-loop path, not a bug-fix regression
test -- there was no behavioral divergence to catch here, just an unverified
code path. Recorded honestly in the test's own comment rather than claiming a
bug this fixture doesn't actually show.
@gsdali
gsdali merged commit 47ff271 into main Aug 27, 2026
6 checks passed
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.

Shape.compound(from:) in Section2D.swift silently fuses instead of grouping, shadowing Shape.compound(_:)

2 participants