/ Computational Geometry Primitives
The package provides some basic geometric types in the cg submodule.
Package Features
- Provides types: Point, Segment, Line, Polygon.
Basic geometric types
FrechetDist.cg.Line
— TypeLine in D dimensions.
`p` is a point on the line and `u` is the direction vector (not
necessarily normalized). Parametrised as $p + ut$
FrechetDist.cg.Point
— TypePoint
Point in D dimensions. Implemented currently as a struct with
StaticArray for values. It is templated, with `N` for dimension,
and `T` for underlying type.
FrechetDist.cg.Segment
— TypeSegment
Specifies a directed segment by two endpoints.
Functions
FrechetDist.cg.Polygon_read_plt_orig_file
— FunctionPolygon_read_plt_orig_file
Reads a .plt file into a polygon (2d floating point).
FrechetDist.cg.Polygon_split_edges
— MethodPolygon_split_edges
Output a polygon, where each edge is split in the middle by introducing a vertex into it.
FrechetDist.cg.Polygon_write_to_file
— MethodPolygon_write_to_file
Writes a plt file of the polygon.
FrechetDist.cg.Segment_get_bisection_point
— MethodSegment_get_bisection_point -> Bool, Real, Point
Computes the intersection point of the segment `seg` with the
bisector plane between p
and q
.
Returns
The first argument returns whether the segment intersects the bisector, the pramaterized location (tm), and the intersection piont itself.
FrechetDist.cg.Segment_nn_point
— MethodSegment_nn_point
Returns the closest point on the segment s
to the query point qr
.
FrechetDist.cg.dist_seg_nn_point
— Methoddist_seg_nn_point
Returns the distance to the closest point lying on the segment induced by the first two points, to the query point. By avoiding creating the segment iself, it is hopeflly more efficient.
FrechetDist.cg.induced_seg_nn_point
— Methodinduced_seg_nn_point
Returns the closest point to the segment induced by the first two points, to the query point. By avoiding creating the segment iself, it is hopeflly more efficient.
FrechetDist.cg.point
— Methodpoint( args... )
A flexible constructor for a point specified by the arguments. Thus point( 2.0, 3.0, 4.0 ) defined the 3d point (2.0, 3.0, 4.0). Or similarly, point( 2.0, 1.0 ) would create a 2d point.
FrechetDist.cg.segs_match_price
— Methodsegs_match_price
The price of matching the edge pa-pb to the edge qa-qb.