Division on multiple paths or alternative solutions

Post questions on how to use or achieve an effect in Inkscape.
tatagatha
Posts: 4
Joined: Wed Dec 24, 2014 9:23 am

Division on multiple paths or alternative solutions

Postby tatagatha » Wed Dec 24, 2014 10:56 am

Happy Holiday's All!

I'm new to drawing with vectors in general, and inkscape in particular. Please let me know if I'm using a term wrong.

I am trying to make large scale lattices on our CNC router. This is my test cut of a 10" x 10" piece. Eventually I want to be able to make arbitrary sizes.
Image

I think it looks pretty cool. I made an object and repeated it as cloned tiles. I covered the area I wanted with this pattern. Then I had to make the border. I got as far as masking/clipping but when I imported that SVG into the next part of my tool chain it was totally messed up. So in that next program, I painstakingly edited the nodes in each group to make the border. It was sort of a just get it done and see what it looks like mentality.

Now, I'd like to do it for real. I would prefer to do the border in Inkscape or programatically. Essentially what I would like to do is perform a division rather than a mask/clip on all the repeated objects (They can un-link for all I care at this point). Here is my little visual. The red rectangle in my "mask" layer is my imaginary border that I would like all intersecting paths to be divided by.
2014-12-23_1920.png
2014-12-23_1920.png (30.61 KiB) Viewed 2981 times

(insert your magic here)
2014-12-23_1921.png
2014-12-23_1921.png (14.48 KiB) Viewed 2981 times


Unfortunately after reading this post, I suspect it is not possible. http://www.inkscapeforum.com/viewtopic.php?f=5&t=10419
I could do this one by one "by hand" fast enough (select two paths and hit a key shortcut x 1000) but the mask disappears. Having to reconstruct the masking rectangle every time is the problem.

The way I got to my resulting image was that I selected all the groups (repeating groups & mask rectangle) and performed an exclusion. Then I selected all the nodes in the single resulting group and "break path on selected nodes". Then I could delete all the errant lines I didn't want, but now I had one big path. This can be problematic for the next part of my toolchain. I want to still have individual paths. This may be my solution in the end....

I considered writing an extension, but those stream the svg in and out rather than let me script the interface.

Has anyone figured out a way to do this? Is the razor request making it into .91 whenever that comes out?

Any suggestions would be much appreciated.

- Marc

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

Re: Division on multiple paths or alternative solutions

Postby Lazur » Wed Dec 24, 2014 11:46 am

Hi.

Maybe this can make the magic trick:

Select all paths (Ctrl+A),
deselect bordering path (Shift+Click),
combine objects together (Ctrl+K),
select border path (invert selection by "!") and duplicate (Ctrl+D),
add compound path to selection (Shift+Click),
perform intersection (Ctrl+*).

After that, with the node tool
rectangle select all the nodes falling on the border path, and click the split node icon at the toolbar;
break apart the path (Ctrl+Shift+K).
Rectangle select the unnecessary paths of the border, and delete them.


Good luck!

tatagatha
Posts: 4
Joined: Wed Dec 24, 2014 9:23 am

Re: Division on multiple paths or alternative solutions

Postby tatagatha » Wed Dec 24, 2014 1:52 pm

Hey! :o

That really did the trick! Thanks for stepping me through that. I'm not sure I could have figured out that sequence. I'm just not experienced enough with vectors.

My next task was to join those open path's back into closed paths.
2014-12-23_2203.png
2014-12-23_2203.png (9.13 KiB) Viewed 2956 times


This is what I came up with and there is part I don't understand:

Starting from the end of the Lazur's steps
Select the node edit tool (F2) and select all (Ctrl-A). This puts a grey indicator on all the nodes.
Then select all again (Ctrl-A). This puts dark blue selectors on all the nodes.*
Now select the join selected nodes icon.

* So this is the step I don't understand. What am I selecting the second time, that I'm not selecting the first?

tatagatha
Posts: 4
Joined: Wed Dec 24, 2014 9:23 am

Re: Division on multiple paths or alternative solutions

Postby tatagatha » Wed Dec 24, 2014 1:53 pm

I just realized why you select twice. The first time is to select all the objects. The second time we are selecting all the nodes in the all the selected objects.

Thanks again for all your help.

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

Re: Division on multiple paths or alternative solutions

Postby Lazur » Wed Dec 24, 2014 2:14 pm

Joining back to closed ones?
Closed paths cannot have nodes that are not connected with exactly 2 other ones.

Thought it was the task to remove the double segments from the paths at the borders.

So you need the large square made out of segments made after the intersections?
Can be done similarly.


First, select all the objects and combine them together (Ctrl+K),
add a fill and no stroke, and set even-odd fill rule in the fill and stroke panel (Shift+Ctrl+F).
Then, adjust subpath directions -select all subpath segments/nodes to do that and click the option in the path menu; probably it's the square's direction that would need adjustment.
The path should appear "hollow".
Press ctrl++, and follow the second half from the previously suggested method -node splitting, breaking apart and deleting objects.


Well I'm just guessing, not sure how you make it happen from svg to 3D, only know how blender can do that.

tatagatha
Posts: 4
Joined: Wed Dec 24, 2014 9:23 am

Re: Division on multiple paths or alternative solutions

Postby tatagatha » Wed Dec 24, 2014 2:52 pm

This might just be a terminology issue. When I say "closed" i might not be using it technically correct. I mean that the part of the shapes on the inside the masking square is joined with the defining edge of the masking square to make a complete new shape rather than two different pieces.

I make the 3D part (bevelled edge) with carving head and some smart tool path generating software. The hollow is just a straight cut out but it is made on a different path than my beveled edge. My experiment here only really has the outer edge piece. To make the inside, I select all duplicate and then inset that copy.

I wasn't quite able to follow this second set of instructions, but either way I'm really excited to have the original approach. It will save me many hours pulling my hair out and individually manipulating the edges.

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

Re: Division on multiple paths or alternative solutions

Postby Lazur » Thu Dec 25, 2014 10:00 am

To organise objects you can combine all paths together (Ctrl+K)
or put them inside a group (Ctrl+G) -after they are selected.

Insetting and dynamic offsetting in inkscape produces closed paths, and there are large errors in it when the offsetting is getting closer to the path's radius. If it was for such geometric design I would suggest to construct those curves separately.

From the beveled look first I thought it was meant to have a 3D source file, just as for 3D printing. It is way less complicated then.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Division on multiple paths or alternative solutions

Postby tylerdurden » Thu Dec 25, 2014 12:34 pm

Ja, the first proposition, seems simple enough...
Attachments
Magic1-ss.jpg
Magic1-ss.jpg (71.04 KiB) Viewed 2890 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/


Return to “Help with using Inkscape”