Skip to content

Fix trench boundary handling and image cropping - #59

Draft
georgeoshardo wants to merge 2 commits into
mainfrom
fix/trench-geometry-crops
Draft

Fix trench boundary handling and image cropping#59
georgeoshardo wants to merge 2 commits into
mainfrom
fix/trench-geometry-crops

Conversation

@georgeoshardo

Copy link
Copy Markdown
Owner

What changed

  • Constrain and project cell centers against the rounded U-shaped trench cap instead of a flat rectangular floor.
  • Mark trench walls explicitly and extract them through each shape body relationship, so cap segments, unrelated static geometry, and short walls are not mistaken for one another.
  • Return exclusive crop stop indices and center same-parity horizontal crops without a one-pixel shift.
  • Add small parameterized geometry and crop regressions; no visual snapshot tests were added.

Why

The previous containment floor did not follow the cap curve, so cells could overlap the closed end. Trench wall extraction zipped independent Pymunk collections and then assumed the two largest static shapes were the walls, which fails for short trenches and additional static geometry. Crop bounds mixed inclusive maxima with Python exclusive slices, and same-parity width handling shifted centered crops left by one pixel.

Validation

  • pixi run pytest tests/test_drawing.py tests/test_microfluidic_geometry.py tests/test_trench_geometry.py tests/test_simulation_persistence.py tests/test_renderer_mask_export.py -q — 30 passed, 1 existing CPU-fallback warning
  • pixi run pytest — 76 passed, 1 existing CPU-fallback warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant