When drawing layered structures you have basically two options:
- additive structures
- subtractive structures
or in words of microtechnology: you either deposit or etch away material
or in words of paper & scissors: paste or cut
or in words of Inkscape: the boolean operations "Path Union" or "Path Difference"
Here comes the problem:
If I need the drawing to be exported e.g. as DXF I need one path, i.e. one outline.
And in order to carry out the boolean operation ("Difference") I need exactly two objects.
This means that I am forced to unify all the objects before I want to "etch/cut" them away.
However, once all these hundreds or thousands of objects, groups, clones, etc. are unified in a single path I cannot edit them anymore as individual object, let alone all the clones. So, if I want to do any little change in one of the original objects I have to start over again.
How I do it currently:
1) In many different "sketch" layers, I draw all the individual objects which I want to paste or cut.
2) I duplicate those objects and move them to special intermediate layers, e.g. "Paste" and "Cut"
3) In each of the "Paste" and "Cut" layer, I have unify all objects by ungrouping, unlinking clones, converting into path, etc.
4) I duplicate the "Cut" layer path and move it to the "Paste" layer.
5) There I use "Difference" between the "Paste" and "Cut" paths
6) Then I can export this layer as path to DXF
7) If I need to change anything in the original layers I have to start over with this procedure.
This is pretty time consuming and prone to mistakes.
The questions:
Does anybody know whether there is a simpler and smarter way to do that?
Can layers be defined as additive and others as subtractive and be merged (paste & cut) all in one layer automatically or maybe by a few mouse clicks?
Or could be "Difference" implemented differently: e.g. if several paths are selected all other paths are subtracted from the first selected or the bottom one?
Boolean operations on layers?
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Boolean operations on layers?
Not sure what you want to achieve.
Below, 9 clones inside a rectangle. No stroke or fill. Viewed in outline mode.
Exported as polyline DXF. Imported to CAD and extruded.
Cloned path can still be edited, clones update.
Below, 9 clones inside a rectangle. No stroke or fill. Viewed in outline mode.
Exported as polyline DXF. Imported to CAD and extruded.
Cloned path can still be edited, clones update.
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/
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/
Re: Boolean operations on layers?
Thanks, tylerdurden.
Maybe it was not completely clear.
As a simple example I have the red and the blue patterns. Red(+) should be additive and Blue(-) should be subtractive.
The final result should look like the green one.
And the DXF should look like the black/white image (scroll down).
And as far as I know, only get this output if I add and subtract the different paths.
The issues are:
1) you can only do "Difference" with exactly two objects, as a consequence you have to "union" all your subtractive (here blue) objects.
However, I have not found a way to unify clones.
You get the message: "One of the objects is not a path, cannot perform boolean operation"
So, you first have to delink the clones. Then the nice feature of editing the original and all other clones will change is gone.
2) Furthermore I have not succeded to subtract clones or groups.
You get the message: "One of the objects is not a path, cannot perform boolean operation"
Well, yes and no, it's a group of paths.
I used the "Save a copy as" + Desktop Cutting Plotter (AutoCAD DXF R14) (.dxf)
Or do you have an special way to export to DXF?
Maybe it was not completely clear.
As a simple example I have the red and the blue patterns. Red(+) should be additive and Blue(-) should be subtractive.
The final result should look like the green one.
And the DXF should look like the black/white image (scroll down).
And as far as I know, only get this output if I add and subtract the different paths.
The issues are:
1) you can only do "Difference" with exactly two objects, as a consequence you have to "union" all your subtractive (here blue) objects.
However, I have not found a way to unify clones.
You get the message: "One of the objects is not a path, cannot perform boolean operation"
So, you first have to delink the clones. Then the nice feature of editing the original and all other clones will change is gone.
2) Furthermore I have not succeded to subtract clones or groups.
You get the message: "One of the objects is not a path, cannot perform boolean operation"
Well, yes and no, it's a group of paths.
I used the "Save a copy as" + Desktop Cutting Plotter (AutoCAD DXF R14) (.dxf)
Or do you have an special way to export to DXF?
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Boolean operations on layers?
Sorry to state the obvious, but why not perform the boolean on the original and clone the result?... that is, if all the clones are to be identical...?
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/
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/
Re: Boolean operations on layers?
that's exactly the point...
In some layers there are clones which are tiled in one way and in other layers there are other clones which are tiled in another way. And those should be combined additively and subtractively. None of the resulting paths is identical. I am not talking about making one original and simply clone it...
In some layers there are clones which are tiled in one way and in other layers there are other clones which are tiled in another way. And those should be combined additively and subtractively. None of the resulting paths is identical. I am not talking about making one original and simply clone it...
Win7/64, Inkscape 0.92.2
Re: Boolean operations on layers?
Maybe some more simple examples help to illustrate what I am searching for...
First row: The left black square is cloned to the right as it is the left yellow circle but with a different shift.
Second row: If you want to have the difference of black and yellow...
How would you realize this?
I currently do not see how this can be done without unlinking the clones. Do you?
Third row: If you later may need to modify the yellow circle to an ellipse you have to start over again (unlinking clones, eventually ungroping, duplicating, etc.).
That's why I am searching for a way to subtract one layer from another (not just single objects from other single objects).
And another example:
The vertically grouped black numbers in the first column are horizontally cloned.
So are the horizontally grouped red numbers are cloned vertically.
The blue squares are created with tiled clones with a different spacing than the numbers.
How do you subtract the numbers from the blue background? (As shown on the right)
Just putting white numbers on the blue background is not the same as subtracting them from the background.
Altough visually it is the same, but I assume this is not the same in DXF. But correct me if I am wrong.
First row: The left black square is cloned to the right as it is the left yellow circle but with a different shift.
Second row: If you want to have the difference of black and yellow...
How would you realize this?
I currently do not see how this can be done without unlinking the clones. Do you?
Third row: If you later may need to modify the yellow circle to an ellipse you have to start over again (unlinking clones, eventually ungroping, duplicating, etc.).
That's why I am searching for a way to subtract one layer from another (not just single objects from other single objects).
And another example:
The vertically grouped black numbers in the first column are horizontally cloned.
So are the horizontally grouped red numbers are cloned vertically.
The blue squares are created with tiled clones with a different spacing than the numbers.
How do you subtract the numbers from the blue background? (As shown on the right)
Just putting white numbers on the blue background is not the same as subtracting them from the background.
Altough visually it is the same, but I assume this is not the same in DXF. But correct me if I am wrong.
Win7/64, Inkscape 0.92.2
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Boolean operations on layers?
Howdy,
In the case of the numbers on background, it might not matter provided the number shapes are completely surrounded by the rectangle. 2D DXF is just lines.
Thanks for the clarity on the boolean issue. I believe I understand now.
It might be helpful to consider directly manipulating the XML with the editor in Inkscape, a unix/text editor, or a text editor in conjunction with a spreadsheet program. (I had a project recently where position and color were manipulated within a spreadsheet and results pasted into the svg XML document. This involved thousands of objects.)
In essence, a template with fixed position information where just the shape data gets changed. The unlink and boolean operations would still be done in Inkscape, but the tiling, copying and pasting operations might be eliminated.
Hope this helps...
In the case of the numbers on background, it might not matter provided the number shapes are completely surrounded by the rectangle. 2D DXF is just lines.
Thanks for the clarity on the boolean issue. I believe I understand now.
It might be helpful to consider directly manipulating the XML with the editor in Inkscape, a unix/text editor, or a text editor in conjunction with a spreadsheet program. (I had a project recently where position and color were manipulated within a spreadsheet and results pasted into the svg XML document. This involved thousands of objects.)
In essence, a template with fixed position information where just the shape data gets changed. The unlink and boolean operations would still be done in Inkscape, but the tiling, copying and pasting operations might be eliminated.
Hope this helps...
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/
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/
Re: Boolean operations on layers?
Thanks again.
OK, if DXF does not care as long as the pattern completely surrounded. Let's hope that the 3D-CAD or the lithomask program interprets it right.
Ah, I haven't paid attention to the XML Editor. For parsing and modifying the XML File, wouldn't be Perl a good choice? I only know a little Perl.
Apropos script... aren't the extentions written in Python?
I need to check wether there is a good tutorial about writing your own extensions.
If I had the knowledge and time I would then implement a "Layer-Add&Subtract"-Extension: (my hope was that this already exists)
You select the layers which you want to have additive and subtractive, respectively. Furthermore you define the layer where you want to have the result. The original layers are unchanged, i.e. no unlinking, ungrouping, etc. so that you easily can edit the patterns there and when your done press again the "Layer-Add&Subtract"-Button.
It doesn't sound too difficult for a script to loop all objects in the "additive" layers and add them to one "AdditivePath". And then to loop all the objects in the "subtractive" layers subtracting one after another from the "AdditvePath".
Unfortunately, I neither have the knowledge nor the time...
OK, if DXF does not care as long as the pattern completely surrounded. Let's hope that the 3D-CAD or the lithomask program interprets it right.
Ah, I haven't paid attention to the XML Editor. For parsing and modifying the XML File, wouldn't be Perl a good choice? I only know a little Perl.
Apropos script... aren't the extentions written in Python?
I need to check wether there is a good tutorial about writing your own extensions.
If I had the knowledge and time I would then implement a "Layer-Add&Subtract"-Extension: (my hope was that this already exists)
You select the layers which you want to have additive and subtractive, respectively. Furthermore you define the layer where you want to have the result. The original layers are unchanged, i.e. no unlinking, ungrouping, etc. so that you easily can edit the patterns there and when your done press again the "Layer-Add&Subtract"-Button.
It doesn't sound too difficult for a script to loop all objects in the "additive" layers and add them to one "AdditivePath". And then to loop all the objects in the "subtractive" layers subtracting one after another from the "AdditvePath".
Unfortunately, I neither have the knowledge nor the time...

Win7/64, Inkscape 0.92.2
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Boolean operations on layers?
I also think extensions are in Python. I generally glaze over when scripting is involved. A very weak point for me. I suppose that's why I used spreadsheet functions.
Most of the tools needed have keyboard shortcuts. I enjoyed keyboard macro programs in earlier windows versions, I haven't used any lately, so I can't say if any would work here.
Most of the tools needed have keyboard shortcuts. I enjoyed keyboard macro programs in earlier windows versions, I haven't used any lately, so I can't say if any would work 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/
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/
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Boolean operations on layers?
FWIW, I generated a 32x32 clone matrix (1024 squares) and did a boolean with another 32x32 set of 10-point stars. The processing bottleneck is disconnecting the clones from the original object, but that takes less than a minute. The other processes were trivial, timewise.
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/
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/