Author Topic: Boolean Operations doesn't seem precise.  (Read 1632 times)

August 26, 2018, 08:19:46 AM
Read 1632 times

justusr846

  • Sr. Newbie

  • Offline
  • **

  • 5
Hey guys,

I'm trying to cut out a shape to be within a circle, but when zooming in after I perform the intersection operation between the objects I can see a slight deviation in the shape, it doesn't seem precise.


I'm using these two objects.
Objects.jpg
*Objects.jpg
(152.33 kB . 1920x1080)
(viewed 302 times)



I duplicate the circle and perform the intersection operation with the rectangle.
ObjectsIntersection.jpg
*ObjectsIntersection.jpg
(167.69 kB . 1920x1080)
(viewed 243 times)



I can see a slight deviation in the intersected shape (with the original circle) when I zoom in.
ResultZoomed.jpg
*ResultZoomed.jpg
(150.22 kB . 1920x1080)
(viewed 243 times)


How can I solve this?

My first guess is that this is the result of the way it's programmed and I have to suggest an improvement for the same to the developers. I just wanted to ask here before I did that...

Thanks for any replies in advance.  :)
  • 0.92.3
  • Windows 10

August 26, 2018, 12:12:39 PM
Reply #1

phiscribe

  • Jr. Member

  • Offline
  • ***

  • 43
Is the stroke set to zero width or no fill?  It's precise here.  Having a stroke though, would make it look like what your seeing.
  • Latest Stable
  • Win 8.1

August 26, 2018, 01:50:18 PM
Reply #2

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
None of the two shapes have a stroke (see second screenshot).

A certain amount of imprecision is normal, and it's due to the length of the numbers used for saving your document. You can change the precision in your preferences at Edit > Preferences > Input/Output > SVG Output: Numbers

August 26, 2018, 10:26:59 PM
Reply #3

justusr846

  • Sr. Newbie

  • Offline
  • **

  • 5
I tried setting the numeric precision to max from the settings, but it still gives the same result...
  • 0.92.3
  • Windows 10

August 27, 2018, 08:27:25 AM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oh no, I think there is a serious problem here.  See my attached SVG.  Notice how the descrepancy increases as you move from the centerline of the circle towards the left or right.

I'll be glad to report this, unless someone knows about it already being reported.  Or can explain it.

Steps to reproduce:

1 -- draw a circle
2 -- draw a small rectangle, and place over the edge of the circle, and along either vertical or horizontal centerline
3 -- duplicate the circle
4 -- select top circle and rectangle
5 -- Path menu > Intersection



  • 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                       

August 27, 2018, 08:32:23 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Interestingly, if the rectangle is wider than the circle, it seems to "cut" properly.  See screenshot.

Still testing....
  • 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                       

August 27, 2018, 08:43:28 AM
Reply #6

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ok, so the light green rectangle, which was wider than the circle does not show the problem around the bottom half of the circle.  But anything less than the width of the circle is not intersecting correctly.  I have not tested other operations yet, such as difference or cut path.

But the light green rectangle by coincidence extended slightly above the other midline - shown in this screenshot by my red guide.  See how it just veers inward there, instead of being aligned with the edge of the dark blue circle?

Edit
new SVG file, with other tests, attached
  • 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                       

August 27, 2018, 08:51:43 AM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Difference also shows poor result.

I have no idea with which version this started happening.  I would have to say 0.92.3, unless anyone else knows more?
  • 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                       

August 27, 2018, 02:45:07 PM
Reply #8

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
I think I had reported some issue with circles and boolops some time ago, but it was much worse than this... Don't know what became of it.

August 27, 2018, 03:14:41 PM
Reply #9

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Thanks.  I'll look for it before I report.  Maybe I can do that right now....

Edit

Hah!!  I didn't find yours, but I did find where I had reported this a few years ago!  At that time, I thought it was a problem with Difference.  Now it seems to be more focused on circles, and booleans in general.

Anyway, I added notes with the new info.  And new files.

https://bugs.launchpad.net/inkscape/+bug/1575127
« Last Edit: August 27, 2018, 04:22:52 PM by brynn »
  • 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                       

September 01, 2018, 05:53:38 PM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hey, after some discussion in the bug report, I've learned about a workaround for this!

Here's the short version.  After converting the circle to path, select one of the nodes.  Press the up arrow (on keyboard) then press down arrow.  (Or vice versa, or the left/right arrows - it doesn't even matter how you move the nodes, as long as you move one - it's just that using the arrows allows you to do it and end up with the nodes in the same place).

The longer version, in case jiggling only one node doesn't work.  With the circle selected, open the XML Editor.  On the right side of that window, click on the line which has "d" in the left column.  Somewhere in that line is either an "a" or and "A" (upper or lower case "a").  Or sometimes there might be more than one "a" or "A".  Now do the same node jiggling technique, one node after the last, until all the "a"s have changed to "c"s.

When I tried this, it completely fixed the problem.  Completely, even at 25600% zoom!
  • 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                       

September 01, 2018, 10:36:31 PM
Reply #11

justusr846

  • Sr. Newbie

  • Offline
  • **

  • 5
Hi,

I tried the workaround, but I'm still seeing the issue, albeit a bit differently. I had checked the XML to see if all the a's had turned to c's and it had...
BooleanIssue.jpg
*BooleanIssue.jpg
(164.71 kB . 1920x1080)
(viewed 184 times)



However, there was another issue I faced when intersecting two circles, i.e. the nodes formed at the intersection points not meeting in a straight line...
Circle Intersection Issue.jpg
*Circle Intersection Issue.jpg
(140.27 kB . 1920x1080)
(viewed 188 times)


And that seems to have been fixed with this workaround...

Was there anything you did differently to get the right result for the first one?

Edit: Sorry about the large image sizes...
  • 0.92.3
  • Windows 10

September 02, 2018, 05:12:45 AM
Reply #12

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Can you share the SVG file with an example where this technique does not fix it?  That way, we can be sure we're both looking at the same circumstances.  If you can't share that file, you could make up a sample file.

It looks like it might not be the same problem in your first example.  Because previously, the circle was not cutting enough (so to speak).  But in your last example, it looks like the circle cut too much  (assuming you had everything set up the same way, and used the same command).  So using the same SVG file would be better.
  • 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                       

September 02, 2018, 07:02:17 AM
Reply #13

justusr846

  • Sr. Newbie

  • Offline
  • **

  • 5
Okay, I tried to replicate the issue in the same document I had used earlier (one with several other elements), but now it seems fixed, just a slight hint of deviation that can barely be seen at max zoom.

Not sure what happened.

I would say the issue's been fixed.

But I do hope they make some improvement so the workaround needn't be used. I read the conversation at launchpad.net, and I was thinking what if all 'arc' related objects were converted to 'cubic bezier' elements as the first step while performing a Boolean operation. Maybe I'm over my head, but just something that popped into my mind.

  • 0.92.3
  • Windows 10

September 03, 2018, 06:53:37 AM
Reply #14

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
No worries.  That happens to me a lot, where I think I've found a problem, but when I try to replicate it, I can't.  So frustrating!

Well I know absolutely nothing about why the "a" or "A" is in there in the first place.  I wonder if it might have something to do with the handles on ellipses or circles, with which you can create arcs or wedges (because the developer who provided the comments and workaround referred to the "a"/"A" as "arcs").

I hope they can fix it too.  But one of the comments made in the bug report was that it appears to be buried deep in very old code (I would assume some of the original code which probably goes back to sodipodi, which is Inkscape's predecessor), which apparently makes it hard to fix.  So even with the long awaited version 1.0 finally on the horizon, it doesn't sound like developers see it as urgent.

That bug is ranked as Medium.  To me, it seems like it should be higher.  But I also know very little about how decisions are made about the ranking. 

  • 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                       

September 03, 2018, 07:28:08 AM
Reply #15

justusr846

  • Sr. Newbie

  • Offline
  • **

  • 5
I see...

Thanks for getting involved and solving the issue, Brynn.

Thanks to others who've suggested solutions as well.

 :ty1:
  • 0.92.3
  • Windows 10

September 03, 2018, 07:34:07 AM
Reply #16

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
You're welcome.

Happy Inkscaping!
  • 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