Skip to content

refactor(drawing): unify circle-visibility test between addAutoDimensions and addAutoCentermarks (#1181) - #1201

Merged
gsdali merged 2 commits into
mainfrom
fix/1181-unify-circle-visibility-test
Aug 27, 2026
Merged

refactor(drawing): unify circle-visibility test between addAutoDimensions and addAutoCentermarks (#1181)#1201
gsdali merged 2 commits into
mainfrom
fix/1181-unify-circle-visibility-test

Conversation

@SMKiloBOT

Copy link
Copy Markdown
Contributor

What & why

Unified the circle-visibility test (edge-on cutoff + bounds clip) shared by addAutoDimensions and addAutoCentermarks. Previously both functions had verbatim-duplicated loops with the same geometry test (magic 0.1 threshold, simd_cross/simd_dot edge-on check, bounds clip) but diverged in skip recording: addAutoDimensions recorded all four skip reasons as strings, while addAutoCentermarks only recorded edge-on skips as Edge objects. Now both use a shared testCircleVisibility helper with an onSkip closure, allowing each caller to record skips in its own format while the geometry test is single-source.

Closes #1181

CHANGELOG entry

refactor(drawing): unify circle-visibility test between addAutoDimensions and addAutoCentermarks (#1181)

SemVer impact

NONE. Pure refactor with no public API surface change — both functions keep their exact signatures and return types; only the internal implementation is deduplicated. Existing tests pass without modification.

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 part of the Pass 4b duplication audit (#386). The shared helper is internal in DrawingAutoCenterlines.swift and used by both DrawingAutoDimensions.swift and DrawingAutoCenterlines.swift. The onSkip closure allows addAutoDimensions to record all skip reasons as strings while addAutoCentermarks only records edge-on skips as Edge objects (preserving its existing skipped: [Edge] return type).

gsdali and others added 2 commits August 27, 2026 15:57
…ines.swift

- Fix swift-format lint error for BeginDocumentationCommentWithOneLineSummary

Signed-off-by: elb <elb@users.noreply.github.com>
Co-authored-by: Kilo <noreply@kilo.ai>
@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/DrawingAutoCenterlines.swift
  • Sources/OCCTSwift/DrawingAutoDimensions.swift
Previous Review Summary

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

Previous review

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • Sources/OCCTSwift/DrawingAutoCenterlines.swift
  • Sources/OCCTSwift/DrawingAutoDimensions.swift

Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 95K · Output: 5.1K · Cached: 77.8K

@gsdali
gsdali merged commit df9a7b6 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.

Unify the circle-visibility test (edge-on cutoff + bounds clip) shared by addAutoDimensions and addAutoCentermarks

2 participants