PolygonFeature class abstract
While a polygon's shape can be drawn solely using a list of CubicBezier objects representing its raw curves and lines, features add an extra layer of context to groups of cubics. Features group cubics into (straight) edges, convex corners, or concave corners. For example, rounding a rectangle adds many cubics around its edges, but the rectangle's overall number of corners remains the same. Morph therefore uses this grouping for several reasons:
- Noise Reduction: Grouping cubics reduces the amount of noise introduced by individual cubics (as seen in the rounded rectangle example).
- Mapping Base: The grouping serves as the base set for Morph's mapping process.
- Curve Type Mapping: Morph maps similar curve types (convex, concave) together. Note that edges or features created with PolygonFeature.ignorable are ignored in the default mapping.
By using features, you can manipulate polygon shapes with more context and control.
- Annotations
Constructors
-
PolygonFeature.concaveCorner(List<
CubicBezier> cubics) -
Groups a list of CubicBezier objects into a concave corner (inward
indentation in a shape).
factory
-
PolygonFeature.convexCorner(List<
CubicBezier> cubics) -
Groups a list of CubicBezier objects into a convex corner (outward
indentation in a shape).
factory
- PolygonFeature.edge(CubicBezier cubic)
-
Groups a CubicBezier object into an edge (neither inward nor outward
indentation in a shape).
factory
-
PolygonFeature.ignorable(List<
CubicBezier> cubics) -
Groups a list of CubicBezier objects into a feature that should be
ignored in the default Morph mapping. The feature can have any
indentation.
factory
Properties
-
cubics
→ List<
CubicBezier> -
The cubic curves defining this feature, as an unmodifiable list.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isConcaveCorner → bool
-
Whether this feature is a concave corner (inward indentation in a shape).
no setter
- isConvexCorner → bool
-
Whether this feature is a convex corner (outward indentation in a shape).
no setter
- isCorner → bool
-
Whether this feature is a corner.
no setter
- isEdge → bool
-
Whether this feature is an Edge with no inward or outward indentation.
no setter
- isIgnorable → bool
-
Whether this feature gets ignored in the Morph mapping.
no setter
- reversed → PolygonFeature
-
A new PolygonFeature with the points that define the shape of this
PolygonFeature in reversed order.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transformed(
ShapePointTransformer transformer) → PolygonFeature -
Transforms the points in this PolygonFeature with the given
transformerand returns a new PolygonFeature.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override