triangulate_polygon — DRIVE japan op

• Data kinds: any → any

• Call: import fullseye as fs; fs.ledger.triangulate_polygon(poly: 'np.ndarray | Sequence[Sequence[float]]') -> 'np.ndarray' (to call the implementation directly, import driveplateau; driveplateau.triangulate_polygon(poly: 'np.ndarray | Sequence[Sequence[float]]') -> 'np.ndarray'; from the registry, opsdrive.get("triangulate_polygon"))

Usage

Triangulates a simple polygon (convex or concave, no self-intersections) by ear clipping.

The returned triangles are indices (k-2, 3) into the input vertices, and each triangle is counter-clockwise (if the input is clockwise it is reversed internally, and the indices are returned as the original vertex numbers).

Args:

poly: (k,2) vertex sequence. Need not be closed.

Returns:

(k-2, 3) int64 array.

Raises:

ValueError: fewer than 3 vertices, area nearly 0, no ear found (suspected self-intersection or duplicate points).

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• gallery_drive_city_terrain — py -3.11 examples/gallery_drive_city_terrain.py

Ops the type connects to (they accept any as input)

course_crank · course_s_curve · course_turnaround · course_slope · course_intersection · course_parallel_parking · course_crossing · course_road

Same category (japan)

osm_synthetic · osm_parse · osm_road_graph · osm_road_mask · osm_road_loops · osm_route · japan_world · japan_stats


*Provenance: driveplateau.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.