class MAGES::MeshDeformations::AutoUV::PeelLayer¶
Overview¶
One depth-peel layer: a set of same-axis faces whose projected triangles are mutually non-overlapping. Backed by a coarse uniform 2D grid (over the axis’s projected bounds) storing face indices per cell, so a candidate is tested only against occupants of the cells its projected AABB touches. The layer’s own 2D bounds (Min/Max) become its packed island rect. More…
class PeelLayer
{
public:
// properties
float2 Min;
float2 Max;
// methods
PeelLayer(float2 axisMin, float2 axisMax, int faceCountHint);
bool Overlaps(
float2 a,
float2 b,
float2 c,
int[] indices,
float2[] projected,
int[] stamp,
int stampId,
float epsilon
);
void Add(int face, float2 a, float2 b, float2 c);
};
Detailed Documentation¶
One depth-peel layer: a set of same-axis faces whose projected triangles are mutually non-overlapping. Backed by a coarse uniform 2D grid (over the axis’s projected bounds) storing face indices per cell, so a candidate is tested only against occupants of the cells its projected AABB touches. The layer’s own 2D bounds (Min/Max) become its packed island rect.
Properties¶
float2 Min
Lower-left of the layer’s projected bounds (its island rect origin in projected space).
float2 Max
Upper-right of the layer’s projected bounds.
Methods¶
bool Overlaps(
float2 a,
float2 b,
float2 c,
int[] indices,
float2[] projected,
int[] stamp,
int stampId,
float epsilon
)
Returns whether the candidate triangle overlaps any face already in this layer. Uses stamp / stampId so each occupant is tested at most once even when it spans several of the AABB’s cells.
void Add(int face, float2 a, float2 b, float2 c)
Adds a face to the layer: grows the layer bounds and inserts it into every cell its AABB touches.