General purpose library for algorithms and containers within 2D space.
Classes
Classes currently defined within lib_2d
:
Point<T> //a point defined with two coordinates (x and y)
PointCloud<T> //a collection Points, without topological information
OrderedPointCloud<T> //a PointCloud with additional information regarding sorting and filtering of points
KdTree<T> //search tree to quickly find nearest neighbors
LineSegment<T> //a line segment defined by start and end point
Rectangle<T> //a rectangle defined by width, height and center
Arc<T> //an arc defined by diameter, center, start- and end angle
Ellipse<T> //an ellipse
InterpolationBezier<T> //a bezier curve interpolation
InterpolationLinear<T> //a linear interpolation
InvolutCircle<T> //involut curve of a circle
Functions / algorithms
Some of lib_2d
‘s functions or algorithms:
move_by(...) //moves the Point or PointCloud
mirror_vertically(...) //mirrors the Point or PointCloud at a vertical line (horizontally and point also supported)
rotate(...) //rotate by angle around a center
to_string(...) //write coordinates to a string
from_string(...) //parse from a string
distance_to(...) //calculate distances between points
load(...) //load coordinates from file
to_file(...) //write coordinates to file
bounding_box(...) //the minimum bounding rectangle of a PointCloud
convex_hull(...) //calculate the convex hull of a PointCloud
concave_hull(...) //compareable to the convex hull, while better following the shape of a pointcloud
intersections_with(...) //intersections between paths
sort_x(...) //sort by x (or y)
While lib_2d
offers quite many features, rust-3d
is now more powerful and also supports 3D space.