Troubles using clipping

Post questions on how to use or achieve an effect in Inkscape.
walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Troubles using clipping

Postby walshlg » Tue Dec 02, 2014 3:03 pm

Hi all, just getting back into inkscape to use with a shapeoko cnc.

My goal is to use hatching, of various density, to act as shading. Each line of hatch will be carved into the material. :tool_node: No problem getting bitmaps to paths but the hatching is being problematic. I need each hatch to be a path so the bit can cut that hatch line (so I don't think hatching as a fill pattern is a viable option). Making copies of Bezier Lines OR using the sketch path effect and converting object to path I can get fun hatchings BUT I need to trim these to the shape to be filled. But clip, mask and boolean operations on paths don't seem to be working properly if there are multiple paths/ lines. The result of a clip of a single line works fine but multiple lines with a clip and everything or nothing disappears. I moved the clipping path to the top layer.

Any suggestions?

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

Re: Troubles using clipping

Postby Lazur » Tue Dec 02, 2014 3:15 pm

Hi.

I suggest you try the hatches live path effect.

User avatar
ianp5a
Posts: 106
Joined: Thu Sep 02, 2010 1:30 am

Re: Troubles using clipping

Postby ianp5a » Wed Dec 03, 2014 8:12 am

Before clipping, you could "combine" the lines into a single object. Then clip it.

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Re: Troubles using clipping

Postby walshlg » Wed Dec 03, 2014 1:36 pm

I don't want to use hatches because the lines are arcs, not hatches. If I extended it far enough it might be a nice option though, will give it a try. BUT grouping before clip worked fine , thanks for the help all.

btw sketch can be nicely modified for a great hatch look and grouped and then clips perfectly.

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

Re: Troubles using clipping

Postby Lazur » Wed Dec 03, 2014 1:46 pm

This post was on my mind. If you can show an example of the style you are after, we may give more straightforward ideas.

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

Re: Troubles using clipping

Postby brynn » Wed Dec 03, 2014 2:01 pm

I don't want to use hatches because the lines are arcs, not hatches.


If I'm not mistaken, the hatches can be configured to be straight (in the LPE).

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Re: Troubles using clipping

Postby walshlg » Thu Dec 04, 2014 2:40 pm

That hatch cleanuplooks great! Still working on getting them straight

Having Another problem with clip: made blocks of hatching, used clip, looks great in inkscape BUT the clip isn't "permanent" its just a visible clip since the svg contains the entire swath of my hatching, can't use that to drive the shapeoko! Any idea how to make a clip really clip what is underneath instead of just hide it?

I may have to post a screencap here to show you what the svg output looks like, its a real headache.

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

More Troubles using clipping

Postby walshlg » Thu Dec 04, 2014 3:06 pm

Here is the problem:
In inkscape I see
Image


Opening the svg in makercam (the program that makes the commandsfor the cut directions)
Image

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

Re: Troubles using clipping

Postby Lazur » Thu Dec 04, 2014 5:26 pm

A-ha!

Makes a lot more sense now. That needs a bit of node editing, not just applying an effect.
For cnc sense the ordering of the path's nodes may need a bit more editing, but the overall shape can be made quite easily as described in the attachment.
Attachments
hatches.svg
(23.7 KiB) Downloaded 233 times

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Re: Troubles using clipping

Postby walshlg » Fri Dec 05, 2014 12:04 pm

that looks very clever, going to give it a try right now. Thanks

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Re: Troubles using clipping

Postby walshlg » Fri Dec 05, 2014 1:12 pm

OK Here is what I learned:

the only way i could get the the boolean subtraction to work right was using exclusion. Subtract did nothing and difference deleted everything like it was working on the bounding box not the path
Image

then I deleted the nodes on the outside and whoa look at the handles:
Image

So then I made all nodes corners but now I lost the curvature of the bezier:
Image

I found it very tough editing inside angles like the arms of the star. My work flow was: 1) split the troublesome node (sometimes need multiple splits) 2) move all the new nodes around to find the mischief makers 3) delete bad segments 4) reassemble.
Image

So this works but it is certainly a lot of hand work and you lose curvatures unless you had edit all the handles.
Does this seem correct?
Any suggestions?

I wonder if this might be easier in a 3d program like blender since you are losing the curves anyway and boolean operations are very well done. Any thoughts?

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Re: Troubles using clipping

Postby walshlg » Fri Dec 05, 2014 1:17 pm

P.S. how is combine (ctrl-K ) different than group objects?

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

Re: Troubles using clipping

Postby Lazur » Fri Dec 05, 2014 9:19 pm

Subtract works between two paths -subtracts the topmost of the selection from the one object below.
Intersection would give you the right parts.
But again, the three objects in your example doesn't have one intersection as per se, first you need to make all the objects except the one with the parallel segments to be a compound path.
Thus, use combine path before on them, then use intersection (Ctrl+*).

Preserving the contours with the hatches I thought to be avoided.
By duplicating (Ctrl+D) the original -compound- path you can have that part separately.

Combining is like welding the subpaths together as they were steel rods.
Grouping is like putting them into one box.
The difference is, that you can enter the group and add other objects to it, add multiple fill attributes to each objects inside.
Booleans can be applied on compound paths but not on groups.

Another example, if you want to draw a square with a circular hole somewhere.
If you just group a rectangle and an ellipse, it won't be hollow if you add a fill.
If you combine them, and take care about the path directions and fill rules, it will look right.

walshlg
Posts: 8
Joined: Tue Dec 02, 2014 2:47 pm

Re: Troubles using clipping

Postby walshlg » Wed Dec 10, 2014 12:29 pm

Thanks, I'm getting better at this now.

My findings: you don't need to make the complex comb like structure, its better if you don't, just make an array of copies of a straight line and then combine (ctrl-k), (before subtracting, don't forget to select them using the path node pointer, not with the object pointer=oops) then subtract paths as outlined in the previous post where the cookie cutter is the object in the higher layer. BUT inside angles still contain bridging segments so select the nodes of the bridging segments, split those nodes, then select the un-needed segments and delete.

Thanks for the help all

P.S. If you want to do this in a quick and dirty fashion, make a png image of what you want in gimp, using black and white hatching lines but about 4x larger than your final, to minimalize pixelation. Import into inkscape, trace paths from bitmap, THEN shrink it and export the svg. The problem with this approach is it creates about 6x the number of nodes.


Return to “Help with using Inkscape”