Feature class abstract

While a polygon's shape can be drawn solely using a list of Cubic 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 buildIgnorableFeature are ignored in the default mapping.

By using features, you can manipulate polygon shapes with more context and control.

Constructors

Feature(List<Cubic> cubics)
const
Feature.concaveCorner(List<Cubic> cubics)
Group a list of Cubic objects to a concave corner (inward indentation in a shape).
factory
Feature.convexCorner(List<Cubic> cubics)
Group a list of Cubic objects to a convex corner (outward indentation in a shape).
factory
Feature.edge(Cubic cubic)
Group a Cubic object to an edge (neither inward or outward identification in a shape).
factory
Feature.ignorable(List<Cubic> cubics)
Group a list of Cubic objects to a feature that should be ignored in the default Morph mapping. The feature can have any indentation.
factory

Properties

cubics List<Cubic>
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
isEdge bool
Whether this Feature is an Edge with no inward or outward indentation.
no setter
isIgnorableFeature bool
Whether this Feature gets ignored in the Morph mapping. See Feature.ignorable for more details.
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
reversed() Feature
Returns a new Feature with the points that define the shape of this Feature in reversed order.
toString() String
A string representation of this object.
inherited
transformed(PointTransformer f) Feature
Transforms the points in this Feature with the given PointTransformer and returns a new Feature.

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

validated(Feature feature) Feature