axidraw icon indicating copy to clipboard operation
axidraw copied to clipboard

Clipping path support

Open pzich opened this issue 4 years ago • 9 comments

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

pzich avatar Feb 09 '21 02:02 pzich

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.

oskay avatar Feb 09 '21 02:02 oskay

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

pzich avatar Feb 09 '21 21:02 pzich

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

oskay avatar Feb 09 '21 22:02 oskay

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.

Kenno9000 avatar Feb 09 '21 23:02 Kenno9000

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

jp92004 avatar Dec 19 '22 21:12 jp92004

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.

oskay avatar Dec 19 '22 22:12 oskay

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!

jp92004 avatar Dec 19 '22 22:12 jp92004

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

oskay avatar May 25 '23 00:05 oskay

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!

jp92004 avatar May 25 '23 17:05 jp92004