You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix point_in_mesh robustness and reinit_mesh performance
Two fixes:
1. point_in_mesh: use 3-ray majority vote instead of a single ray.
A single ray can pass through a shared mesh edge, causing the
deduplication to either miss or double-count a crossing and flip
the inside/outside parity. Three rays in irrational directions
make it extremely unlikely that more than one hits a degenerate
case at the same query point.
2. reinit_mesh: skip BVH rebuild if already initialized. Unlike
blocks/cylinders, mesh uses absolute coordinates and doesn't
depend on the lattice basis. geom_fix_object_ptr is called
hundreds of times during meep's init_sim via geometry copies;
without the guard, each call rebuilt the BVH (~150ms for 9K
triangles), causing ~40s of wasted time.
0 commit comments