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"))

• GPU: none (CPU reference implementation only)

Usage

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

The triangle to be returned is the index of the input vertex, where m is the effective number of vertices excluding collinear vertices (m-2, 3). Each triangle rotates counterclockwise (if the input is clockwise) (It is internally reversed and the original vertex number is returned as the subscript.)

Args:

poly: (k,2) vertex sequence. It doesn't have to be closed.

Returns:

(m-2, 3) int64 array. m is the number of effective vertices excluding collinear vertices.

Raises:

ValueError: Less than 3 vertices, area near 0, missing ears (suspected self-intersection or duplicate point).

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.