Class 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.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Pipe")]
public sealed class ScyllaPipeShape : ScyllaShapeBase3D
Remarks
Side normals are radial-smooth on both the outer and inner surfaces. Cap normals are
flat (+Y / -Y). Segment count is clamped to [3, 256];
InnerRadius is clamped to [0, OuterRadius - epsilon] so the wall
retains thickness.
For per-face coloring the pipe exposes four logical faces (outer side, inner side, top ring, bottom ring), so Cycle cycles through up to four distinct palette colors.
When Capped is false the two annular cap rings are omitted; the
outer and inner cylindrical surfaces remain present, producing an open tube. The mesh
is then not a closed solid, which the bundled tests account for (the watertight signed
-volume test only runs when caps are present).
Properties
Capped
When true, the top and bottom annular cap rings are emitted, producing a
closed solid. When false, only the outer and inner cylindrical surfaces are
present and the pipe is open at both ends. Setting this triggers an immediate mesh
rebuild.
Declaration
public bool Capped { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Height
Pipe length along the Y axis. The mesh is centered on the origin, extending from
-Height/2 to +Height/2. Setting this triggers an immediate mesh
rebuild.
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
InnerRadius
Inner (bore) radius of the hollow pipe. Clamped to [0, OuterRadius - epsilon]
at build time. Setting this triggers an immediate mesh rebuild.
Declaration
public float InnerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
OuterRadius
Outer radius of the pipe wall. Wall thickness is OuterRadius - InnerRadius.
Setting this triggers an immediate mesh rebuild.
Declaration
public float OuterRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Segments
Circumferential subdivisions around the Y axis. Higher values produce a rounder
silhouette. Clamped to [3, 256] 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, int, bool, IFaceColorResolver)
Populates target with a parametric hollow-pipe mesh. Existing mesh
data is overwritten.
Declaration
public static void Build(Mesh target, float outerRadius, float innerRadius, float height, int segments, bool capped, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | outerRadius | Outer radius. |
| float | innerRadius | Inner radius. Clamped to |
| float | height | Length along the Y axis. |
| int | segments | Circumferential subdivisions. Clamped to |
| bool | capped | When |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted with up to four logical faces: outer side (0), inner side (1), top ring (2), bottom ring (3). 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. |