The point serialization optimization in serialize-points.ts maps the range -100 to 1100 to uint16 0..65535. This means each step in uint16 space is 0.01831055 on the map.
The problem is that some of the interior boundary points which are supposed to be >0.0 end up <0.0.
for (let r = mesh.numExteriorBoundaryPoints; r < mesh.numExteriorBoundaryPoints + mesh.numInteriorBoundaryPoints; r++) {
let [x, y] = map.mesh._vertex_r[r];
if (x < 0 || x >= 1000 || y < 0 || y >= 1000) console.warn("out of bounds", x, y);
}
out of bounds 441.96383611810484 -0.00457770656900891
out of bounds 449.70931563286786 -0.00457770656900891
out of bounds 457.436484321355 -0.00457770656900891
out of bounds 465.18196383611814 -0.00457770656900891
out of bounds 472.9091325246052 -0.00457770656900891
out of bounds 480.6546120393683 -0.00457770656900891
out of bounds 488.38178072785536 -0.00457770656900891
out of bounds 496.1272602426185 -0.00457770656900891
out of bounds 503.85442893110553 -0.00457770656900891
out of bounds 511.59990844586855 -0.00457770656900891
out of bounds 519.3270771343557 -0.00457770656900891
out of bounds 527.0725566491188 -0.00457770656900891
out of bounds 534.7997253376059 -0.00457770656900891
out of bounds 542.5452048523689 -0.00457770656900891
out of bounds 550.2723735408559 -0.00457770656900891
out of bounds 558.0178530556192 -0.00457770656900891
out of bounds -0.00457770656900891 558.0178530556192
out of bounds -0.00457770656900891 550.2723735408559
out of bounds -0.00457770656900891 542.5452048523689
out of bounds -0.00457770656900891 534.7997253376059
out of bounds -0.00457770656900891 527.0725566491188
out of bounds -0.00457770656900891 519.3270771343557
out of bounds -0.00457770656900891 511.59990844586855
out of bounds -0.00457770656900891 503.85442893110553
out of bounds -0.00457770656900891 496.1272602426185
out of bounds -0.00457770656900891 488.38178072785536
out of bounds -0.00457770656900891 480.6546120393683
out of bounds -0.00457770656900891 472.9091325246052
out of bounds -0.00457770656900891 465.18196383611814
out of bounds -0.00457770656900891 457.436484321355
out of bounds -0.00457770656900891 449.70931563286786
out of bounds -0.00457770656900891 441.96383611810484
To solve this, either I need to move the boundary points farther from the boundary, or I need to increase the serialization size from uint16 to uint32.
The point serialization optimization in serialize-points.ts maps the range -100 to 1100 to uint16 0..65535. This means each step in uint16 space is 0.01831055 on the map.
The problem is that some of the interior boundary points which are supposed to be >0.0 end up <0.0.
To solve this, either I need to move the boundary points farther from the boundary, or I need to increase the serialization size from uint16 to uint32.