Shapes from moultiple paths intersections

Post questions on how to use or achieve an effect in Inkscape.
User avatar
nikto
Posts: 20
Joined: Sat Feb 06, 2016 8:27 am

Shapes from moultiple paths intersections

Postby nikto » Sat Feb 27, 2016 9:30 am

I'm sorry and ashame to bother you twice in such a short time, but ... Not even this time I can find a solution.
Is it possible to do in inkscape what I do in this video?
https://drive.google.com/file/d/0Bx_-tx ... sp=sharing
Paint Bucket is not what I'm looking for. It does not use the "paths", it uses the "edge of the stroke of the paths" ..... and in a very rough way.
(sorry for my english)
I need to get shapes whose edges correspond, mathematically not only visually, with the paths in which they are enclosed.
Thanks again...

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

Re: Shapes from moultiple paths intersections

Postby Moini » Sat Feb 27, 2016 11:39 am

Look into the boolean operations in the Path menu, @nikto. (Path -> Difference will probably the one you need)
They are not perfect, but good for most purposes.

Tutorials here: https://inkscape.org/en/learn/ (and in the submenu pages)
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)

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Shapes from moultiple paths intersections

Postby Espermaschine » Sat Feb 27, 2016 3:09 pm

1. Draw your lines with the Bezier Tool
2. Apply Boolean Operation 'Combine'
3. Draw a rectangle that covers your line construct
4. Select everything (make sure rectangle is at the bottom)
5. Apply Boolean Operation 'Division'
6. Delete outer garbage
7. Profit
8. (optional) Ode To Joy

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Shapes from moultiple paths intersections

Postby Polygon » Sat Feb 27, 2016 3:58 pm

@ Espermaschine.
Not sure you got it. Here are the essential steps in slow-motion:
Image

Cheers
P.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Shapes from moultiple paths intersections

Postby Espermaschine » Sat Feb 27, 2016 4:12 pm

.
Attachments
rect5483.png
rect5483.png (32.12 KiB) Viewed 2963 times

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Shapes from moultiple paths intersections

Postby Polygon » Sat Feb 27, 2016 4:29 pm

The result is not a rectangle. It´s clipping the excess by default - making a divided polygon.

Cheers
P.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Shapes from moultiple paths intersections

Postby brynn » Sat Feb 27, 2016 7:50 pm

Wish I could help, but the original video won't play for me ("an error occurred").

nikto, if your question is answered, don't bother. But if not answered, can you fix the video?

User avatar
nikto
Posts: 20
Joined: Sat Feb 06, 2016 8:27 am

Re: Shapes from moultiple paths intersections

Postby nikto » Sat Feb 27, 2016 9:37 pm

I really do not understand your solution Espermaschine. I don't think is the same thing.
I do not understand specially your rectangle, I want to obtain the shapes that remain occluded inside a web of lines, not inside a rectangle.
However I tried your method and after the division comand I got no shapes, only few broken lines, many path were lost....
Brynn I do not know why you can not see the video, others can see it ....
It is a video uploaded on my google drive ..
I can try to convert it to gif ..

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Shapes from moultiple paths intersections

Postby Espermaschine » Sat Feb 27, 2016 9:54 pm

Does this help ?
Attachments
Shapes from multiple paths intersections.svg
(30.47 KiB) Downloaded 168 times

User avatar
nikto
Posts: 20
Joined: Sat Feb 06, 2016 8:27 am

Re: Shapes from moultiple paths intersections

Postby nikto » Sun Feb 28, 2016 3:22 am

AAAAAAAAAAAAhhhh ok now I understand! Good to know! Thanks so much

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Shapes from moultiple paths intersections

Postby brynn » Sun Feb 28, 2016 3:30 am

I copied the lines from Polygon's image.

It's not an automatic way, but this is how I would do it. (A tool to do this might be under development currently. I saw a mention of it on the develpment mailing list recently, but I don't know the current status.)

Configure snapping as shown. This will allow the Pen/Bezier too to snap the node automatically to the intersection of the paths.
Then with Pen tool, click once in each corner.
When you come back to the first node, click inside the tiny square at the beginning of the path. That will close and end the path.

This technique does not use the existing lines. It creates new ones. It's really the best way I can think of. (To use a boolean, or path operation, you can only work with 2 paths at a time. And you'd have to duplicate them all first, since the path operations sort of "consume" the top path.)

shapes.png
shapes.png (29.97 KiB) Viewed 2899 times


Oh, it sounds like you got it working while I was typing. But just in case, I'll post this anyway.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Shapes from moultiple paths intersections

Postby Espermaschine » Sun Feb 28, 2016 3:43 am

brynn wrote:Configure snapping as shown. This will allow the Pen/Bezier too to snap the node automatically to the intersection of the paths.
Then with Pen tool, click once in each corner.
When you come back to the first node, click inside the tiny square at the beginning of the path. That will close and end the path.

Thanks to you i just discovered that you can snap to intersecting paths.

Still it somewhat boggles my mind that 'Combining' a bunch of straight paths, doesnt create nodes at the intersection. Its feel illogical, if that makes sense :D

User avatar
nikto
Posts: 20
Joined: Sat Feb 06, 2016 8:27 am

Re: Shapes from moultiple paths intersections

Postby nikto » Sun Feb 28, 2016 6:05 am

Thanks brynn, It is a useful method but only when paths are straight ...
What I need is to get the exact baundary inside a web of paths of every possible shape..
I put only straight lines in the example just to explain ... my fault ..
So..I wish there was a command or an extension for this operation but if not .. I think Espermaschine is suggesting the closest solution..

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Shapes from moultiple paths intersections

Postby brynn » Sun Feb 28, 2016 6:11 am

Yes, I agree.

If there were many more paths and intersections, I probably would have done the same thing.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Shapes from moultiple paths intersections

Postby druban » Sun Feb 28, 2016 2:20 pm

1. Select everything you want to create the paths from
2. Edit menu>create a bitmap copy
3. Path menu>trace bitmap
4. Path menu>break apart
5. While everything is selected change the fill and stroke to what you want... Note that the width of the original strokes will dictate the space between shapes. I used a 3px stroke for visibility but using a 0.5 stroke or smaller will make the shapes much closer.

rect5003.png
rect5003.png (162.53 KiB) Viewed 2824 times

Not as neat but very fast when you have many paths, some open, some closed...
Your mind is what you think it is.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Shapes from moultiple paths intersections

Postby Espermaschine » Sun Feb 28, 2016 4:45 pm

druban wrote:1. Select everything you want to create the paths from
2. Edit menu>create a bitmap copy
3. Path menu>trace bitmap
4. Path menu>break apart
5. While everything is selected change the fill and stroke to what you want... Note that the width of the original strokes will dictate the space between shapes. I used a 3px stroke for visibility but using a 0.5 stroke or smaller will make the shapes much closer.

Thats a clever trick !

What resolution do you use for the bitmap copy ?

User avatar
nikto
Posts: 20
Joined: Sat Feb 06, 2016 8:27 am

Re: Shapes from moultiple paths intersections

Postby nikto » Mon Feb 29, 2016 4:34 am

I'm sorry druban but you get the border lines of the path, it's not what I need.
I've done another video to explain:
https://drive.google.com/open?id=0Bx_-t ... UNCWEswRWc

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Shapes from moultiple paths intersections

Postby hulf2012 » Mon Feb 29, 2016 6:21 am

Hello
Boolean operations -> division is the most close you will have to what you show.
But as I see It will always generate extra shapes.

Espermachine provided an example when the rectangle borders intersect with the "open lines combined path ". If you use a rectangle which is bigger than the combined path, the border of the rectangle won't intersect, and execute the division, you will have an "outside shape", that you can erase, and the smaller shapes, that I understand is what you want. Maybe I'm not being clear. But please try first, and let us know your results.

There is always the possibility to request a new boolean operation for open lines. But It will take time to develop. Or perhaps even been approved.
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Shapes from moultiple paths intersections

Postby brynn » Mon Feb 29, 2016 6:45 am

hulf2012 wrote:There is always the possibility to request a new boolean operation for open lines. But It will take time to develop. Or perhaps even been approved.


Someone just posted on the development mailing list yesterday, who wants to develop this (and I think has started working on it, but is asking for help). He wants to make a certain collection of tools that will be helpful with drawing machine embroidery patterns/designs. (It will also probably be helpful for many other things, as well, imo.)

If you don't want to subscribe to the list, you can read the archives, which are still on Sourceforge (sorry I don't have a link but just sourceforge.org and browse to the Inkscape account, then click Mailing List > Archives).

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

Re: Shapes from moultiple paths intersections

Postby Moini » Mon Feb 29, 2016 6:46 am

I'm not following closely, so I apologize if this doesn't fit: Path -> Cut produces open lines (and cuts them, too).
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)

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Shapes from moultiple paths intersections

Postby druban » Mon Feb 29, 2016 7:25 pm

@espersmachine: I actually just used the default screen res 90 for this demo, although you can up that in prefs for very fine lines.
Your mind is what you think it is.


Return to “Help with using Inkscape”