Class Symmetry2D
- Namespace
- CADability
- Assembly
- CADability.dll
Finds the mirror axes of a set of 2d points or of a Path2D. The axes all pass through the centroid, which is where a mirror axis of a symmetric figure has to lie.
public class Symmetry2D
- Inheritance
-
Symmetry2D
- Inherited Members
Constructors
Symmetry2D()
public Symmetry2D()
Methods
FindSymmetryAxes2D(Path2D, out List<GeoVector2D>)
Finds the mirror axes of a path. The vertices of the path give the candidates; each candidate is then verified on the geometry, by splitting the path where the axis crosses it and testing the parts against their mirror images.
public static GeoPoint2D FindSymmetryAxes2D(Path2D path, out List<GeoVector2D> axis)
Parameters
pathPath2Dthe path to examine
axisList<GeoVector2D>receives the directions of the mirror axes, empty when there is none
Returns
- GeoPoint2D
the centroid the axes pass through
FindSymmetryAxes2D(GeoPoint2D[], out List<GeoVector2D>)
Finds all mirror axes of the provided points. Two points can only be images of each other when they have the same distance to the centroid, so the candidates for an axis are the perpendicular bisectors of the pairs that do, and each candidate is then verified against all remaining points.
public static GeoPoint2D FindSymmetryAxes2D(GeoPoint2D[] points, out List<GeoVector2D> axis)
Parameters
pointsGeoPoint2D[]the points to examine
axisList<GeoVector2D>receives the directions of the mirror axes, empty when there is none
Returns
- GeoPoint2D
the centroid, which every axis passes through