How to crop a group of lines

Post questions on how to use or achieve an effect in Inkscape.
peerke
Posts: 7
Joined: Sat Jan 09, 2016 10:37 pm

How to crop a group of lines

Postby peerke » Sat Jan 09, 2016 10:47 pm

Hi,

I am currently trying to draw a vent for a lasercut design. This vent should consist of multiple 45 degrees rotated lines in a rectangular area. Like

Screen Shot 2016-01-09 at 13.42.34.png
Screen Shot 2016-01-09 at 13.42.34.png (56.32 KiB) Viewed 1998 times


I can realize this using a clipping mask, but this does not actually crop the lines in the shape of a rectangle and therefore it is interpreted by the lasercutter as.

Screen Shot 2016-01-09 at 13.45.38.png
Screen Shot 2016-01-09 at 13.45.38.png (41.94 KiB) Viewed 1998 times


Is there a way to crop a group of lines so the lines are actually cut out as in the first image ?


Cheers,

Peter

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to crop a group of lines

Postby Lazur » Sat Jan 09, 2016 11:08 pm

Welcome aboard!


There is a way of drawing that, however you will need to draw those lines again.
With boolean operation intersection you can "crop" one closed path with another closed path.
Therefore you would need the original parallel lines as closed paths, enclosing some area.
For that, combining two neighboring lines and connecting the two nodes on top and the two at the bottom would do (resulting in a parallelogram shape).
After that by duplicating this closed path and positioning it right you can combine the paths together (Ctrl+K), and perform the intersection with the path you used for the clipping before.

To finish it you need to unconnect the nodes on the sides.


Only difference is every second path's direction will be reversed, put that might even be a positive change on the cutting time.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to crop a group of lines

Postby Moini » Sun Jan 10, 2016 12:00 am

Cut path works with a two open paths, and also with a path that consists of subpaths, so the connecting part could be skipped.
Just combine your 45° paths into one and use a path that has the shape you want as cutting path (put it above the other path in the stacking order) with Path -> Cut. Then remove the cut-off parts you do not need. They may be hard to see, just drag on them to find where the cut is.
(Or did I miss something...? Lazur's an expert on boolean operations, so it may well be...)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to crop a group of lines

Postby Lazur » Sun Jan 10, 2016 12:05 am

Hmm never really noticed/used that cut operation. Seems to work but you have to delete paths after, combine others.

peerke
Posts: 7
Joined: Sat Jan 09, 2016 10:37 pm

Re: How to crop a group of lines

Postby peerke » Sun Jan 10, 2016 1:53 am

Hmm tried moini's suggestion, probably do misinterpret his suggestion, no joy..
Sorry am a newbie on Inkscape..

Create the lines (using duplicate and move)
Joined the paths (Ctrl ++)
Draw an rectangle and position it over the lines
Select joined paths and the rectangle
Select Path > Cut (Ctrl + Alt + /)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to crop a group of lines

Postby Moini » Sun Jan 10, 2016 2:32 am

Better use Path -> Combine as suggested. I just tested with Union, and it really does not work as expected.

If nothing changed:
- Check the status line.

If the rectangle disappeared:
- Click on the part of the path that *should* be cut off. Can you drag it away with the mouse?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to crop a group of lines

Postby Lazur » Sun Jan 10, 2016 3:00 am

Ctrl++ would create a compound and closed path based on the encountered area.
Any two noded straight segment doesn't encounter an area, thus they won't appear in a union.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to crop a group of lines

Postby Moini » Sun Jan 10, 2016 3:55 am

(They do appear in the union for me, but I'm not sure how exactly the resulting path differs from the 'combine' result, and I'm too lazy to compare the svg markup and learn this by myself right now...)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

peerke
Posts: 7
Joined: Sat Jan 09, 2016 10:37 pm

Re: How to crop a group of lines

Postby peerke » Sun Jan 10, 2016 8:44 pm

Hi Lazur and Moini,

Thanks, it worked for me after changing the interface default language to english (default language was Dutch). This enabled me to made the correct Path options.

Cheers,
Peter

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to crop a group of lines

Postby Moini » Mon Jan 11, 2016 1:56 am

Yeah, it's not always easy to find things in a different language version (which prompted me to help with German translation...) ;)
Glad it worked for you now!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”