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

Adding each potential translation vector twice. #86

Open
3bhady opened this issue Jun 16, 2019 · 0 comments
Open

Adding each potential translation vector twice. #86

3bhady opened this issue Jun 16, 2019 · 0 comments

Comments

@3bhady
Copy link

3bhady commented Jun 16, 2019

SVGnest/util/geometryutil.js

Lines 1567 to 1579 in 1248dc2

vectors.push({
x: vertexA.x-(vertexB.x+B.offsetx),
y: vertexA.y-(vertexB.y+B.offsety),
start: prevA,
end: vertexA
});
vectors.push({
x: prevA.x-(vertexB.x+B.offsetx),
y: prevA.y-(vertexB.y+B.offsety),
start: vertexA,
end: prevA
});

Is there a reason each vector is being added twice? The algorithm in the NFP paper specifies that we only need to add on of these translation vectors.
Could this be causing an overhead or is it needed for something else I'm not seeing?

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

No branches or pull requests

1 participant