BevelProfile
[CreateAssetMenu(fileName = "New Bevel Profile", menuName = "Text Studio/3D/Appearance/Bevel Profile", order = 105)]public class BevelProfile : ScriptableObject2D 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:
offsetXYis the radial inset measured from the contour edge, normalised to [0..1] of the bevel'ssize.offsetZis the Z offset from the body junction, normalised to [0..1] of the bevel'sthickness.- 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.
Methods
Section titled “Methods”
SetSamples(Vector2[], bool)
Section titled “SetSamples(Vector2[], bool)”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 |
DefaultRoundSamples(int)
Section titled “DefaultRoundSamples(int)”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[]
Constructors
Section titled “Constructors”
BevelProfile()
Section titled “BevelProfile()”public BevelProfile()Properties
Section titled “Properties”
Samples
Section titled “Samples”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[]
Smooth
Section titled “Smooth”public bool Smooth { get; }Returns
System.Boolean
RingCount
Section titled “RingCount”public int RingCount { get; }Number of rings the profile emits (equals Samples.Length).
Returns
System.Int32
ShapeHash
Section titled “ShapeHash”public int ShapeHash { get; }Stable hash used by the glyph geometry cache to detect profile edits.
Returns
System.Int32