Skip to content

annotator: 2D geometry — hit-testing, handles, clamp to asset bounds, transforms (port of v1's ~220 LOC of pure functions) #41

Description

@JArmandoAnaya

Context

v1's geometry is ~220 LOC of pure, battle-tested functions. Port it, don't rewrite it.

Deliverables

  • Hit-testing: point-in-bbox, point-in-polygon, handle/vertex/edge proximity with
    zoom-aware tolerances.
  • Bbox transforms: move, resize by 8 handles with min-size + bounds clamping; polygon:
    vertex move, edge insert point, vertex delete.
  • All coordinates in native asset pixels (screen↔image transforms live at the adapter
    layer, not in core geometry).

Acceptance criteria

  • Ported functions covered by unit tests (bring v1 cases where they exist)
  • Clamping property test: transforms never escape asset bounds

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendannotator / ui-core / app packagesm4M4 — Headless annotator (0.0.1-alpha.4)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions