Mobile app version of vmapp.org
Login or Join
LarsenBagley460

: (Inkscape) A shape made with path/difference produces a gap The picture I included illustrates the issue. The biggest problem is that the effect escalates: so if I had to add several shades,

@LarsenBagley460

Posted in: #Inkscape

The picture I included illustrates the issue. The biggest problem is that the effect escalates: so if I had to add several shades, the gap would become bigger and bigger each time I applied path/difference, and become visible even without zooming.
Is there a way to avoid it?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @LarsenBagley460

3 Comments

Sorted by latest first Latest Oldest Best

 

@Vandalay110

A brezier curve (that hasn't been formulated as rational) can not produce a circle. It can only produce an approximate circle. So when you take a circle primitive and turn it into a polybezier shape it will no longer align with a circle. Incidentally this is why CAD software tend to use NURB-Splines instead of beziers as that can make a circle shape (though not uniform parametrisation of a circle).

Why would this matter? Well, you can not cut a circle without turning it into a piece wise structure. And the easiest way is just to drop all to beziers.

Now if you start with a bezier approximation then there is nothing that stops the curves from aligning accurately. However most of the time calculating the inetersection fo 2 beziers is done iteratively. This may be inacurate, as the cutting may not exactly align with the real underlying bezier. In either case its better to cut BOTH sides so that you do not end with rounding problems.

But in fact doing this is a problematic for the rendering algorithm. As it will conflate the alpha as transparency and the underlying circle will show trough, Even if it was accurate.

Obviously you can circumvent this with clipping paths.

10% popularity Vote Up Vote Down


 

@Hamaas979

I agree with user287001 - this is what happens as a result of cutting up Bézier curves using boolean operations. Small errors are introduced in the resulting shapes, and they'll never match up exactly. It's a common problem, and not just in Inkscape.

I'll address one workaround, there may be others.

Use a clipping mask instead. Here I have three circles, the top one is distorted to form a clipping mask, and I've removed the fill and applied a stroke so you can see it. Select top coloured circle and your path to clip, and click Object > Set > Clip. The unclipped lighter circle is revealed underneath. Zooming in shows no gaps/overlaps.

10% popularity Vote Up Vote Down


 

@Sarah814

Exactly the same happens also in Illustrator. It must be how the paths are calculated, the calculation is an approximate. The effect is visible only with extremely high zoom. It becomes visible also if you use initially small shapes and scale them up.

I fixed the shape in Inkscape by dragging the cusp node with snap to path ON. Better way would be avoiding booleans for shapes that must fit, use clipping masks and covering the unwanted areas (see another answers where it is presented well).

You can also convert the circles to paths, align them and edit the topmost one with the node tool. If needed, insert guard nodes (=double click on path) that reduce the affected area. In the example the southern hemisphere is affected:



Some underhood knowledge is needed for curing the problem, not the symptoms. Hopefully a guru gets interested and shows to us something.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme