TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::geom::PolygonIndex Class Reference

#include <geom/poly_index.hpp>

Public Member Functions

 PolygonIndex ()=default
 PolygonIndex (const std::vector< Point > &pts)
bool disk_closer (Point c, Coord r, Coord clearance) const
 True if the gap between the disk (centre c, radius r) and the polygon is strictly less than clearance (clearance + r > 0).
bool shape_closer (const Shape &s, Coord clearance) const
 Any shape against the polygon.
double shape_gap (const Shape &s, Coord bound) const

Detailed Description

Definition at line 12 of file poly_index.hpp.

Constructor & Destructor Documentation

◆ PolygonIndex() [1/2]

tmk::geom::PolygonIndex::PolygonIndex ( )
default

◆ PolygonIndex() [2/2]

tmk::geom::PolygonIndex::PolygonIndex ( const std::vector< Point > & pts)
explicit

Member Function Documentation

◆ disk_closer()

bool tmk::geom::PolygonIndex::disk_closer ( Point c,
Coord r,
Coord clearance ) const

True if the gap between the disk (centre c, radius r) and the polygon is strictly less than clearance (clearance + r > 0).

◆ shape_closer()

bool tmk::geom::PolygonIndex::shape_closer ( const Shape & s,
Coord clearance ) const

Any shape against the polygon.

shape_closer(s, clearance) equals closer_than(s, Shape::polygon(pts, 0), clearance); shape_gap(s, bound) equals gap(s, Shape::polygon(pts, 0)) when the two cores are closer than bound (the caller knows that from shape_closer). Both visit only the polygon edges near the shape; the linear functions are the reference path (tests/test_geom.cpp).

◆ shape_gap()

double tmk::geom::PolygonIndex::shape_gap ( const Shape & s,
Coord bound ) const

The documentation for this class was generated from the following file: