Boolean operations. Intersection

General discussions about Inkscape.
SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Boolean operations. Intersection

Postby SUMATORIO » Mon Apr 11, 2016 8:39 pm

Hi there:

I'm trying to make a pattern with an ornament (damask) that's a path. I make a square (100x100px) converted to a path and put in a coordinates easily to remember. Then I place in the center of the square the ornament, and place a copy in each corner(50px left, up, down, right) . Then combine the five ornaments in a path combined with Ctrl+K.

I lift the square at top. I make the operation "intersection" between the ornaments combined and the square (path) and the result it's selected with a dimensions wrong, bigger than the square. If you export the intersection (path) in the window "Export to an image", the result it's bad selected by default and you must correct the selection area. It's that because I've put the square in a coordinates easily to remember. In my case I've put the square in the coordinates x=100px and y=500px. The result it's selected a square (with the intersection) bigger than the original and you must correct the coordinates of the selection in the window of export, and as I set a definite coordinate I can introduce correctly the dimension of the result.
But if you want to use it for made a mosaic the intersection it's bad result, there is a stripe around the intersection result's.

I'm trying to enclose the svg file but a message say it's too large. I attache two files:
intersection 2.png
intersection 2.png (183.28 KiB) Viewed 5582 times
and
intersection.png
intersection.png (176.35 KiB) Viewed 5582 times
Intersection.png it's corrected manually and intersection2.png it's like it's selected after operation intersection. The dimensions are differents.

I've made a video with an other example here: https://youtu.be/RZs1Mb9UEjY?t=4m49s. In this case I've exported to an image. In other video I made the same but I use the pattern create directly to use in a mosaic directly o set as a pattern. You can do it with a whatever ornament and the result it's wrong selected.
If I don't set the coordinates of the square and remember the coordinates it's difficult to export the area correctly.

Regards.

Fernando

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

Re: Boolean operations. Intersection

Postby Espermaschine » Mon Apr 11, 2016 9:32 pm

I dont know why the bounding box of your pattern is bigger than the object. Maybe theres a hidden object in the group ? Or a filter ?

But setting up your tile with split patterns has the problem that it will produce rendering gaps.

So i was thinking if the pattern could just be tiled in a different way.

Set up your pattern with a helper object. Remove one object and helper object. Group. Then tile.
Attachments
Pattern tiling.jpg
Pattern tiling.jpg (113.39 KiB) Viewed 5576 times

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

Re: Boolean operations. Intersection

Postby brynn » Mon Apr 11, 2016 10:17 pm

You could upload the SVG file somewhere else, and give us the link. I don't clearly understand what the problem is. But maybe if I saw the SVG file, I could understand. I tried watching the video, but don't understand Spanish.

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Tue Apr 12, 2016 1:04 am

Hi:
I send you the link to file:https://www.dropbox.com/s/a3q233tkgj19e3e/patterns-shop_damask_seamless_pattern_tutorial.svg?dl=0

It's at the situation before making the operation Intersection. The original it's aside without any bound.

If you execute the operation there is a bound around the object.

Thanks.

Fernando

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

Re: Boolean operations. Intersection

Postby Espermaschine » Tue Apr 12, 2016 1:36 am

.
Attachments
damask.jpg
damask.jpg (40.49 KiB) Viewed 5546 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Boolean operations. Intersection

Postby Lazur » Tue Apr 12, 2016 1:56 am

In general Boolean operations cannot be exact by the nature of Bézier paths.

If you want to have a tile the exact size EXPORTED, then you could just set an appropriate export area -like set page borders around the selected rectangle you had used for the intersection (Shift+Ctrl+D).
There is not even a need for using clipping, which could also work and keep things clean looking in your svg.


Edit: 45925 nodes for one path?
Probably it could be done without adding the repeating parts together...

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

Re: Boolean operations. Intersection

Postby brynn » Tue Apr 12, 2016 2:13 am

Ok, I understand better now. But Espermaschine found the problem already. Somehow, there are a lot of extra nodes that did not behave properly.

This sometimes happens when you have an object that is so intricate and has so many nodes. You can delete those stray nodes. Or I would probably try Clipping, instead. Although that will probably have a similar result, where the edge of the object is far outside the visible edge.

However, there is a known problem with tiling patterns. Even if the tiles are lined up side by side with no space between, you can still see a very thin gap. Here's the FAQ item about different ways to handle it.

Hhmm....does it work to deselect antialiasing in Document Properties (bottom of Page tab)? Does that get rid of the gap? I'm not sure....

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Tue Apr 12, 2016 8:14 pm

There are two problems.
The first is the area selected after intersection operation it's wrong, that if it's for export as an image, no problem, you correct the area of selection.
The other problem it's a bound around the intersection result. The intersection it's wrong executed. There aren't any extra nodes outside the ornament as you can check . Outside of the square there shouldn't be any node after operation intersection on the contrary it's no intersection.

Espermachine said that it's posible to be hidden objects but I check it with the display mode contour and there isn't anything, but it doesn't matter, the operation of intersection it's about the common objects to the boths paths (the combine paths and the square) if not it's no a intersection.
I've made the same exercise with other ornaments (objects) and the intersection it's right executed but the selection for export image it's wrong but this is a minor problem. The problem it's the intersection. The result after intersection, in the case I showed I can't use it for a tile o a pattern for example.
I think.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Boolean operations. Intersection

Postby tylerdurden » Tue Apr 12, 2016 8:53 pm

Something wrong with the document, I haven't examined it yet.

But, copy paste the two objects into a new document seems to resolve the issue here.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

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

Re: Boolean operations. Intersection

Postby brynn » Wed Apr 13, 2016 10:06 am

Yes, you're right. There shouldn't be anything outside the intersection area. But sometimes when it's a very intricate path like that, and with so many nodes, the path operations (booleans) do not work properly.

I hope tyler's suggestion helps :D

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

Re: Boolean operations. Intersection

Postby Uktrunie » Wed Apr 13, 2016 11:12 am

tylerdurden wrote:Something wrong with the document, I haven't examined it yet.

But, copy paste the two objects into a new document seems to resolve the issue here.


Copying in the same document works as well.

Looking at the XML, the "d" tag for the two paths (original and copy) are different. So me bet is that there's a bug somewhere that is exposed by some of the commands on that tag on the path.

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Thu Apr 14, 2016 1:43 am

tylerdurden wrote:Something wrong with the document, I haven't examined it yet.

But, copy paste the two objects into a new document seems to resolve the issue here.



I don't understand what do you mean with the result after copy paste.
In this case you can align the box of outline of the file intersection with the border of the ornament of the intersection2 (with the bound) not with the box of outline (¡¡¡ ?), but you can't made a tile.
I've tried it and the result it's wrong.

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

Re: Boolean operations. Intersection

Postby Espermaschine » Thu Apr 14, 2016 1:50 am

I still dont understand why the original poster wants to make this a pattern with the four quarters at the corners.

Is it because you want to use the pattern as a svg ?
Because if you dont then working with the full pattern and tiling it as i showed above would be a much better solution.
Especially because of the rendering gaps.

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

Re: Boolean operations. Intersection

Postby brynn » Thu Apr 14, 2016 1:52 am

I'm not sure, but I think he meant to copy the 2 selections (the pattern object and the rectangle) into a new file. (Or according to Uktrunie, paste into the same document.) And then perform the Intersection after copy/paste.

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Thu Apr 14, 2016 2:55 am

Uktrunie wrote:
tylerdurden wrote:Something wrong with the document, I haven't examined it yet.

But, copy paste the two objects into a new document seems to resolve the issue here.


Copying in the same document works as well.

Looking at the XML, the "d" tag for the two paths (original and copy) are different. So me bet is that there's a bug somewhere that is exposed by some of the commands on that tag on the path.


Ok.

I tried to copy paste at the same document before to do a new Intersection operation's and work wright.
And this case the explanation that some of cases of Beziers paths are complex, it's not coherent.
It's a bug?

Thanks for your point of view.

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Thu Apr 14, 2016 3:23 am

Espermaschine wrote:I still dont understand why the original poster wants to make this a pattern with the four quarters at the corners.

Is it because you want to use the pattern as a svg ?
Because if you dont then working with the full pattern and tiling it as i showed above would be a much better solution.
Especially because of the rendering gaps.




Your solution it's an option, but I like to set the object in a exact place where I want.
Tiling tool don't permit to place with measures, only percentages. And shift by rows for instance combined with alternate besides with shift in column it's for me a problem.

I like in many cases to do tiles with a pattern like the example I begin with the debate. Then use the pattern with the tiling tool or a pattern to use in objects (property-> pattern).

I'l try to do the example as Tavmjon Manual's, a set of 3x3 squares clones of the original tile grouped.

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

Re: Boolean operations. Intersection

Postby Espermaschine » Thu Apr 14, 2016 3:37 am

SUMATORIO wrote:Tiling tool don't permit to place with measures, only percentages. And shift by rows for instance combined with alternate besides with shift in column it's for me a problem.

I agree, thats a negative.
To me the rendering gaps are the bigger problem.
.
Attachments
TheGaps.png
TheGaps.png (73.51 KiB) Viewed 5398 times
Gaps_Problem.png
Gaps_Problem.png (10.08 KiB) Viewed 5407 times

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Thu Apr 14, 2016 6:17 am

SUMATORIO wrote:
Uktrunie wrote:
tylerdurden wrote:Something wrong with the document, I haven't examined it yet.

But, copy paste the two objects into a new document seems to resolve the issue here.


Copying in the same document works as well.

Looking at the XML, the "d" tag for the two paths (original and copy) are different. So me bet is that there's a bug somewhere that is exposed by some of the commands on that tag on the path.


Ok.

I tried to copy paste at the same document before to do a new Intersection operation's and work wright.
And this case the explanation that some of cases of Beziers paths are complex, it's not coherent.
It's a bug?

Thanks for your point of view.


I've done a new attempt, with copy paste and the result it's wrong and the bounds they aren't uniform around the object, only above and the right side in this case, but new attempt the bound its different and asymmetric.

I've edited the result and I've realized that there are a few nodes that not exist in the original, they are added after Intersection operation's. Espermachine show an image with extra nodes.
I've erased those nodes and the pattern it's in this case correct. It's a partial solution. I attache the file.

pattern.jpg
pattern.jpg (61.47 KiB) Viewed 5380 times

Then I use it to do Tile clones. The file it's too large to upload in this forum, it's here ->
https://www.dropbox.com/s/lviarwjida1jogi/tile.png?dl=0
There are any gaps specially with this example, such a complex ornament (damask), the mach it's perfect.

I use Inkscape 0.91. You must choose the option Box of outline geometric in the preferences>tools window's
The "secret", as I do, it's to manage the exact measures. I do the tile with a pattern.

For the do the pattern, I do one square in a place easily to remember, for instance a square 100x100 px at x=100px and y=600px. Then I place the copies of the object. An object that cut a side of the square it must be have a copy at the opposite side (the amount of the shift, it's the measure of the side, in this example100px). In the example I do a duplicate and shift 50px right and 50px up. From this place you must do copies and shift to the others corners. In this case all objects are symmetrics respect to the original object, but it's posible to without simmetry. After all the copies of the object are placed, then I combine them in a only path. Finally I do the Intersection operation's between the path combined and the square ( it's no need to convert to a path in the case of the square). The result its the pattern as you know.

With the pattern you can change the size if you want, and then you can do tile clones and the match it's perfect.

I still think, in my opinion, the problem the intersection operation's,at least in this case, it's a bug.

(Sorry for my poor English).
Last edited by SUMATORIO on Thu Apr 14, 2016 5:38 pm, edited 1 time in total.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Boolean operations. Intersection

Postby Lazur » Thu Apr 14, 2016 6:19 am

In that given example you could put two of the same pattern fill over each and avoid any rendering gaps.
What if one of those object is a clone of the other?
That means the shifting would show at the edges.
Then again adding clipping to the two grouped together?
Or use a clone for the clipping of a rectangle as well so that you can change the pattern filled area just asi if it was a single pattern fill, what do you think?

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

Re: Boolean operations. Intersection

Postby Espermaschine » Thu Apr 14, 2016 6:40 am

Lazur URH wrote:What if one of those object is a clone of the other?
That means the shifting would show at the edges.
Then again adding clipping to the two grouped together?
Or use a clone for the clipping of a rectangle as well so that you can change the pattern filled area just asi if it was a single pattern fill, what do you think?

I dont get it.

I do get the first part. Duplicating the tiling gets rid of the gaps. What does the second part mean ?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Boolean operations. Intersection

Postby Lazur » Thu Apr 14, 2016 7:04 am

Cloning, grouping, layers, patterns and what not involved in this svg.

Guess it would look horrible once saved as pdf and opened after in inkscape...

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

Re: Boolean operations. Intersection

Postby Espermaschine » Thu Apr 14, 2016 7:15 am

Lazur URH wrote:Cloning, grouping, layers, patterns and what not involved in this svg.

Guess it would look horrible once saved as pdf and opened after in inkscape...

Still not clearer.

Just to learn the lesson:
if i tile a pattern (like i did in the image i posted to illustrate the gaps) with tiled clones, and then duplicate (the group made of a path and clones), that gets rid of the rendering gaps ?

It seems to work....
.
Attachments
g5251.png
g5251.png (29.94 KiB) Viewed 5353 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Boolean operations. Intersection

Postby Lazur » Thu Apr 14, 2016 7:24 am

Duplicating is mentioned as a "workaround" at some places but I wouldn't consider that as a solution. It's like gamma correcting the alpha channel of the anti-aliased edges. The more you can fill up the gaps this way, the more aliased the edges will become.
By switching off anti-aliasing, it could be "solved" too.

SUMATORIO
Posts: 33
Joined: Sat Jun 22, 2013 12:51 am

Re: Boolean operations. Intersection

Postby SUMATORIO » Thu Apr 14, 2016 8:37 am

I don't understand what do you mean with two pattern fill over each. I want to think that you use other object to cover the gaps with clipping,
I don't use clipping with two objects. It's different clipping to intersection. If you place in exact place the copy de objects shifted the matched it's perfect.

It's true that with other objects more simple, not happend the wrong intersection.
With this pattern:
patron.png
patron.png (101.87 KiB) Viewed 5328 times


In this example the gaps are imperceptible.
tile example.jpg
tile example.jpg (138.94 KiB) Viewed 5328 times
.

Sorry I don't understand what you suggest.

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

Re: Boolean operations. Intersection

Postby Espermaschine » Thu Apr 14, 2016 9:11 am

^
looks good !


Return to “General Discussions”