Frame: gate fold refinement by Jacobian
This commit is contained in:
1 parent
4c575fa8b5
commit
b95c6579bd
4 files changed
+65
-31
No files matched your search
+19
-11
@@ -193,24 +193,32 @@ int main(void) {
|
||||
goto done;
|
||||
}
|
||||
frame_lens_mesh_destroy(&adaptive_mesh);
|
||||
/* A zero discrete Jacobian is an independent fold/critical-band trigger:
|
||||
* the probe below agrees exactly with linear endpoint interpolation, so the
|
||||
* direction-error criterion cannot request this split. */
|
||||
if (frame_lens_mesh_build_coarse(&adaptive_mesh, width, height, 100, 30.0))
|
||||
goto done;
|
||||
for (size_t i = 0; i < adaptive_mesh.vertex_count; ++i) {
|
||||
adaptive_mesh.vertices[i].traced = 1;
|
||||
adaptive_mesh.vertices[i].status = RAY_ENDPOINT_ESCAPED;
|
||||
adaptive_mesh.vertices[i].n_infinity[0] = 1.0;
|
||||
}
|
||||
const RayEndpoint flat_probe = {.n_infinity = {1.0, 0.0, 0.0},
|
||||
.frequency_ratio = 1.0,
|
||||
.status = RAY_ENDPOINT_ESCAPED};
|
||||
/* Opposite nonzero discrete-Jacobian signs on the two sides of the shared
|
||||
* diagonal require a sufficiently small magnitude before requesting it. */
|
||||
refine.jacobian_minimum = 10.0;
|
||||
refine.angle_absolute_rad = 3.14159265358979323846;
|
||||
refine.angle_relative = 1e6;
|
||||
if (frame_lens_mesh_build_coarse(&adaptive_mesh, width, height, 100, 30.0))
|
||||
goto done;
|
||||
const double source_directions[4][3] = {
|
||||
{1.0, 0.0, 0.0},
|
||||
{sqrt(0.99), 0.0, 0.1},
|
||||
{sqrt(0.99), 0.0, 0.1},
|
||||
{sqrt(0.98), 0.1, 0.1}};
|
||||
for (size_t i = 0; i < adaptive_mesh.vertex_count; ++i) {
|
||||
adaptive_mesh.vertices[i].traced = 1;
|
||||
adaptive_mesh.vertices[i].status = RAY_ENDPOINT_ESCAPED;
|
||||
memcpy(adaptive_mesh.vertices[i].n_infinity, source_directions[i],
|
||||
sizeof source_directions[i]);
|
||||
}
|
||||
if (frame_lens_mesh_prepare_generation(&adaptive_mesh, &refine) != 1 ||
|
||||
frame_lens_mesh_install_sample(&adaptive_mesh, 0, &flat_probe) ||
|
||||
frame_lens_mesh_finish_generation(&adaptive_mesh, &refine) != 1 ||
|
||||
adaptive_mesh.vertex_count != 5 || adaptive_mesh.triangle_count != 4) {
|
||||
fputs("adaptive discrete-Jacobian split regression failed\n", stderr);
|
||||
fputs("adaptive fold-parity split regression failed\n", stderr);
|
||||
frame_lens_mesh_destroy(&adaptive_mesh);
|
||||
goto done;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user