Feature
public abstract class Feature
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:
Morphmaps similar curve types (convex, concave) together. Note that edges or features created withbuildIgnorableFeatureare ignored in the default mapping.
By using features, you can manipulate polygon shapes with more context and control.
Summary
Nested types |
|---|
public static class Feature.Factory |
Public methods |
|
|---|---|
final @NonNull List<@NonNull Cubic> |
|
abstract boolean |
Whether this Feature is a concave corner (inward indentation in a shape). |
abstract boolean |
Whether this Feature is a convex corner (outward indentation in a shape). |
abstract boolean |
isEdge()Whether this Feature is an Edge with no inward or outward indentation. |
abstract boolean |
Whether this Feature gets ignored in the Morph mapping. |
abstract @NonNull Feature |
reversed()Returns a new |
abstract @NonNull Feature |
Transforms the points in this |
Public methods
isConcaveCorner
public abstract boolean isConcaveCorner()
Whether this Feature is a concave corner (inward indentation in a shape).
isConvexCorner
public abstract boolean isConvexCorner()
Whether this Feature is a convex corner (outward indentation in a shape).
isEdge
public abstract boolean isEdge()
Whether this Feature is an Edge with no inward or outward indentation.
isIgnorableFeature
public abstract boolean isIgnorableFeature()
Whether this Feature gets ignored in the Morph mapping. See buildIgnorableFeature for more details.
reversed
public abstract @NonNull Feature reversed()
Returns a new Feature with the points that define the shape of this Feature in reversed order.
transformed
public abstract @NonNull Feature transformed(@NonNull PointTransformer f)
Transforms the points in this Feature with the given PointTransformer and returns a new Feature
| Parameters | |
|---|---|
@NonNull PointTransformer f |
The |