Area follows polygon geometry#
Area comes from generated solid polygon area in source-sprite local space. It is not a bounding-box estimate, and texture alpha is not sampled.
Transparent pixels inside Full Rect Sprite geometry still count as geometry. A tight/custom outline excludes its empty exterior. Choose source geometry deliberately when area drives scoring or gameplay rules.
Original ratio and parent ratio#
| Property | Calculation | Question answered |
|---|---|---|
OriginalRatio | Fragment area / original source polygon area. | How much of the original source is this piece? |
ParentRatio | Fragment area / immediate parent polygon area. | How much of the piece just cut is this child? |
For the guide's example, a first cut produces A = 30% and B = 70% of the original. Cutting B produces B1 = 25% and B2 = 45% of the original:
| Piece | OriginalRatio | ParentRatio |
|---|---|---|
| A | 0.30 | 0.30 on the first cut. |
| B | 0.70 | 0.70 on the first cut. |
| B1 | 0.25 | 25 / 70 ≈ 0.357. |
| B2 | 0.45 | 45 / 70 ≈ 0.643. |
The child ratios answer different questions, so preserve both when your gameplay needs original-source scoring and immediate-parent split balance.
Track a current ancestry tree#
Fragment metadata exposes FragmentId, ParentFragmentId, OriginalSourceId, Generation, Area and Bounds. Use TryGetRuntimeFragment and TryGetParent to resolve current-cycle ancestry.
Detailed results also provide world CutPosition, source-local LocalPosition, NormalizedSpritePosition, CutDirection and line endpoints. These can support feedback, sound or scoring tied to the actual cut.
Read the returned fragments#
This contextual guide snippet assumes target, worldStart and worldEnd are supplied by your component:
RuntimeSliceResult result = target.SliceSegmentDetailed(worldStart, worldEnd, force: 2f);
if (result.Success)
{
foreach (RuntimeFragmentInfo fragment in result.Fragments)
Debug.Log($"Original {fragment.OriginalRatio:P1}; parent {fragment.ParentRatio:P1}");
}Fragment handles remain valid only while the pooled piece is active. Reassembly clears the previous ancestry tree, so discard old references. See events and restoration for that lifecycle.