Class 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.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Capped Wall")]
public sealed class ScyllaCappedWallShape : ScyllaShapeBase3D
Remarks
The wall is centered at the origin. The total wall footprint is
Length x Height x Thickness. The cap
pushes the +Z extent out to Thickness * 0.5 + CapExtension in its
vertical band while the back face remains at -Thickness * 0.5.
Topology: 10 quads total - body front, cap front, cap underside (the visible step ledge), top face, back face, bottom face, body left end, body right end, cap left end, cap right end.
For per-face coloring, ColoringMode selects between WallAndCap (the default, 2 resolver indices: body vs cap) and PerRegion (3 indices: body, cap, back). Per-face coloring requires a FaceColoringMode other than None and a valid ColorPaletteName.
The Build(Mesh, float, float, float, float, float, CappedWallColoringMode, IFaceColorResolver) static method can be called directly to populate an arbitrary UnityEngine.Mesh without attaching a component.
Properties
CapExtension
Forward +Z extension of the cap beyond the body's front face. Clamped to
>= 0 when set and at build time. A value of 0 produces a flush cap (no visible
step). Setting this triggers an immediate mesh rebuild via
Rebuild().
Declaration
public float CapExtension { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
CapHeight
Vertical extent of the cap band, measured downward from the top of the wall.
Clamped to [0, Height] at build time. A value of 0 effectively
removes the cap. Setting this triggers an immediate mesh rebuild via
Rebuild().
Declaration
public float CapHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
ColoringMode
Selects the per-face color granularity applied when a IFaceColorResolver is active. Geometry is identical in all modes; only how many distinct resolver indices the wall emits changes. See CappedWallColoringMode for the index-to-region mapping. Setting this triggers an immediate mesh rebuild via Rebuild().
Declaration
public CappedWallColoringMode ColoringMode { get; set; }
Property Value
| Type | Description |
|---|---|
| CappedWallColoringMode |
Height
Wall extent along the Y axis (the wall's full vertical height, including the cap
band). Values below 0.0001 are clamped when set and at build time. Setting this triggers
an immediate mesh rebuild via Rebuild().
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Length
Wall extent along the X axis (the wall's horizontal run). Values below
0.0001 are clamped when set and at build time. Setting this triggers an immediate mesh
rebuild via Rebuild().
Declaration
public float Length { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Thickness
Body wall extent along the Z axis. The cap front face is pushed further out to
Thickness * 0.5 + CapExtension. Values below 0.0001 are clamped when set and at
build time. Setting this triggers an immediate mesh rebuild via
Rebuild().
Declaration
public float Thickness { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, float, float, float, float, CappedWallColoringMode, IFaceColorResolver)
Populates target with a parametric capped-wall mesh. Existing
mesh data is cleared and overwritten. All dimension parameters are clamped at build
time so the method always produces valid geometry.
Declaration
public static void Build(Mesh target, float length, float height, float thickness, float capHeight, float capExtension, CappedWallColoringMode coloringMode = CappedWallColoringMode.WallAndCap, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh to populate. Must not be |
| float | length | Wall extent along X (horizontal run). Values below |
| float | height | Wall extent along Y (full vertical height including the cap band). Values below
|
| float | thickness | Body wall extent along Z. Values below |
| float | capHeight | Vertical extent of the cap section, measured downward from the top of the wall.
Clamped to |
| float | capExtension | Forward |
| CappedWallColoringMode | coloringMode | Selects how resolver indices are assigned. WallAndCap
(the default) uses two indices total - |
| IFaceColorResolver | resolver | Optional per-face color resolver (see IFaceColorResolver). When
non-null, a per-vertex color channel is emitted with one solid color per logical
region. When |
Remarks
This method is the pure-static entry point used by the component's BuildMesh(Mesh) implementation. It can also be called directly to fill an arbitrary UnityEngine.Mesh - for example to bake the wall into a larger mesh at edit time.
The mesh uses per-region dispatch: Resolve(int, int, Vector3) is
called once per logical color group (2 or 3 calls total depending on
coloringMode), and the returned color is shared across all
vertices in that group. See CappedWallColoringMode for the
index-to-region mapping.
The generated mesh uses UnityEngine.Rendering.IndexFormat.UInt16 unless the vertex count exceeds 65 000, in which case UnityEngine.Rendering.IndexFormat.UInt32 is used automatically.
BuildMesh(Mesh)
Subclass extension point: write vertex / triangle / normal / uv data into
target from the shape's serialized parameters. The base class
calls Clear(bool) before invoking this method and
UnityEngine.Mesh.RecalculateBounds() afterwards, so subclasses should not invoke
either themselves.
Declaration
protected override void BuildMesh(Mesh target)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | The owned mesh to populate. Already cleared by the base class. |
Overrides
GetMeshName()
Returns the shape's mesh name as it should appear on the generated mesh asset. Defaults to the subclass type name; override to provide a friendlier label.
Declaration
protected override string GetMeshName()
Returns
| Type | Description |
|---|---|
| string | A short identifier for the generated mesh, used as UnityEngine.Object.name. |