Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jitter packing results in overlaps for some parameter ranges #134

Open
mogres opened this issue Feb 2, 2023 · 1 comment
Open

Jitter packing results in overlaps for some parameter ranges #134

mogres opened this issue Feb 2, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mogres
Copy link
Collaborator

mogres commented Feb 2, 2023

Description

Packing a recipe with the jitter algorithm results in overlaps as detected by the analysis workflow. These overlaps can be identified in the packing image.

image

Expected Behavior

We expect the analysis workflow to not detect any overlaps.

Reproduction

pack -r cellpack/tests/recipes/test_spheres.json -c cellpack/tests/packing-configs/test_config.json
analyze -a cellpack/tests/analysis-configs/PR_analysis_config.json

#78 (comment)

Information

The overlaps are dependent on grid spacing. For a sufficiently fine grid, there are no overlaps.

Questions/directions to try:

  • Adding an option to test distances at every packing step, and throw a trace if discrepancy is detected
  • check if distance stored in the grid is reduced if an ingredient fails to pack
  • check how far an ingredient jitters from the grid point
    • square vs circle
    • radius of jitter
@mogres mogres added the bug Something isn't working label Feb 2, 2023
@mogres
Copy link
Collaborator Author

mogres commented Mar 17, 2023

After some discussion involving @meganrm, @gj210, @mogres, @toloudis, we came to the conclusion that the jitter algorithm essentially uses a signed distance function created by the grid to recreate the shapes of already packed objects. This recreation is imperfect due to the inherent granularity of the grid, and it is possible for a grid-object check to pass even when it should identify a collision. This is illustrated by the following applet created by @toloudis: https://editor.p5js.org/toloudis/sketches/3JIhRhpHZ

image

Suggestions for moving forward:

  1. Store the identity of the nearest object (in addition to the distance to the nearest surface) within the grid points
  2. Implement a local object-object collision check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants