TextStudio3DContourUtility
public static class TextStudio3DContourUtilityOpt-in contour validation and repair for imported or procedurally authored outline data. Normal text generation does not run this diagnostic pass automatically.
Methods
Section titled “Methods”
TryCreateSampler(ContourState, out TextStudio3DContourSampler)
Section titled “TryCreateSampler(ContourState, out TextStudio3DContourSampler)”public static bool TryCreateSampler(ContourState contour, out TextStudio3DContourSampler sampler)Create a detached immutable arc-length sampler for a valid canonical contour. Outer loops are indexed first, followed by holes; invalid contours return false unchanged.
Parameters
| Name | Type |
|---|---|
contour |
TextStudio.ThreeD.ContourState |
sampler |
TextStudio.ThreeD.TextStudio3DContourSampler |
Returns
System.Boolean
CreateBacking(TextStudio3DBackingShape, Rect, float, float, int)
Section titled “CreateBacking(TextStudio3DBackingShape, Rect, float, float, int)”public static ContourState CreateBacking(TextStudio3DBackingShape shape, Rect bounds, float cornerRadius = 0.1, float borderWidth = 0.05, int cornerSegments = 4)Create one canonical local-space backing contour.
Parameters
| Name | Type |
|---|---|
shape |
TextStudio.ThreeD.TextStudio3DBackingShape |
bounds |
UnityEngine.Rect |
cornerRadius |
System.Single |
borderWidth |
System.Single |
cornerSegments |
System.Int32 |
Returns
TextStudio.ThreeD.ContourState
Union(ContourState, ContourState)
Section titled “Union(ContourState, ContourState)”public static ContourState Union(ContourState first, ContourState second)Combine the filled area of two contours.
Parameters
| Name | Type |
|---|---|
first |
TextStudio.ThreeD.ContourState |
second |
TextStudio.ThreeD.ContourState |
Returns
TextStudio.ThreeD.ContourState
Subtract(ContourState, ContourState)
Section titled “Subtract(ContourState, ContourState)”public static ContourState Subtract(ContourState subject, ContourState clip)Remove the filled area of clip from subject.
Parameters
| Name | Type |
|---|---|
subject |
TextStudio.ThreeD.ContourState |
clip |
TextStudio.ThreeD.ContourState |
Returns
TextStudio.ThreeD.ContourState
Intersect(ContourState, ContourState)
Section titled “Intersect(ContourState, ContourState)”public static ContourState Intersect(ContourState first, ContourState second)Keep only the filled area shared by two contours.
Parameters
| Name | Type |
|---|---|
first |
TextStudio.ThreeD.ContourState |
second |
TextStudio.ThreeD.ContourState |
Returns
TextStudio.ThreeD.ContourState
Clip(ContourState, Rect)
Section titled “Clip(ContourState, Rect)”public static ContourState Clip(ContourState source, Rect clipBounds)Clip a contour to an axis-aligned local-space rectangle.
Parameters
| Name | Type |
|---|---|
source |
TextStudio.ThreeD.ContourState |
clipBounds |
UnityEngine.Rect |
Returns
TextStudio.ThreeD.ContourState
Validate(ContourState)
Section titled “Validate(ContourState)”public static TextStudio3DContourValidationReport Validate(ContourState contour)Validate loop closure, data, area, winding, intersections, and hole containment.
Parameters
| Name | Type |
|---|---|
contour |
TextStudio.ThreeD.ContourState |
Returns
TextStudio.ThreeD.TextStudio3DContourValidationReport
Repair(ContourState, out TextStudio3DContourValidationReport)
Section titled “Repair(ContourState, out TextStudio3DContourValidationReport)”public static ContourState Repair(ContourState contour, out TextStudio3DContourValidationReport report)Return a repaired contour with closed normalized loops, valid winding, contained holes, and boolean-resolved self-intersections. The report describes the returned contour.
Parameters
| Name | Type |
|---|---|
contour |
TextStudio.ThreeD.ContourState |
report |
TextStudio.ThreeD.TextStudio3DContourValidationReport |
Returns
TextStudio.ThreeD.ContourState