-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
optimize walking of L-path vertices #300
Conversation
const node1 = nodes[i] | ||
const node2 = nodes[i + 1] | ||
graph.addNode(node1) | ||
graph.addNode(node2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter that you're adding both nodes each time? You would have to handle the edge case if you didn't do it this way, but it would save almost half the work on large lists of nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter that you're adding both nodes each time? You would have to handle the edge case if you didn't do it this way, but it would save almost half the work on large lists of nodes.
You're right. addNode handles it, but that's sloppy and I'll fix.
I am pretty sure 176 was referring to the Space Filler Wiper pattern, which is in space_filler/SpaceFiller.js. That doesn't appear to be affected by this change. |
Click the link on 176 above. It's the penrose optimization issue. |
If you Create New Layer -> Space Filler -> Type: There is a penrose tile there. I think that is what they are referring to. It's in space_filler.js |
@jeffeb3 Wow, I both missed this and misunderstood your comment. I've added in both places. I had to reduce the maxIterations for Penrose by 1 because the optimization takes too long to run, but it does reduce the vertex count considerably. |
Fixes #176.
Uses a modified shortest path algorithm to avoid re-walking edges that have already been walked. It does add computation time, so the subtype configuration enabled this optimization only if it helps the shape (reduces vertices) and doesn't bog down the browser.