graph TD A["|dx| == |dy| ?"] --> B{"slope == 1 ?"} B -- Yes --> C["up = True\n(vertical-ish bisector)"] B -- No --> D["up = False\n(horizontal-ish bisector)"] C --> E["Bisector constructed\nvia (y-intercept)/slope"] D --> F["Bisector constructed\nvia (x*slope)+intercept"] style C fill:#c8e6c9,stroke:#2e7d32 style D fill:#c8e6c9,stroke:#2e7d32 style E fill:#e8f5e9,stroke:#2e7d32 style F fill:#e8f5e9,stroke:#2e7d32
graph LR A["89 random sites"] --> B["Sort by (x,y)"] B --> C["Remove consecutive\nduplicates"] C --> D["Remaining unique sites"] style C fill:#fff9c4,stroke:#f9a825 style D fill:#e8f5e9,stroke:#2e7d32
graph LR subgraph "cropLArray Fix" A1["angle(B) - angle(A)"] --> B1["descending"] B1 --> C1["Python: reverse=True β "] end subgraph "R.sort Fix" A2["JS mutates R in-place"] --> B2["Affects parent split"] B2 --> C2["Python: R.sort() β "] end subgraph "checkForOphans Fix" A3["goUp β largest extreme"] --> B3["Python had opposite"] B3 --> C3["-extreme if goUp β "] end style C1 fill:#e8f5e9,stroke:#2e7d32 style C2 fill:#e8f5e9,stroke:#2e7d32 style C3 fill:#e8f5e9,stroke:#2e7d32
graph TB subgraph "bisector(A,C) diagonal" AC["(-8,3) βββ (-4,-1)"] end subgraph "bisector(B,C) diagonal" BC["(-6,1) βββ (-3,-2)"] end O["Overlap: xβ[-6,-4] on y=-x-5 π¨"] AC --> O BC --> O style O fill:#fff9c4,stroke:#f9a825,stroke-width:3px
graph TD A["bisector(A,C) & bisector(B,C)\nOVERLAP detected"] --> B["Create bisector(A,B)"] B --> C["Phase 1: B3 Γ overlap line\n(on B3 SEGMENT)"] C -- "found?" --> D["Return point β "] C -- "no" --> E["Phase 2: B3 Γ overlap line\n(B3 LINE fallback)"] E -- "found?" --> D E -- "no" --> F["Return ol_p0 (safety fallback)"] style D fill:#e8f5e9,stroke:#2e7d32 style F fill:#ffcdd2,stroke:#c62828
graph LR subgraph "Correct (construction order)" A1["(0,y0)"] --> A2["vertex0"] A2 --> A3["vertex1"] A3 --> A4["(width,y1)"] end subgraph "Wrong (sorted by x)" B1["(0,170)"] -.- B2["(105,186)\nNOT L1!"] B2 --> B3["(121,170)"] B3 --> B4["(138,153)"] end style B2 fill:#ffcdd2,stroke:#c62828
graph TD A["Nudge Removed π©Ήββ "] --> B["Explicit |dx|=|dy| handling"] C["33 Unit Tests π§ͺ"] --> D["Intersection correctness β "] E["Sort Bugs Fixed π"] --> F["Merge lines correct"] G["Overlap Resolution π"] --> H["Three-bisector concurrency"] I["trimBisector Fix βοΈ"] --> J["L1-distance sort + guard"] style A fill:#e8f5e9,stroke:#2e7d32 style C fill:#e8f5e9,stroke:#2e7d32 style E fill:#e8f5e9,stroke:#2e7d32 style G fill:#e8f5e9,stroke:#2e7d32 style I fill:#e8f5e9,stroke:#2e7d32