Skip to content

[agent] U-602: Polygon geometry helpers - #58

Merged
ahmed858 merged 3 commits into
developfrom
agent/U-602-polygon-geometry
Nov 26, 2026
Merged

ahmed858 merged 3 commits into
developfrom
agent/U-602-polygon-geometry

Conversation

@ahmed858

Copy link
Copy Markdown
Owner

Requested by ahmed abd · project thread

Unit

U-602 Polygon geometry helpers. Gated: no

Design

None, plain functions in domain/geometry/polygon.ts: pure math with no React or I/O, so it belongs in domain and the editor (U-603/U-604) and validator can share it. It uses the schema's Point ([x, y] in image pixels).

Rejected: a geometry library (a new dependency for about 100 lines), and a Polygon class (the config stores plain point arrays, and functions over them avoid converting back and forth).

Changes

  • clampToImage, roundPoint, distance, distanceToSegment, nearestVertex, nearestEdge (includes the closing edge), closesPolygon (3+ points and within a tolerance of the first), polygonArea (shoelace, either winding), segmentsIntersect, isSelfIntersecting (non-adjacent edges touching or crossing, and zero-area shapes).
  • Tests for each, including empty, one- and two-point, collinear and bow-tie polygons.

How to verify

npm run check passes locally.

Backlog

  • Unit status updated in docs/BACKLOG.md
  • Line added to docs/WORKLOG.md

Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCZbWVut3exLKav4kTEC5e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCZbWVut3exLKav4kTEC5e
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

Deployment failed for project real-estates-visualization with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/ahmedabdelazez325-1014s-projects?upgradeToPro=build-rate-limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCZbWVut3exLKav4kTEC5e
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

Deployment failed for project real-estates-visualization with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/ahmedabdelazez325-1014s-projects?upgradeToPro=build-rate-limit

@ahmed858
ahmed858 merged commit fc76d4c into develop Nov 26, 2026
1 of 2 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.

2 participants