Skip to content

BevelProfile

ClassTextStudio.ThreeDTextStudio.3D
[CreateAssetMenu(fileName = "New Bevel Profile", menuName = "Text Studio/3D/Appearance/Bevel Profile", order = 105)]
public class BevelProfile : ScriptableObject

2D cross-section of a bevel, swept around a glyph contour. A profile is an ordered list of (offsetXY, offsetZ) samples that define a polyline tracing the bevel from the body junction (t=0) to the cap plane (t=1).

Convention:

  • offsetXY is the radial inset measured from the contour edge, normalised to [0..1] of the bevel's size.
  • offsetZ is the Z offset from the body junction, normalised to [0..1] of the bevel's thickness.
  • Samples are ordered from body-junction ring (first entry, typically (0, 0)) to cap-plane ring (last entry, typically (1, 1)). They can also be non-monotonic to produce ridges, coves, ogee shapes, and double-bevels.

Built-in presets live in TextStudio.ThreeD.BuiltInBevelProfiles. Authors create custom profiles via Assets → Create → Text Studio → 3D → Appearance → Bevel Profile.

public void SetSamples(Vector2[] samples, bool smooth = true)

Replace the serialised samples with a new polyline and re-bake the cache. Intended for the built-in-profile library and for runtime authoring.

Parameters

Name Type
samples UnityEngine.Vector2[]
smooth System.Boolean
public static Vector2[] DefaultRoundSamples(int segments)

Build a quarter-circle arc in [0..1]² approximating a rounded bevel with the given segment count. Used as the safe default when a layer has no profile asset assigned.

Parameters

Name Type
segments System.Int32

Returns

UnityEngine.Vector2[]

public BevelProfile()

public Vector2[] Samples { get; }

Resolved sample points. Guaranteed to have at least two entries; an empty serialised array is substituted with a minimal round profile on access.

Returns

UnityEngine.Vector2[]

public bool Smooth { get; }

Returns

System.Boolean

public int RingCount { get; }

Number of rings the profile emits (equals Samples.Length).

Returns

System.Int32

public int ShapeHash { get; }

Stable hash used by the glyph geometry cache to detect profile edits.

Returns

System.Int32