Frame: guard sliver-producing refinement splits

This commit is contained in:
wyj committed 2026-08-29 02:06:06 -04:00
1 parent b95c6579bd
commit 451b700b32
5 files changed
+161 -9

No files matched your search

+9 -3
View File
@@ -148,8 +148,8 @@ Adaptive refinement is disabled by default (`--refine-max-level 0`), so the
existing coarse-mesh renders remain unchanged. When enabled, its defaults are
an absolute direction error of `1e-3` degrees, relative error `0.1`, minimum
long edge `0.5` pixels, minimum area `0.25` pixel-squared, and a provisional
minimum discrete-Jacobian magnitude of `1e-3`. Each value can be overridden
independently:
minimum discrete-Jacobian magnitude of `1e-3`, and minimum triangle quality
`0.2`. Each value can be overridden independently:
```text
--refine-max-level N
@@ -158,6 +158,7 @@ independently:
--refine-jacobian-min J
--refine-min-edge-pixels P
--refine-min-area-pixels2 A
--refine-min-triangle-quality Q
```
`N` caps the triangle refinement level. Let `e` be the angle between the
@@ -170,7 +171,12 @@ source-sky/lens-map length. A locally escaped triangle is split only when
**both** `e > D_rad` (the converted `--refine-angle-abs-deg D`) and
`e / max(s, 1e-15) > --refine-angle-rel`. `P` and `A`
prevent selecting a leaf already at or below the requested image-plane
long-edge and area scales.
long-edge and area scales. `Q` is the normalized image-plane triangle quality
`4 sqrt(3) A / (l0^2 + l1^2 + l2^2)`: it is one for an equilateral triangle
and approaches zero for a sliver. Its default is `0.2`; `0` disables this
quality promotion. If a requested
single-edge split would create a child below `Q`, that leaf is promoted to red
refinement before the conforming shared-edge closure is applied.
Triangles whose three vertices disagree between capture and escape are split
independently of the direction-error thresholds, allowing the mesh to follow a
shadow boundary.