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

Request: Splitdist with overlapping segments #600

Open
erinrrobinson opened this issue Feb 26, 2023 · 3 comments
Open

Request: Splitdist with overlapping segments #600

erinrrobinson opened this issue Feb 26, 2023 · 3 comments

Comments

@erinrrobinson
Copy link

It would be great to have a feature that when splitting lines by distance creates some overlap for painting to create the illusion of a smoother continuous line. For example, if the lines are split by a distance of 5cm, to extend all lines except the last one by 1cm so that they overlap. This will reduce the issues of weakening the paint stream over time. Going to have a go at implementing this on my local machine today but I'm not very good at under-the-hood stuff so thought I'd make a request!

@abey79
Copy link
Owner

abey79 commented Feb 26, 2023

The way this is currently is that input lines are not cut to fit the distance budget. Rather they are kept whole, and simply sorted across many layer. This makes it tricker to implement overlap, because there is no guarantee that extending one line would overlap the next line.

An alternative implementation of splitdist where lines are actually cut precisely when the distance budget is exhausted would make it easier, as the splitting could be done such are leaving some overlap. I would certainly consider such a PR :)

@erinrrobinson
Copy link
Author

Using svgpathtools I've written a seperate script which can split an svg by distance, overlapping the lines by an offset amount (not perfect but proof of concept) to the same layer. Is there a way with vpype to append each path with a another path(s) thats been implemented, but on the same layer? It's possible with svgpathtools but doesn't offer any layout options which makes it exceedingly difficult to put a path in the right spot for a paint pot.

If I get this to work I'd be happy to make a PR and write it up properly!

@abey79
Copy link
Owner

abey79 commented Feb 26, 2023

I'm not sure exactly I understand exactly what you mean. In vpype, layers are basically glorified list of 1-dimensional numpy arrays of complex (where the imaginary part stands for the y axis). In a command you can manipulate the content of a layer however you like. To create a command, you can fork vpype and edit, e.g., splitdist or create a new command, or make a plug-in.

Edit: I'm happy to assist with the details, but discord might be a better place for that :)

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

2 participants