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: 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.

Summary

Nested types

public static class Feature.Factory

Public constructors

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

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

Returns a new Feature with the points that define the shape of this Feature in reversed order.

abstract @NonNull Feature

Transforms the points in this Feature with the given PointTransformer and returns a new Feature

Public constructors

Feature

public Feature(@NonNull List<@NonNull Cubic> cubics)

Public methods

getCubics

Added in 1.1.0-alpha01
public final @NonNull List<@NonNull CubicgetCubics()

isConcaveCorner

Added in 1.1.0-alpha01
public abstract boolean isConcaveCorner()

Whether this Feature is a concave corner (inward indentation in a shape).

isConvexCorner

Added in 1.1.0-alpha01
public abstract boolean isConvexCorner()

Whether this Feature is a convex corner (outward indentation in a shape).

isEdge

Added in 1.1.0-alpha01
public abstract boolean isEdge()

Whether this Feature is an Edge with no inward or outward indentation.

isIgnorableFeature

Added in 1.1.0-alpha01
public abstract boolean isIgnorableFeature()

Whether this Feature gets ignored in the Morph mapping. See buildIgnorableFeature for more details.

reversed

Added in 1.1.0-alpha01
public abstract @NonNull Feature reversed()

Returns a new Feature with the points that define the shape of this Feature in reversed order.

transformed

Added in 1.1.0-alpha01
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 PointTransformer used to transform this Feature