Namespace Scylla.Core.Util.Geom
Classes
PaletteFaceColorResolver
An IFaceColorResolver that maps shape faces onto the entries of a ColorPalette according to a FaceColoringMode. Shape builders call Resolve(int, int, Vector3) once per face when emitting their vertex color channel, so a single mesh can carry a distinct flat color per face.
ScyllaArchwayShape
Parametric wall with an arched cutout: a rectangular bottom portion topped by a half-circle arch. The opening reaches the floor (door-like). Suitable for classical Roman archways, dungeon portals, and any prototype geometry where a curved opening reads better than a sharp-cornered rectangular doorway.
ScyllaBarrelShape
Parametric barrel: a lathed profile rotated around the Y axis. The profile narrows at top and bottom (chamfered cap edges), carries two belt hoops (one near the top, one near the bottom - the classic wooden-barrel iron-band look), and terminates in flat top and bottom cap discs. Centered on the origin.
ScyllaBollardShape
Parametric bollard: a vertical cylindrical body with a hemispherical cap on top. The
classic marine, traffic, or street-furniture bollard profile. The hemisphere has its
equator flush against the body's top edge and radius equal to Radius.
Centered on the origin so total height (bodyHeight + radius) splits evenly above
and below.
ScyllaBoxShape
Parametric box (rectangular cuboid) shape with independent width / height / depth and six hard-edged faces. Covers the use cases of both a uniform cube (equal sides) and a general box (independent dimensions) by exposing all three dimensions as serialized parameters.
ScyllaCappedWallShape
Parametric wall with a forward-extending cap (cornice / crown molding) at the top: a
narrower wall body of thickness Thickness, topped by a wider cap section
of thickness Thickness + CapExtension spanning the top CapHeight
units of the wall's height. The back face stays flat - the cap sticks out only on the
+Z (front) side.
ScyllaCapsuleShape
Parametric capsule shape: a cylindrical body capped by two hemispherical domes, centered on the origin with its axis aligned to Y. Replaces Unity's built-in capsule primitive with a parametric shape whose radius, total height, and tessellation can be retuned in the Inspector or at runtime.
ScyllaColumnShape
Parametric architectural column: a cylindrical ShaftHeight shaft with optional CapitalHeight capital on top and BaseHeight base at the bottom. The capital and base have independent radii that can match the shaft (smooth cylinder) or flare outward (classical column with stepped capital and base).
ScyllaConeShape
Parametric cone shape with a circular base and a single apex vertex, centered on the origin along the Y axis. Side faces use hard normals computed per segment triangle; the base cap is a triangle fan with a uniform downward normal.
ScyllaCrateShape
Parametric crate: a box with each of its six outer faces split into a mitered picture-frame rim around a recessed inset panel. The rim is built from four trapezoidal strips, the panel is a single inner quad pushed inward by TrimDepth, and four step walls close the recess so the solid is watertight.
ScyllaCurvedStairsShape
Parametric curved staircase: a closed solid flight of StepCount steps swept
around the Y axis through the origin, from angle 0 to SweepAngle. Each
step is an annular sector (tread) at increasing height; the solid is closed by stepped
inner and outer curved walls, a tiled bottom, flat radial risers between steps, and two
end caps.
ScyllaCylinderShape
Parametric cylinder shape with configurable radius, height, segment count, and optional top and bottom caps, centered on the origin with its axis aligned to Y. Replaces Unity's built-in cylinder primitive with a true parametric mesh.
ScyllaDomeShape
Parametric hemisphere (dome): the upper half of a UV sphere. Configurable radius,
longitudinal segments (slices), and latitudinal rings (stacks), with an optional bottom
disc that closes the underside into a sealed solid. Centered on the origin: the equator
sits at y = -radius/2 and the apex at y = +radius/2, so the bounding box
is symmetric around (0, 0, 0).
ScyllaFloorTileShape
Parametric floor tile: a thin slab in the XZ plane with optional rounded edges. The
tile's surface normal points up UnityEngine.Vector3.up; the slab's top face sits at
+Thickness * 0.5 and its bottom face at -Thickness * 0.5, centered on the
origin so a tile can be positioned by setting its Transform.position to the
desired floor cell center (with y = 0 for a floor that sits on the world plane).
ScyllaIcoSphereShape
Parametric icosphere built by recursively subdividing an icosahedron and projecting each new vertex onto the unit sphere. Distinct from ScyllaSphereShape: the UV sphere has dense vertex packing at the poles and sparse packing at the equator, while the icosphere has near-uniform triangle size everywhere on its surface, which gives better silhouettes for organic blockouts, cleaner shading under low-key lighting, and more predictable per-vertex cost per unit of surface area.
ScyllaLadderShape
Parametric ladder: two vertical cylindrical rails along Y, joined by RungCount horizontal cylindrical rungs along X. Centered on the origin.
ScyllaLinearStairsShape
Parametric straight flight of stairs: a closed solid of StepCount equal steps ascending along +Z and +Y. Each step contributes a horizontal tread and a vertical riser; the solid is closed by a bottom face, a vertical back face, and (when BuildSides is set) two staircase-profile side walls.
ScyllaOctahedronShape
Parametric octahedron shape: 8 equilateral-triangle faces meeting at 6 canonical
axis-aligned vertices (+Y, -Y, +X, -X, +Z,
-Z), all at the given radius from the center. Each face is geometrically
independent so normals are flat per face (hard shading).
ScyllaPaneledWall1Shape
Parametric wall with one or more concentric recessed rectangular picture-frame grooves on the front face, surrounding a flush central panel. Each groove sits below the wall surface by FrameDepth; the outer ring, the bands between grooves, and the inner panel are all coplanar with the wall surface. The back face is flat.
ScyllaPaneledWall2Shape
Parametric wall with a grid of raised truncated-pyramid (frustum) panels on the front face. Each panel has a square base on the wall surface, a smaller square top extruded outward by PanelExtrusion, and 4 sloped trapezoidal sides connecting base to top. The back face is flat.
ScyllaPipeSegmentShape
Parametric pipe segment: a solid cylindrical body with thicker disc flanges at each end. A lathed profile that swells out to FlangeRadius for a vertical span of FlangeThickness at each end, with the body running between the flanges at BodyRadius. Centered on the origin with the axis along Y.
ScyllaPipeShape
Parametric hollow pipe (open-ended tube with finite wall thickness). A truncated annular extrude: outer cylindrical surface, inner cylindrical surface (normals pointing inward), and two annular cap rings closing the two open ends. Centered on the origin with the axis along Y.
ScyllaPlaneShape
Parametric horizontal plane in the XZ plane with configurable width, depth, and optional
per-axis subdivisions for vertex displacement effects. Normals point up (+Y). UVs map the
full surface to (0,0)..(1,1). The plane is centered at local origin.
ScyllaPyramidShape
Parametric pyramid shape with a regular N-sided polygon base and a single apex vertex, centered on the origin along the Y axis. Side faces are independent flat triangles with hard per-face normals; the base is tessellated as a triangle fan with a uniform downward normal.
ScyllaQuadShape
Parametric vertical quad in the XY plane (facing +Z), with configurable width and height. Equivalent to Unity's built-in quad primitive but with serialized dimensions that can be retuned in the Inspector or at runtime.
ScyllaRampShape
Parametric ramp (wedge): a right-triangular prism lying on its side, rising from a
zero-height front edge (at -Length/2 on Z) to its full Height at the
back edge (at +Length/2 on Z). Faces: a flat bottom, a vertical back, a sloped top,
and (when BuildSides is set) two triangular side caps.
ScyllaRingShape
Parametric ring (annulus) shape: a circular band with a concentric inner hole, extruded vertically to a configurable height, centered on the origin along the Y axis. Four face groups are emitted - top, bottom, outer wall, and inner wall - all with hard edges (unique vertices per group).
ScyllaRoundedBoxShape
Parametric box with uniformly rounded edges and corners. Each of the cube's twelve edges is replaced by a quarter-cylinder of CornerRadius, and each of the eight corners by an eighth-sphere. The flat face panels are inset by CornerRadius so they meet the curved seams cleanly.
ScyllaShapeBase3D
Abstract base class for all concrete Scylla 3D shape components. A shape owns its UnityEngine.Mesh, regenerates it on demand from serialized parameters, and exposes a uniform set of features: tint, double-sided rendering, collider mode, bounds query.
ScyllaShapes
Static factory for spawning ScyllaShapeBase3D shape components on new
UnityEngine.GameObjects at runtime. Each Create* method instantiates the
matching shape UnityEngine.MonoBehaviour, sets its shape-specific
parameters, and returns the typed component for further configuration or chaining.
ScyllaShelvedWallShape
Parametric wall with N evenly-spaced horizontal shelves extruding from the front face.
Shelf height, inter-shelf gap, and top/bottom margins are all equal - auto-computed as
s = height / (2 * shelfCount + 1) - so the wall reads as a regular pattern. The
back face is flat.
ScyllaSignShape
Parametric sign: a thin rectangular sign panel mounted atop a vertical cylindrical post.
The post stands along Y; the panel sits centered above it with its bottom edge flush
against the post top. Centered on the origin so the whole shape's bounding box is
symmetric around (0, 0, 0).
ScyllaSkirtedWallShape
Parametric wall with a forward-extending skirt (baseboard / plinth) at the bottom: a
narrower wall body of thickness Thickness, sitting on a wider skirt
section of thickness Thickness + SkirtExtension spanning the bottom
SkirtHeight units of the wall's height. The back face stays flat - the
skirt sticks out only on the +Z (front) side. This shape is the vertical mirror
of ScyllaCappedWallShape.
ScyllaSkyDomeShape
Parametric sky dome: an inverted hemisphere intended to be rendered from the inside as a sky or background environment. Shares the same vertex layout as ScyllaDomeShape (upper half of a UV sphere with no bottom cap) but uses reversed triangle winding and inward-pointing normals so that a camera placed at or near the dome's center sees the interior surface correctly lit.
ScyllaSphereShape
Parametric UV sphere with configurable radius, longitudinal segments, and latitudinal rings. Replaces Unity's built-in sphere primitive with a true parametric shape that can be retuned in the Inspector or at runtime.
ScyllaSpiralStairsShape
Parametric spiral staircase: StepCount wedge treads stacked around a central
column, winding about the Y axis through the origin. Each tread subtends one step of
360 / StepsPer360 degrees and rises StepHeight, so the flight can wind
past a full turn.
ScyllaTorusShape
Parametric torus (donut) shape with configurable major radius, minor radius, ring
segments, and tube segments, centered on the origin in the XZ plane. Normals are
smooth around both axes; UVs map the ring angle to u and the tube angle to v.
ScyllaTriangularPrismShape
Parametric triangular prism shape: two equilateral-triangle end caps connected by three rectangular side quads, centered on the origin with its length along the Y axis. All faces use hard normals (unique vertices per face) for crisp edges.
ScyllaWallShape
Parametric wall: a thin box laid out along the X axis (length), standing up the Y axis (height), with depth along the Z axis (thickness). Optionally rounded edges via BevelRadius for prototype geometry that should not read as sharp-edged.
ScyllaWallWithDoorShape
Parametric wall with a rectangular door cutout that reaches the floor. The wall is centered at the origin (X = length, Y = height, Z = thickness); the door is centered horizontally at DoorOffsetX with the given DoorWidth and DoorHeight. The cutout passes through the wall's full thickness.
ScyllaWallWithWindowShape
Parametric wall with a rectangular window cutout that is fully bounded on all four sides (does not reach the floor or the ceiling, unlike ScyllaWallWithDoorShape). The wall is centered at the origin; the window's vertical position is controlled by WindowSillHeight (height of the window's bottom edge above the wall's bottom).
ShapeMaterialCache
Lazily creates and caches the shared default UnityEngine.Material instances used by all ScyllaShapeBase3D subclasses. Two variants are exposed: a standard URP Lit material and a double-sided variant (backface culling disabled).
UniformColorResolver
Convenience IFaceColorResolver that returns the same color for every face. Useful for uniformly colored meshes that still need vertex color data (e.g. for a vertex-lit shader variant), or as a default placeholder while building richer resolvers.
Structs
AABB3D
Axis-aligned 3D bounding box represented as Center + HalfExtents. The canonical Scylla type for shape bounds, frustum culling, spatial queries, and any "box that sits on world axes" use case.
Capsule3D
A 3D capsule represented by two end-points PointA and PointB and a Radius. The capsule volume is the set of all points within Radius of the line segment connecting the two end-points, equivalent to a cylinder capped with two hemispherical ends.
Ellipse
Represents an axis-aligned ellipse defined by a center point and two semi-axis radii, one along the X direction and one along the Y direction. Provides parametric evaluation, derived geometric properties (area, circumference, eccentricity), and point containment tests suitable for 2D gameplay, UI layout, and procedural geometry.
OBB3D
Oriented 3D bounding box represented as Center + HalfExtents + Rotation. Use this for tight bounds on rotated meshes, rotated trigger volumes, or any "box that does not sit on world axes" use case. Intersection tests use the Separating Axis Theorem.
Size2D
Represents a 2D float-valued extent with a Width (X) and Height (Y) component. Intended as the canonical "size" type for any planar measurement: 2D shape dimensions, UI sizes, plane / quad footprints, sprite extents, rectangle dimensions.
Size3D
Represents a 3D float-valued extent with a Width (X), Height (Y), and Depth (Z) component. Intended as the canonical "size" type for any volumetric measurement: 3D shape dimensions, mesh bounds, framing extents, room dimensions, scaled object footprints.
Sphere3D
A 3D sphere represented by a Center point and a Radius. The canonical Scylla type for sphere-shaped bounds, area-of-effect queries, AI awareness radii, and any "ball that can be placed anywhere in space" use case.
Interfaces
IFaceColorResolver
Resolves a vertex color for an individual face of a generated shape mesh. Shape builders call Resolve(int, int, Vector3) once per face when emitting mesh data, allowing callers to drive per-face coloring (e.g. random vivid colors per box face, gradient sampled by world-up height, palette cycling).
Enums
BarrelColoringMode
Selects how ScyllaBarrelShape maps its profile sections onto resolver face indices. Geometry is identical in all modes; only the per-vertex color assignment changes.
BollardColoringMode
Selects how ScyllaBollardShape maps its regions onto resolver face indices. Geometry is identical in all modes; only the per-vertex color assignment changes.
CappedWallColoringMode
Selects how a ScyllaCappedWallShape maps its mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.
ColliderMode
Controls which collider (if any) a ScyllaShapeBase3D attaches to its UnityEngine.GameObject when the shape mesh is rebuilt.
CrateColoringMode
Selects how a ScyllaCrateShape maps its mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.
FaceColoringMode
Selects how a PaletteFaceColorResolver maps a shape's faces onto the entries of a ColorPalette. Consumed by ScyllaShapeBase3D when per-face vertex coloring is enabled.
PaneledWall1ColoringMode
Selects how a ScyllaPaneledWall1Shape maps its mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.
PaneledWall2ColoringMode
Selects how a ScyllaPaneledWall2Shape maps its mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.
PipeSegmentColoringMode
Selects how ScyllaPipeSegmentShape maps its sections onto resolver face indices. Geometry is identical in all modes; only the per-vertex color assignment changes.
RoundedBoxColoringMode
Selects how a ScyllaRoundedBoxShape maps its surface groups onto resolver face indices. Geometry is identical in all modes; only the per-vertex color assignment changes.
ShelvedWallColoringMode
Selects how a ScyllaShelvedWallShape maps its mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.
SignColoringMode
Selects how ScyllaSignShape maps its regions onto resolver face indices. Geometry is identical in all modes; only the per-vertex color assignment changes.
SkirtedWallColoringMode
Selects how a ScyllaSkirtedWallShape maps its mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.
StairsColoringMode
Selects how ScyllaLinearStairsShape, ScyllaCurvedStairsShape, and ScyllaSpiralStairsShape map their mesh quads onto resolver face indices. Geometry is identical in all modes; only the per-quad color assignment changes.