io.github.scala_tessella.dcel

Members list

Type members

Classlikes

enum ErrorCategory(val label: String, val build: String => TilingError)

The error category carries its own user-facing label and the factory that builds the corresponding TilingError from a message string. NotFoundError is intentionally excluded: it carries two fields and does not fit the single-string factory shape used by TilingError.combineErrors.

The error category carries its own user-facing label and the factory that builds the corresponding TilingError from a message string. NotFoundError is intentionally excluded: it carries two fields and does not fit the single-string factory shape used by TilingError.combineErrors.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class GeometryError(message: String) extends TilingError

An interior angle is invalid (e.g. a full circle on a single edge) or an angle vector — for an inner face, for the boundary's interior view, for the boundary's exterior view, or around an interior vertex — does not close to a valid simple polygon or to 360°. Surfaced by the geometry stage of TilingValidation.validate.

An interior angle is invalid (e.g. a full circle on a single edge) or an angle vector — for an inner face, for the boundary's interior view, for the boundary's exterior view, or around an interior vertex — does not close to a valid simple polygon or to 360°. Surfaced by the geometry stage of TilingValidation.validate.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TilingError
class Object
trait Matchable
class Any
Show all
case class IncompleteError(message: String) extends TilingError

A vertex, half-edge or face is missing required state (e.g. a vertex without a leaving edge, a half-edge without an incident face). Returned by the completeness stage of TilingValidation.validate; on failure, the later checks are not run.

A vertex, half-edge or face is missing required state (e.g. a vertex without a leaving edge, a half-edge without an incident face). Returned by the completeness stage of TilingValidation.validate; on failure, the later checks are not run.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TilingError
class Object
trait Matchable
class Any
Show all
case class NotFoundError(entity: String, id: String) extends TilingError

A lookup by VertexId or FaceId did not match any entity in the tiling. Carries the queried entity label (e.g. "Vertex") and the id string for structured matching.

A lookup by VertexId or FaceId did not match any entity in the tiling. Carries the queried entity label (e.g. "Vertex") and the id string for structured matching.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TilingError
class Object
trait Matchable
class Any
Show all
case class SpatialError(message: String) extends TilingError

Coordinate-level conflict: the boundary is not a simple polygon, two vertices share a position, an edge is not of unit length, or two edges properly intersect. Surfaced by the spatial stage of TilingValidation.validate and by SimplePolygon.fromUntrusted when the candidate fails the sweep-line simplicity check.

Coordinate-level conflict: the boundary is not a simple polygon, two vertices share a position, an edge is not of unit length, or two edges properly intersect. Surfaced by the spatial stage of TilingValidation.validate and by SimplePolygon.fromUntrusted when the candidate fails the sweep-line simplicity check.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TilingError
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object TilingBuilder

Constructors for TilingDCEL instances. Two families:

Constructors for TilingDCEL instances. Two families:

All constructors validate their inputs and return Either[TilingError, TilingDCEL] (regular polygon is the one exception: its construction cannot fail). The constructed tilings are guaranteed to satisfy the full DCEL invariants and pass TilingValidation.validate.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
final case class TilingDCEL

An edge-to-edge tessellation of unit-side polygons, modelled as a Doubly Connected Edge List (DCEL): each edge is represented by two oppositely oriented half-edges, and each half-edge knows its origin vertex, incident face, twin, predecessor and successor. The tiling has exactly one unbounded outerFace; all other faces are inner.

An edge-to-edge tessellation of unit-side polygons, modelled as a Doubly Connected Edge List (DCEL): each edge is represented by two oppositely oriented half-edges, and each half-edge knows its origin vertex, incident face, twin, predecessor and successor. The tiling has exactly one unbounded outerFace; all other faces are inner.

Construct via the companion's smart constructors (TilingDCEL.empty, TilingDCEL.createRegularPolygon, TilingDCEL.createSimplePolygon, TilingDCEL.fromUntrusted) or via TilingBuilder for lattices and rings. The primary constructor is private to enforce validation on untrusted input.

Mutating operations (maybeAddRegularPolygonToBoundary, maybeDeleteFace, …) return a fresh Either[TilingError, TilingDCEL] and operate on an internal deep copy — the original is never modified.

Value parameters

halfEdges

All half-edges in the tiling (each edge appears twice, once per direction).

innerFaces

The tiling's bounded interior faces.

outerFace

The single unbounded outer face.

vertices

All vertices in the tiling.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TilingDCEL

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TilingDCEL.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait TilingError

Failure outcome returned in the Left of any Either[TilingError, _] produced by the library.

Failure outcome returned in the Left of any Either[TilingError, _] produced by the library.

Errors fall into a small set of categories that signal what kind of invariant was broken:

  • ValidationError — an operation precondition or argument is wrong (typical of maybeAdd* / maybeDelete* calls), or TilingValidation.validate is reporting an aggregate failure of the topology / geometry / spatial checks.
  • IncompleteError — a vertex, half-edge or face has unset or inconsistent internal state.
  • TopologyError — half-edge linkage (twin / next / prev / incident-face) or a face cycle is broken, or a deletion would partition the tiling.
  • GeometryError — interior angles are invalid or the inner-face / boundary angle vector does not close to a simple polygon.
  • SpatialError — coordinates conflict: two vertices share a position, an edge is not unit length, or two edges properly intersect.
  • NotFoundError — a lookup by VertexId or FaceId matched no entity in the tiling.

All variants carry a human-readable message; NotFoundError additionally carries the queried entity type and id for structured matching. See TilingError.combineErrors for the helper used to fold multiple per-check messages into a single error of a chosen category.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TilingError

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Uniformity and gonality analysis for tilings, exposed as extension methods on TilingDCEL.

Uniformity and gonality analysis for tilings, exposed as extension methods on TilingDCEL.

The headline operation is the uniformity tree (TilingDCEL.uniformityTree / uniformityTreeUncompressed here): a hierarchical grouping of the tiling's inner vertices into equivalence classes based on the local DCEL structure around each vertex, refined at increasing vertex-distance. Two vertices end up in the same leaf iff their neighbourhoods are boundary-equivalent at every distance examined.

Related views:

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Validation entry point for TilingDCEL instances. The public validate method runs the full pipeline; the per-stage helpers (validateCompleteness, validateTopologically, validateGeometrically, validateSpatially) are internal and called in sequence by validate but exposed here for library-internal reuse.

Validation entry point for TilingDCEL instances. The public validate method runs the full pipeline; the per-stage helpers (validateCompleteness, validateTopologically, validateGeometrically, validateSpatially) are internal and called in sequence by validate but exposed here for library-internal reuse.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class TopologyError(message: String) extends TilingError

Half-edge linkage (twin / next / prev / incident-face) or a face cycle is broken, the outer face is unreachable, an inner face contains holes, or a deletion would partition the tiling into disconnected components. Surfaced by the topology stage of TilingValidation.validate and by maybeDelete* operations that would violate a topological invariant.

Half-edge linkage (twin / next / prev / incident-face) or a face cycle is broken, the outer face is unreachable, an inner face contains holes, or a deletion would partition the tiling into disconnected components. Surfaced by the topology stage of TilingValidation.validate and by maybeDelete* operations that would violate a topological invariant.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TilingError
class Object
trait Matchable
class Any
Show all
enum Tree[A]

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Tree

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Tree.type
object Utils

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Utils.type
case class ValidationError(message: String) extends TilingError

Operation precondition or argument failed, or TilingValidation.validate aggregated several underlying validation failures into a single error.

Operation precondition or argument failed, or TilingValidation.validate aggregated several underlying validation failures into a single error.

Typical sources: a maybeAdd* / maybeDelete* call where the named vertex is not on the boundary, an edge is missing its twin, or the requested action would otherwise violate a precondition. Also the category used by validate to wrap a "Multiple validation errors: …" message when more than one of the topology / geometry / spatial checks fails.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait TilingError
class Object
trait Matchable
class Any
Show all