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

Speed up packing #303

Open
meganrm opened this issue Jan 21, 2025 · 0 comments
Open

Speed up packing #303

meganrm opened this issue Jan 21, 2025 · 0 comments

Comments

@meganrm
Copy link
Member

meganrm commented Jan 21, 2025

Jitter was really fast, but we discovered some issues with it allowing small overlaps (for some use cases it might be good enough). Our new system has zero overlaps, but is a lot slower.

Are there ways we can speed up our current system by making use of parts of the jitter algorithm without losing the accuracy? look at search tree?

what are ways we could use jitter with additional checks at the end to avoid the tiny overlaps?

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

Originally posted by @mogres in #134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant