Bug? Path Difference loses path segments

Post questions on how to use or achieve an effect in Inkscape.
chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Bug? Path Difference loses path segments

Postby chrisjj » Wed Feb 13, 2013 3:50 am

Anyone else finding that path Difference can erroneously lose path segments? E.g. here:

1 Load the attached - shows
Image
2 Press CTRL+A - this selectes two objects, a square with holes and a vertical EDIT: thin shape [was "rectangle"]
3 Press CTRL+- (or click Path, Difference)

Expected: all holes remain
Observed: holes to right of rectangle disappear:
Image

This on Inkscape V0.48, Win 7 Pro 64-bit.
Attachments
Difference erases right-side holes.svg
(42.42 KiB) Downloaded 185 times
Last edited by chrisjj on Fri Feb 15, 2013 8:52 am, edited 4 times in total.

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: Bug? Path Difference loses path segments

Postby flamingolady » Wed Feb 13, 2013 7:34 am

I don't think this is a glitch, at least from what you've said, the end result is correct. I'm not a good techincal prerson to explain this though.
Are you trying to make the background/black rectangle a different size? It would be helpful to understand what end result you are trying to obtain. For instance, if you are only trying to enlarge or reduce the black background, why not just move the nodes on the black rectangle?
It appears that the see through holes are in the black rectangle, so inkscape sees it as one object when you are applying the Path/difference.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Wed Feb 13, 2013 7:59 am

flamingolady wrote:I don't think this is a glitch, at least from what you've said, the end result is correct.


I don't see how it can be correct. The lost circles are way outside the area of the shape being subtracted. I suspect the logic of the subtraction of the two paths has failed.

flamingolady wrote:Are you trying to make the background/black rectangle a different size?


No. I am trying to cut the shape - see viewtopic.php?f=5&t=13525 . If you can suggest an alternative method, please do, in that thread. Thanks.

flamingolady wrote:It appears that the see through holes are in the black rectangle, so inkscape sees it as one object when you are applying the Path/difference.


That is as intended.

User avatar
sinsation
Posts: 24
Joined: Sun Aug 12, 2007 12:33 pm
Location: OlyWA
Contact:

Re: Bug? Path Difference loses path segments

Postby sinsation » Wed Feb 13, 2013 10:36 am

The only way I can get all of the holes to remain when using ctrl+- is to move the zero line over a bit so it's not overlapping that 5th column of circles, but sits between the 5th and 6th columns directly down the center of the square; however, this does not make any sort of cut or divide the square in two (still not quite sure what it is you're trying to do). All it apparently does is delete that zero line. I did notice that for some reason there's another line going down the center of the first column as well.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Wed Feb 13, 2013 10:44 am

sinsation wrote:The only way I can get all of the holes to remain when using ctrl+- is to move the zero line over a bit so it's not overlapping that 5th column of circles, but sits between the 5th and 6th columns directly down the center of the square; however, this does not make any sort of cut or divide the square in two


Same here :(

sinsation wrote:I did notice that for some reason there's another line going down the center of the first column as well.


That's a successful cut. I have no idea why it and three further cuts are successful but the fifth one triggers the bug. I wonder if some internal buffer limit has been hit.

User avatar
sinsation
Posts: 24
Joined: Sun Aug 12, 2007 12:33 pm
Location: OlyWA
Contact:

Re: Bug? Path Difference loses path segments

Postby sinsation » Wed Feb 13, 2013 11:08 am

Ok, let me know if this works for what you're trying to achieve. Use the node tool and select the top of your zero line and use alt+right arrow to create just a slight teeny gap, and do the same with the bottom of the line. Now use difference and see if that is a viable workaround. The attachment is shows just how small the gap will be. It was taken at a 25600% zoom.
Attachments
25600p.jpg
25600% zoom
25600p.jpg (24.4 KiB) Viewed 3864 times
Last edited by sinsation on Wed Feb 13, 2013 11:13 am, edited 1 time in total.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Wed Feb 13, 2013 11:12 am

Thanks, but a gap is not acceptable.

User avatar
sinsation
Posts: 24
Joined: Sun Aug 12, 2007 12:33 pm
Location: OlyWA
Contact:

Re: Bug? Path Difference loses path segments

Postby sinsation » Wed Feb 13, 2013 11:15 am

You know your 'successful' cut is a gap, right?

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: Bug? Path Difference loses path segments

Postby flamingolady » Wed Feb 13, 2013 12:30 pm

Are you trying to cut the holey black rectangle in half? Once we hear the expected outcome we can probably help you a bit more. Or, maybe I need to go check out that link you pointed to, will go follow that link now.


edit- In the meantime I went and further played with your rectangle deisgn. aha! I did 'break apart' and the rectangle is broken down into 2 pieces and the holes are another piece, (which you've combined), so inkscape reacts differently than you'd expect. You should do a union of all the pieces so that the rectangle is only 1 object, then do the path difference. Also, your nodes are all over the place, some on top of others. I would suggest that after you union the pieces that you do a simplify path, and then use the align tool to get them lined up better to make it easier to manipulate.

edit #2 - also found a line in the rectangle, just wanted to let people know since you can't actually see it, so they can move it out of the way. Assume it's what you are trying to cut the path with, it appears to be zero width.
Last edited by flamingolady on Wed Feb 13, 2013 2:02 pm, edited 1 time in total.

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

Re: Bug? Path Difference loses path segments

Postby druban » Wed Feb 13, 2013 1:55 pm

You
Last edited by druban on Wed May 29, 2013 11:43 pm, edited 1 time in total.
Your mind is what you think it is.

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

Re: Bug? Path Difference loses path segments

Postby hulf2012 » Wed Feb 13, 2013 2:40 pm

Hello...

Well, ... it's a bug, but a very hard to find.

Other idea for this edition: Use the Cut path operation.
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.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Thu Feb 14, 2013 1:10 pm

sinsation wrote:You know your 'successful' cut is a gap, right?

Yes. It is successful in the sense that it doesn't mess up the path.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Thu Feb 14, 2013 1:14 pm

hulf2012 wrote:but a very hard to find.


Not reproduced here :)

hulf2012 wrote:Other idea for this edition: Use the Cut path operation.


Thanks, but cutting the paths is no good. I need closed not open paths.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Thu Feb 14, 2013 1:17 pm

druban wrote:You probably know this - or have just figured it out - but "BOOLEANS ON OPEN PATHS DO NOT YIELD PREDICTABLE RESULTS.


I see no open paths in this instance.

druban wrote:A zero-width rectangle only compounds the problem


Can't see why. It simply means the result should have two coincident segments.

druban wrote:I think you can consider that a line segment for all boolean purposes....


Not at all. A line segment could not maintain closure. A rectangle can and does - regardless of width.

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

Re: Bug? Path Difference loses path segments

Postby brynn » Fri Feb 15, 2013 4:02 am

Well I hesitate to join this discussion, since so many people have already commented. I've actually posted and immediately deleted 2 replies :roll: . But I think this really needs to be said.

Inkscape can't do what you want....assuming I understand what it is that you want. You want to cut the black square with holes into 2 rectangles with holes, and without any space between them. It will look just like it looks now, except there will be 2 pieces. Is that it? You want to draw a line and have Inkscape divide the black square w/holes into 2 pieces along that line. Right? The only way to do that with Inkscape, is via node editing. (I'm not sure, but I would guess that CAD apps can do that.)

It's been a fairly frequently requested new feature (a razor tool). You could search it out at Launchpad, and add your support to the request, if you like. (You'd have to register at Launchpad, if you're not already.)

(All this discussion about a zero width rectangle Image. I don't see how a rectangle with 0 width could still be called a rectangle. Although I certainly would defer to druban when it comes to geometry. However, whatever he might say about it would really be moot, since the object in the file is a triangle!)

Edit
PS -- And just for the record, this behavior is NOT a bug :D

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

Re: Bug? Path Difference loses path segments

Postby druban » Fri Feb 15, 2013 4:16 am

[
Last edited by druban on Wed May 29, 2013 11:46 pm, edited 1 time in total.
Your mind is what you think it is.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Fri Feb 15, 2013 5:58 am

brynn wrote:But I think this really needs to be said.

Inkscape can't do what you want....


It was already said - in the root message. :)

brynn wrote:You want to cut the black square with holes into 2 rectangles with holes, and without any space between them. It will look just like it looks now, except there will be 2 pieces. Is that it? You want to draw a line and have Inkscape divide the black square w/holes into 2 pieces along that line. Right?


Right.

brynn wrote:The only way to do that with Inkscape, is via node editing.


Thanks for the suggestion.

brynn wrote:It's been a fairly frequently requested new feature (a razor tool). You could search it out at Launchpad, and add your support to the request, if you like.


I won't. A fix to the bug would meet my razoring requirement without need for a new tool.

brynn wrote:I don't see how a rectangle with 0 width could still be called a rectangle.


Here's how, Brynn:

Image

Since this term is good enough for Inkscape, its good enough for me.

brynn wrote:PS -- And just for the record, this behavior is NOT a bug :D


How so?

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

Re: Bug? Path Difference loses path segments

Postby druban » Fri Feb 15, 2013 7:08 am

[
Last edited by druban on Wed May 29, 2013 11:45 pm, edited 1 time in total.
Your mind is what you think it is.

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

Re: Bug? Path Difference loses path segments

Postby brynn » Fri Feb 15, 2013 7:13 am

Because most of the path operations (boolean) work on and/or with areas (where the fill goes). I know that it seems misleading to call them path operations....especially when you consider that most shapes can be used (without converting to path) as well. I asked this exact same question a couple of years ago. It's the area that the operations affect/effect. It might help to look at the examples in the manual (Help menu > Inkscape manual). (}

Edit -- At first I said "enclosed areas" but that's not correct. An open path can be used with the booleans, although I can't think of any way to use an open path's area.

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

Re: Bug? Path Difference loses path segments

Postby brynn » Fri Feb 15, 2013 7:16 am

druban, I noticed that too. But when I tried to change it to 0, it went back to 0.001. Apparently Inkscape won't allow a width of true 0....or at least that was my conclusion :-)

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Fri Feb 15, 2013 7:16 am

druban wrote:
chrisjj wrote:Can't help but notice that your rectangle has a width of 0.001.


Thanks Druban.

It was created with a width of zero:

Image

Reported undated/
Last edited by chrisjj on Fri Feb 15, 2013 7:26 am, edited 1 time in total.

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

Re: Bug? Path Difference loses path segments

Postby brynn » Fri Feb 15, 2013 7:22 am

chrisjj wrote:
druban wrote:
chrisjj wrote:Can't help but notice that your rectangle has a width of 0.001.


It was created with a width of zero:

Image


Interesting! The control bar won't accept an entry of 0.000.

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Fri Feb 15, 2013 7:24 am

brynn wrote:Because most of the path operations (boolean) work on and/or with areas (where the fill goes).


Interesting theory. But one not supported by the observed outcome - the disappearance of the right half of the shape.

brynn wrote:I know that it seems misleading to call them path operations....


I don't find that misleading at all.

brynn wrote:It's the area that the operations affect/effect. It might help to look at the examples in the manual (Help menu > Inkscape manual). (http://tavmjong.free.fr/INKSCAPE/MANUAL ... ining.html)


Path Operations
Inkscape has a number of commands to form new paths from two or more preexisting paths.


Seems clear to me.

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

Re: Bug? Path Difference loses path segments

Postby brynn » Fri Feb 15, 2013 7:39 am

And one more note relative to this discussion. The reason the holes disappeared in your very first example, has something to do with the 0 width rectangle/triangle (does everyone else 4 nodes? I only see 3).... Anyway, since that path crosses over several subpaths, Inkscape gets confused and can't do the correct calculations. Most of the path operations can only use 2 simple paths.

There are so many different scenarios for path operations, that I have a hard time keeping everything sorted out. In most cases, there can be only 2 simple paths involved. Intersection can work with more than 2 paths. But only in certain situations. When subpaths are involved, most of the time Inkscape can't perform the operation correctly. But somewhere in the back of my head, I think there's an exception to that.

Anyway, it's involving the subpaths that caused your Difference operation to go wrong. However, you were also trying to use it inappropriately. Once you understand about how the operations work on areas rather than paths, I think things will make a lot more sense. :D

Edit
Oops, you posted while I was typing. It's not a theory that the operations work on areas. I'm sorry that I don't have a technical explanation for you. But it's not a theory, it's a fact. Please read the manual for a more official explanation :D

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Bug? Path Difference loses path segments

Postby chrisjj » Fri Feb 15, 2013 8:51 am

brynn wrote:since the object in the file is a triangle!)


You're right, Brynn. It was a rectangle - see here - but the process of Save the SVG to post to the forum, and then Open, causes one of the nodes to disappear - see here.

Grrr...

Anyway, the number of nodes is immaterial - I have removed rectangle from the original report.

Thanks, Eagle Eye!


Return to “Help with using Inkscape”