Class 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).
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Ring")]
public sealed class ScyllaRingShape : ScyllaShapeBase3D
Remarks
The top face lies at y = height / 2 and the bottom face at
y = -height / 2. The outer wall faces outward radially and the inner wall
faces inward (toward the Y axis), producing a hollow tube cross-section.
Because each of the four face groups uses independent vertices, all edges are
hard-shaded. The outer wall normal is the outward radial direction per segment
quad; the inner wall normal is the inward radial direction. Top and bottom face
normals are uniform +Y and -Y respectively.
Total vertex count is segments * 4 * 4 (four quads per segment, four
vertices per quad) and triangle index count is segments * 4 * 6.
Segment count is clamped to [3, 256] at build time.
Per-vertex coloring (see FaceColoringMode) uses per-vertex dispatch: the resolver is called once per vertex with the vertex index and local position. This produces smooth spatial gradients under GradientByY and per-vertex variation under Cycle or Hash.
The static Build(Mesh, float, float, float, int, IFaceColorResolver) method can be called directly to populate any UnityEngine.Mesh without attaching a component, which is useful for procedural mesh pipelines.
Properties
Height
Vertical thickness of the ring in local units. Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
InnerRadius
Inner radius of the ring (hole size) in local units. Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float InnerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
OuterRadius
Outer radius of the ring in local units. Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float OuterRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Segments
Number of circumferential subdivisions around the ring. Clamped to [3, 256]
at build time. Setting this property triggers an immediate mesh rebuild via
Rebuild().
Declaration
public int Segments { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Build(Mesh, float, float, float, int, IFaceColorResolver)
Populates target with a parametric ring (annulus) mesh.
Existing mesh data is overwritten. Segment count is clamped to [3, 256].
Declaration
public static void Build(Mesh target, float outerRadius, float innerRadius, float height, int segments, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | outerRadius | Outer radius of the ring in local units. Must be greater than
|
| float | innerRadius | Inner radius of the ring (hole size) in local units. Determines the size of the central opening. |
| float | height | Vertical thickness of the ring in local units. The top face is at
|
| int | segments | Circumferential subdivisions around the ring. Clamped to |
| IFaceColorResolver | resolver | Optional per-vertex color resolver. Uses per-vertex dispatch: when non-null, a
per-vertex color channel is emitted where the resolver is called once per vertex
with the vertex index and local position. Yields smooth gradients under
GradientByY and per-vertex speckle under
Cycle or Hash.
When |
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. |