gotcha

Author Topic: what's up with this file?  (Read 6730 times)

April 17, 2015, 03:12:33 AM
Read 6730 times

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hi Friends,
I don't know if this is going to be possible, to find out what's wrong with this file.  The problem is probably just something weird with this file, because I can't reproduce this problem in a new blank document.  If I paste these objects into a new file, I do get the same problem.  But still, I don't see how it could be a bug.

Ok, this file has 4 objects (2 black - sort of lace like objects, and 2 large solid rectangles, the same size as the page border.  If I select 1 black object and the large purple rectangle, then go Difference, and then Break Apart, normally, the large purple rectangle would be partially "consumed" in the Difference process.  But in this file, somehow, the large purple rectangle is re-created.

Before you start, tab through the objects, just to confirm there are only the 4 objects.  Then after you do the Difference and Break Apart, tab through again.  When I do that, the 2nd object found in the tabbing cycle is another large purple rectangle.  So I wonder what could be happening?

Maybe someone could help me figure this out?
Thanks for any comments  :D
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 17, 2015, 03:38:16 AM
Reply #1

Pilosopong Tasyo

  • IC Mentor

  • Offline
  • ******

  • 34
  • Gender
    Male

    Male
If I select 1 black object and the large purple rectangle, then go Difference, and then Break Apart, normally, the large purple rectangle would be partially "consumed" in the Difference process.  But in this file, somehow, the large purple rectangle is re-created.

Notice the purple rectangle.  It is slightly bigger than the entire pattern (the pattern is within the bounds of the rectangle), so performing a Path > Difference is no different to Path > Combine.  The pattern should be [slightly] bigger than the rectangle so it (the rectangle) gets 'consumed' by the pattern when doing Path > Difference.

April 17, 2015, 04:07:04 AM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Quote (selected)
The pattern should be [slightly] bigger than the rectangle so it (the rectangle) gets 'consumed' by the pattern when doing Path > Difference.

Oh....I was thinking the exact opposite!  Doesn't it make sense the the object you're subtracting from should be bigger?  Like in math?  If you subtract something that's bigger than the other one, you get a negative number. 

But I really don't understand this:

Quote (selected)
It is slightly bigger than the entire pattern (the pattern is within the bounds of the rectangle), so performing a Path > Difference is no different to Path > Combine.

These darn path operations trip me up every time!  I know that it might not work right with a design like the black object, the compound path.  But I've done it before, and it works like I want.  I just can't understand why it's like Combine.  Can you explain why?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 17, 2015, 06:05:20 AM
Reply #3

Pilosopong Tasyo

  • IC Mentor

  • Offline
  • ******

  • 34
  • Gender
    Male

    Male
Quote (selected)
I just can't understand why it's like Combine.  Can you explain why?

I made an example in the attached file.

In the example, the circle (which is analogous to the black pattern in your file) is inside the rectangle.  That's what I meant earlier when I said,

Quote (selected)
It is slightly bigger than the entire pattern (the pattern is within the bounds of the rectangle)

"It" = the rectangle.

Since the circle is smaller than the rectangle, all that Path > Difference did was actually make a hole in the rectangle, and as you see in the illustration, it's no different (in principle) when you use Path > Combine.

In order to actually remove something in the rectangle, the circle needs to be [slightly] bigger, overlapping the rectangle underneath so that performing Path > Difference will actually take away something from the rectangle.

Now, apply the same idea to your test file.

In hindsight, I should have been a tad clearer in the my previous reply: instead of just saying 'bigger' I should have also mentioned 'overlap.'

April 17, 2015, 06:12:15 AM
Reply #4

Pilosopong Tasyo

  • IC Mentor

  • Offline
  • ******

  • 34
  • Gender
    Male

    Male
Add:

Quote (selected)
Like in math?  If you subtract something that's bigger than the other one, you get a negative number.

Don't look at it in terms of mathematical operations.  You're dealing with [closed] shapes here, not numbers  :P  The result of Path > Difference is dictated by the z-order between shapes as well as what is overlapping between the shapes.

So, to sum it all up, there's nothing wrong or weird with your test file.  The result is what is to be expected under the circumstances.   :)

April 17, 2015, 09:09:56 PM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I tried it, and it does work if I make the rectangle a little smaller, so that it overlaps a little bit with the black object.  But I still don't understand exactly why that works.

I know that the path operations work on the areas, and not the paths.  But there's something I'm still not getting.

If I was using Cut Path, I know that I would need an overlap, because that one IS about the paths (rather than areas).

I see what you mean, in  your sample file, about Difference being like Combine.  But I'm still missing something.  Where does the extra purple rectangle come from?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 18, 2015, 02:55:17 AM
Reply #6

Pilosopong Tasyo

  • IC Mentor

  • Offline
  • ******

  • 34
  • Gender
    Male

    Male
Quote (selected)
But I'm still missing something.  Where does the extra purple rectangle come from?

The purple rectangle from your test file?  It's not an extra at all.  It's part of the compound object after performing Path > Difference.

Remember this [special?] rule of thumb: bigger shape behind smaller shape + no overlaps  between the two + Path > Difference operation = compound object with hole(s) and everything intact.

April 18, 2015, 05:18:28 AM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Quote (selected)
It's part of the compound object after performing Path > Difference.

If it was part of the compound path, it would have more than 4 nodes, wouldn't it?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 18, 2015, 07:39:15 AM
Reply #8

Pilosopong Tasyo

  • IC Mentor

  • Offline
  • ******

  • 34
  • Gender
    Male

    Male
Quote (selected)
If it was part of the compound path, it would have more than 4 nodes, wouldn't it?

Let's see, the test file is composed of 4 objects, in z-order they are (top to bottom): two black patterns (a and b), the purple rectangle (c), and the darkish cyan rectangle (d).  I moved one of the black patterns and the purple rectangle to the side (a and c) and performed Path > Difference.  The result is a compound object consisting of 3,001 nodes.  But looking at the number of nodes in the rectangular sub-path only, it (still) only consists of 4 nodes.


April 18, 2015, 08:43:42 AM
Reply #9

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oooohh, I see now.  When you just do Difference, it works like I expect.  The purple rectangle is partially "consumed" in the process.  But after you do Break Apart, the purple rectangle is back.

It comes from the outer shape.  This is when the rectangle is still larger than the black design.  So the result of the difference is a lot of small pieces in the middle, plus 1 big piece around the edge, which happens because the rect is larger.  It's made of the inner path and the outer rectangle.  But when you break apart, you get 2 pieces, and 1 is the large rectangle!

Now I understand.  Now I understand everything!

Well, thanks for taking the time to help me understand, PT.  Much appreciated  :D
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 18, 2015, 08:36:08 PM
Reply #10

Pilosopong Tasyo

  • IC Mentor

  • Offline
  • ******

  • 34
  • Gender
    Male

    Male
 :yay: Much welcome :D

Quite often I find myself switch display modes to outline view whenever I work with filled objects, as it helps seeing what's underneath, especially if a smaller object seem to "disappear."