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

script to remove coextensive segments #9

Open
sbma44 opened this issue Nov 12, 2018 · 0 comments
Open

script to remove coextensive segments #9

sbma44 opened this issue Nov 12, 2018 · 0 comments

Comments

@sbma44
Copy link

sbma44 commented Nov 12, 2018

Thanks very much for publishing your work, and in particular for the hiddenwire algorithm. I've been wanting something like this for my DIY plotter but had abandoned the effort after a few dead-ends based on other projects.

Your work generates great output, but the SVGs contain many segments that are collinear. My plotter is not smart enough to avoid drawing these lines multiple times, which, depending on the pen I use, creates an unwanted variation in line thickness.

I've taken a pass at a script to remove these duplicative segments. It is not thoroughly tested but shows good results with the STL I've been playing around with. I will probably put a few more STLs from here through it this evening.

I'm afraid that I haven't written C in quite a while, so this is in Python, which is why I'll offer it as a gist rather than a pull request:

https://gist.github.com/sbma44/dc34e5005d9827aa7b1c8c11e68b0c6b

You will find the STL as well as the before & after SVG. The before SVG has randomly-assigned colors for the line segments to make it a little easier to spot overlap.

You'll also note a stray line segment in both the before & after. I'm afraid I haven't been able to find where that's coming from (it's easy enough for me to delete in inkscape before rendering gcode). You might have a better hunch than me.

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