Class 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.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Bollard")]
public sealed class ScyllaBollardShape : ScyllaShapeBase3D
Remarks
The body is a smooth-around-the-circumference cylindrical lathe strip closed at the bottom by a disc cap. The cap is a smooth-shaded UV-sphere upper half with radial per-vertex normals matching the standard sphere builder.
For per-face coloring, ColoringMode selects between BodyAndCap (default, 2 resolver indices: body (cylinder + bottom disc) + cap (hemisphere)) and PerRegion (3 indices: cylinder wall + bottom disc + cap).
Properties
BodyHeight
Height of the cylindrical body only. The hemispherical cap adds a further Radius on top. The mesh is centered on the origin. Setting this triggers an immediate mesh rebuild.
Declaration
public float BodyHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
CapRings
Latitudinal ring count of the hemispherical cap, from equator to apex. Higher values
produce a smoother dome. Clamped to [2, 64] at build time. Setting this
triggers an immediate mesh rebuild.
Declaration
public int CapRings { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ColoringMode
Selects the per-face color granularity used when an IFaceColorResolver is active. Geometry is identical in all modes; only how many distinct resolver indices the bollard emits changes. See BollardColoringMode for the exact index layout. Setting this triggers an immediate mesh rebuild.
Declaration
public BollardColoringMode ColoringMode { get; set; }
Property Value
| Type | Description |
|---|---|
| BollardColoringMode |
Radius
Radius of both the cylindrical body and the hemispherical cap. The total shape height
is BodyHeight + Radius. Setting this triggers an immediate mesh rebuild.
Declaration
public float Radius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Segments
Circumferential subdivisions around the Y axis. Higher values produce a rounder body
silhouette and a smoother cap equator. Clamped to [3, 128] at build time.
Setting this triggers an immediate mesh rebuild.
Declaration
public int Segments { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Build(Mesh, float, float, int, int, BollardColoringMode, IFaceColorResolver)
Populates target with a parametric bollard mesh (cylinder body +
hemispherical cap). Existing mesh data is overwritten.
Declaration
public static void Build(Mesh target, float radius, float bodyHeight, int segments, int capRings, BollardColoringMode coloringMode = BollardColoringMode.BodyAndCap, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | radius | Body and cap radius. |
| float | bodyHeight | Height of the cylindrical body only (the cap adds |
| int | segments | Circumferential subdivisions. Clamped to |
| int | capRings | Latitudinal rings in the cap. Clamped to |
| BollardColoringMode | coloringMode | Selects how the resolver indices are assigned. BodyAndCap
(the default) uses two indices total - |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted with one solid color per logical face. When null, no color channel is written. |
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. |