Table of Contents

Class NoisyPolygon

Namespace
GrindFest.Generation.Common
Assembly
GrindFest.dll

Helper for building and querying a noisy near-circular polygon in 2D (XZ plane). Used by OrganicSettlementGenerator for the palisade shape.

public static class NoisyPolygon
Inheritance
object
NoisyPolygon

Methods

Contains(IList<Vector2>, Vector2)

Even-odd rule point-in-polygon test.

ConvexPeaks(IList<Vector2>, float)

For each vertex, returns true if its interior angle is sharper than (180° - thresholdDegrees) — i.e. a convex "peak" that should get a tower.

Generate(int, float, float, SeededRandom)

Generate a polygon with vertexCount points around a circle of radius, each point's radius perturbed by ±noise*radius. Returns vertices in CCW order.

WalkEdges(IList<Vector2>, float)

Walks each edge of the polygon, returning evenly-spaced points at intervals of approximately segmentLength. Each result includes the world-XZ position and the outward-facing normal (perpendicular to the edge, pointing outside).