Expand description
Short-cut to import all functionality of this library.
Re-exports§
pub use super::rectangle_decomposition::*;
Modules§
- traits
- Common traits for geometrical objects.
Structs§
- Complex
Transform - Transformation described by a mirroring at the
x
axis, then a rotation around the origin, then a scaling, then a translation. This transformation allows rotations by arbitrary angles. - Edge
- An edge (line segment) is represented by its starting point and end point.
- Interval
- A one dimensional interval which is represented by a start and end coordinate.
- Irregular
Repetition - Describe a non-equispaced repetition by storing a list of offsets.
- Matrix2d
Transform - Description of a transformation in the euclidean plane by a 2x2 matrix
A
. Transforming a pointp
is computed by the matrix productA*p
. - Matrix3d
Transform - Affine transformation represented as a 3x3 matrix like:
- Multi
Polygon - A
MultiPolygon
is a list of polygons. There is no restrictions on the polygons (they can be intersecting, empty, etc.). - Path
Path
is essentially a chain of line segments but with a possibly a non-zero width. It can be thought of the shape resulting by a stroke of a thick pen along the line segments.- Point
- A point is defined by a x and y coordinate in the euclidean plane.
- Point
String - A point string is a finite sequence of points.
TODO: Implement
Deref
for accessing the list of points. - Polygon
- A polygon possibly with holes. The polygon is defined by a hull and a list of holes
which are both
SimplePolygon
s. - REdge
- An rectilinear edge (horizontal or vertical line segment) is represented by its starting point and end point.
- Rect
- A rectangle which is oriented along the x an y axis and represented by its lower left and upper right corner.
- Rect
Edge Iterator - Iterator over edges of a rectangle.
- Regular
Repetition - Describe a equi-spaced n*m two-dimensional repetition as a lattice.
The offsets are computed as
(i*a, j*b)
fori
in0..n
andj
in0..m
.a
andb
the distance vectors between two neighbouring points. - Rot90
Transform - Transformation that consists only of a rotation by a multiple of 90 degrees
around the origin
(0, 0)
. - Simple
Polygon - A
SimplePolygon
is a polygon defined by vertices. It does not contain holes but can be self-intersecting. - SimpleR
Polygon - A
SimpleRPolygon
is a rectilinear polygon. It does not contain holes but can be self-intersecting. The vertices are stored in an implicit format (one coordinate of two neighbour vertices is always the same for rectilinear polygons). This reduces memory usage but has the drawback that edges must alternate between horizontal and vertical. Vertices between two edges of the same orientation will be dropped. - Simple
Transform - Describes a geometric transformation that consists of a optional mirroring along the x-axis followed by a rotation by a multiple of 90 degrees followed by a displacement.
- Text
- A text is a point associated with a string. This struct does not define how the text should be rendered on screen.
- Vector
Vector
defines a two dimensional vector with x and y components in the Euclidean plane.
Enums§
- Angle
- Angle expressed as a multiple of 90 degrees.
- Contains
Result - This is a result type for containment checks.
- Direction1D
- Direction in one dimension.
- Direction2D
- Directions along the coordinate axes in two dimensions.
- Edge
Intersection - Return type for the edge-edge intersection functions. Stores all possible results of an edge to edge intersection.
- Geometry
- Abstracted geometrical shape.
- Line
Intersection - Return type for the line-line intersection functions. Stores all possible results of a line to line intersection.
- Orientation
- Relative orientation of two geometrical objects such as vectors.
- Orientation2D
- Orientation in two dimensions along one of the axes.
- Path
EndType - Encoding for the type of the beginning and end of the path.
- REdge
Orientation - Orientation of a rectilinear edge.
- RLine
Intersection - Return type for the line-line intersection functions. Stores all possible results of a line to line intersection.
- Repetition
- Describe the regular or irregular repetition of a geometrical object.
- Side
- Location relative to a directed line or edge. Something can be on the left of the line, right of the line or on top of the line (center).
Constants§
- PREC_
DISTANCE - Precision for distance related decisions.
Traits§
- Affine
Transform - Geometric transformation which preserves parallelism.
Adds ‘shear’ to the
SimilarityTransform
. - Area
- Calculate the area of a geometry.
- Bounding
Box - Calculation of the ‘bounding box’, i.e. the smallest rectangle that contains the geometrical object.
- Coordinate
Type - Trait for types that can be used as coordinates in the euclidean plane. In practice this are integers, floats and possible rational numbers.
- Deref
- Used for immutable dereferencing operations, like
*v
. - Displacement
Transform - Geometric transformation which preserves oriented angles and distances (i.e. translation).
- Doubled
Oriented Area - Calculate the doubled oriented area of a geometry. Using the doubled area allows to compute the area without using fractions. This is especially helpful when computing in integer coordinates.
- Edge
Endpoints - Get the endpoints of an edge.
- Edge
Intersect - Define the intersection between two edges (i.e. line segments).
- Into
Edges - Iterate over edges. For an n-gon this would produce n edges.
- Isometric
Transform - Geometric transformation which preserves angles and distances (e.g. euclidean transform).
- Isometric
Transform90 - Geometric transformation which preserves angles and distances (e.g. euclidean transform) but allows only rotations by a multiple of 90 degrees.
- MapPointwise
- Transform the geometrical object by transforming each point of it.
- Mirror
- Mirror at the x or y axis.
- Rotate
Ortho - Rotate by a integer multiple of 90 degrees.
- Scale
- Scale the geometrical shape. Scaling center is the origin
(0, 0)
. - Similarity
Transform - Geometric transformation which preserves angles and ratios of distances.
Adds resizing to the
IsometricTransform
. - Similarity
Transform90 - Geometric transformation which preserves angles and ratios of distances.
Adds resizing by integer numbers to the
IsometricTransform90
. - Text
Type - Trait for types that can be used as the text of this label.
The most simple solution is to use
String
. However, in many cases where the same text is used in many labels it might be desirable to use ‘string interning’ for more efficient memory usage. Then anRc<String>
could be used for instance. - ToPolygon
- Trait for the conversion of a geometric shape to a polygon.
- Transformation
- General geometric transformation.
- Translate
- Translate the geometrical object by a vector.
- TryBounding
Box - Try the calculation of the ‘bounding box’, i.e. the smallest rectangle that contains the geometrical object. In some cases this is not always possible, so the try might fail. For instance a set of polygons does not have a bounding box if the set is empty.
- TryCast
Coord - This trait defines the type-casting of the coordinate types for geometrical objects.
- TryInto
Bounding Box - Try to compute the bounding box while consuming the data. This is intended to be used for computing bounding boxes over iterators.
- Winding
Number - Compute the winding number of a geometrical object around a point. The winding number is used to check if a point is contained in a shape.
- Zero
- Defines an additive identity element for
Self
.
Type Aliases§
- Distance
Type - Default type for euclidean distances.
- Float
Type - Default floating point type.
- REdge
Intersection - Return type for the edge-edge intersection functions. Stores all possible results of a edge to edge intersection.