refactor(#248): ジオデシック幾何を専用 non-view ファイルへ抽出#287
Conversation
Move Vertex3D and GeodesicGeometry (the Goldberg-polyhedron edge
generation) out of OverlayContentView.swift into GeodesicGeometry.swift,
keeping the *View.swift file to SwiftUI view types only per the repo's
.coderabbit.yaml guideline ("Views do not own business logic").
The rendering constants GeodesicMetrics/GeodesicGold stay private in the
view file since they are only consumed by the Canvas drawing. Geometry
remains internal so GeodesicGeometryTests still reaches it via
@testable import Views. No behavior change; all 942 tests pass.
Addresses CodeRabbit nitpick on #286.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 28 minutes and 14 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
       #287 で抽出した `GeodesicGeometry` のテストを補強する。 ## 背景 既存テストは strut が **120 本**であることだけを固定していた。しかし面リストや細分化が壊れても、本数 120 を保ったまま**双対のトポロジーだけが崩れる**ケースは検出できない。 ## 変更 各 strut 端点(= icosphere 三角形の centroid = Goldberg 双対の頂点)の**接続次数**を数え、不変条件を1つ追加する。 - ハブ(ユニーク頂点)が **80 個**ちょうど - 全ハブの次数が **3**(閉多様体なので各三角形は3辺すべてを共有 → 三価ケージ) - `80 × 3 / 2 = 120` で既存の 120-edge テストと整合 座標は値コピーで再利用されるため、`1e-6` 量子化キーで同一 centroid を1つの identity に畳む(最近接 centroid 間距離 ≈ 0.36 ≫ 1e-6 なので衝突しない)。Foundation 非依存。 ## 補足 双対の「12 pentagon + 30 hexagon」はケージの**面**の話で、strut 端点(頂点)は一様に次数3。エッジリストから面を循環抽出するのは過剰なので、頂点レベルで効く三価性で構造を固定した。 `swift test --filter GeodesicGeometryTests` → 4 件すべてパス。 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Chores** * Version bumped to 2.14.2. * **Tests** * Expanded test suite with geodesic geometry validation tests, verifying structural integrity and proper hub formation in geometric constructs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
概要
#286(#248) で導入したジオデシック球体ローディングインジケータの幾何生成ロジックを、OverlayContentView.swift(*View.swift)から専用ファイルGeodesicGeometry.swiftへ抽出する。CodeRabbit が
#286で残した nitpick への後続対応:リポジトリの
.coderabbit.yamlガイドライン(**/*View.swift: "Views do not own business logic")に沿い、View ファイルを SwiftUI View 型のみに保つ。変更点
Vertex3D(unit-sphere 頂点)+GeodesicGeometry(Goldberg 多面体のエッジ生成)→GeodesicGeometry.swiftGeodesicMetrics/GeodesicGoldは描画専用のprivate定数 → Canvas 描画のみが参照するため View 側に残し、access control を不必要に広げないGeodesicGeometryはinternalのまま →GeodesicGeometryTestsが@testable import Viewsで到達可能動作・テスト
swift build成功GeodesicGeometryTests(120 edges / unit-sphere / 非退化)3件合格Refs #248