Class 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.
Inheritance
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Pipe Segment")]
public sealed class ScyllaPipeSegmentShape : ScyllaShapeBase3D
Remarks
Profile rings, bottom to top: bottom flange disc cap, bottom flange outer rim, bottom flange inner step (where the flange shoulder meets the body), body, top flange inner step, top flange outer rim, top flange disc cap. Each strip has flat normals in the profile direction and smooth normals around the circumference.
For per-face coloring, ColoringMode selects between FlangesAndBody (default, 2 resolver indices: body + both flanges share one color) and PerSection (3 resolver indices: bottom flange (0), body (1), top flange (2)).
Properties
BodyRadius
Radius of the cylindrical body between the two flanges. Clamped to a positive minimum when set and at build time. Setting this triggers an immediate mesh rebuild.
Declaration
public float BodyRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
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 segment emits changes. See PipeSegmentColoringMode for the exact index layout. Setting this triggers an immediate mesh rebuild.
Declaration
public PipeSegmentColoringMode ColoringMode { get; set; }
Property Value
| Type | Description |
|---|---|
| PipeSegmentColoringMode |
FlangeRadius
Outer radius of each flange disc. Must be greater than or equal to
BodyRadius; clamped at build time. The flange protrusion beyond the
body is FlangeRadius - BodyRadius. Setting this triggers an immediate mesh
rebuild.
Declaration
public float FlangeRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
FlangeThickness
Vertical thickness of each flange. Both flanges share this value. Clamped at build time so both flanges fit within the total height with at least a zero-span body section between them. Setting this triggers an immediate mesh rebuild.
Declaration
public float FlangeThickness { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Height
Total length of the segment along the Y axis, flanges included. The mesh is centered
on the origin so it extends from -Height/2 to +Height/2. Setting this
triggers an immediate mesh rebuild.
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Segments
Circumferential subdivisions around the Y axis. Higher values produce a rounder
silhouette. Clamped to [3, 256] when set and 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, float, float, int, PipeSegmentColoringMode, IFaceColorResolver)
Populates target with a parametric pipe-segment mesh. Existing mesh
data is overwritten.
Declaration
public static void Build(Mesh target, float bodyRadius, float flangeRadius, float height, float flangeThickness, int segments, PipeSegmentColoringMode coloringMode = PipeSegmentColoringMode.FlangesAndBody, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | bodyRadius | Body cylinder radius. |
| float | flangeRadius | Outer radius of each flange disc. |
| float | height | Total height along Y. |
| float | flangeThickness | Vertical thickness of each flange. |
| int | segments | Circumferential subdivisions. Clamped to |
| PipeSegmentColoringMode | coloringMode | Selects how the resolver indices are assigned. FlangesAndBody
(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. |