evil-mad / axidraw

Software for the AxiDraw drawing machine
GNU General Public License v2.0
431 stars 130 forks source link

Clipping path support #100

Open pzich opened 3 years ago

pzich commented 3 years ago

Is it possible to support clipping paths from SVGs? As an example, this is an SVG with diagonal lines that are clipped by a circle.

Screen Shot 2021-02-08 at 6 16 14 PM

After pulling the output SVG out of ad.plot_run(True) I see the complete lines drawn instead of the clipped ones.

Screen Shot 2021-02-08 at 6 16 32 PM

My expectation would be that the clipping path is recognized/interpreted and the paths would look something like this.

Screen Shot 2021-02-08 at 6 16 48 PM
oskay commented 3 years ago

It is not possible at present without using external software to perform the clipping.

We recommend starting either with this SVG cropper for simple cases or vpype with the occult plugin.

This is a planned feature, with work underway for a future release.

pzich commented 3 years ago

Excellent! Any chance that future release will also support reversing paths ( #80 ) for greater optimization? 🙏

oskay commented 3 years ago

Yes, path reversing (and other major improvements to plot optimization) are underway as well.

Kenno9000 commented 3 years ago

If you are new at this and GitHub is not yet in your lexicon, try this online (full working )demo and it is an easy DL from Git to working on your desktop. https://mitxela.com/plotterfun/ Look for Circle of Doom or Square of Dom to graphically do what you are looking for.

jp92004 commented 1 year ago

It is not possible at present without using external software to perform the clipping.

We recommend starting either with this SVG cropper for simple cases or vpype with the occult plugin.

This is a planned feature, with work underway for a future release.

Just curious when you anticipate the clipPath feature coming. I've been looking for workarounds (trying to 'flatten' the clipPath) but without much success. Tried vpype with occult, but no joy. I'll keep trying though! I'm attaching a file to demonstrate what I'm hoping to do. Thanks! spart

oskay commented 1 year ago

Just curious when you anticipate the clipPath feature coming

Clipping paths in particular are planned after general path hiding. The general path hiding has been implemented upstream in dev versions for about two years now, but we've run into snag after snag in the packaging process, trying to ensure (1) that everything works (2) consistently (3) across platforms. It's been a lot of work, and I'm afraid that I cannot commit to a date.

I'll keep trying though! I'm attaching a file to demonstrate what I'm hoping to do. Thanks!

If I understand what I'm looking at, you just want to print the area inside the square? If so, you can actually the existing clipping feature at the edge of a document to achieve this. Set the document size to the print size that you want, and the AxiDraw software will automatically clip each path at those bounds.

jp92004 commented 1 year ago

Hey, thank you so much for the quick response Windell. You guys are kind of amazing in that way! I understand about hitting snags, you have a lot of platforms to cover. I'll hold tight for that. In the meantime I'll give that work around a whirl. Thank you!

oskay commented 1 year ago

Hidden-line removal is now available in AxiDraw 3.9: https://github.com/evil-mad/axidraw/releases/tag/v3.9.0

jp92004 commented 1 year ago

Hidden-line removal is now available in AxiDraw 3.9: https://github.com/evil-mad/axidraw/releases/tag/v3.9.0

Woohoo! Will check it out today. Thank you Windell!