Vixen
dd8b0a81
csharp
public static class UvStacking

docs/plan/42 § D10's symmetric stacking: opt-in, offered rather than applied.

Read the guide page for this →

Remarks

Symmetric islands can be deliberately overlapped so both halves share one region of texture, halving what the atlas costs. ⚠ It is off by default — nothing in this library calls it — because it forbids asymmetric detail, and the cost of finding that out is a retexture rather than a repack.

⚠ Doc 41 § D11's exact symmetry is what makes detection reliable, and the honest limitation is stated rather than hidden. A mesh remeshed with symmetry on has vertex k and its mirror as exact negations, so the two islands come out with their corners in the same order and the comparison below is an equality. On a mesh that was not remeshed that way the corner orders are unrelated and no pair will match however symmetric the surface is — this detector reports nothing rather than reporting a guess. Finding the correspondence itself is a shape-matching problem and § D10 does not ask for one.

⚠ Folding is a change to which islands are packed and never to an island's coordinates. The partner keeps its own shape and is given the representative's placement; Apply normalizes by the island's own lower corner, so a mirrored partner lands on the same rectangle with its own parameterization — which is what "share one region" means, and it costs no resampling.

Fields and properties (1)

  • public const float DefaultTolerance

    How close two corners must sit, as a fraction of the extent, before a pair is offered.

Methods (3)

  • public static IReadOnlyList<UvStackOffer> Detect(IReadOnlyList<UvIsland> islands, float tolerance = 0.001)

    Finds pairs of islands that one region of texture could serve.

  • public static IReadOnlyList<UvIsland> Fold(IReadOnlyList<UvIsland> islands, IReadOnlyList<UvStackOffer> accepted, out int[] source)

    Drops every accepted partner, leaving the islands to hand the packer.

  • public static IReadOnlyList<UvPlacement> Unfold(IReadOnlyList<UvPlacement> packed, IReadOnlyList<int> source)

    Turns a pack of the folded islands back into one placement per original island.

Used by (1)

  • UvStackingTestsVixen.Geometry.Uv.Tests