Author Topic: Remove Part of Path  (Read 11313 times)

October 29, 2016, 04:49:33 AM
Read 11313 times

Zero Tolerance

  • Sr. Newbie

  • Offline
  • **

  • 2
Hello. How I can remove part of the Path? :pen:

I have some crossed paths, example:
Untitled-3.png
*Untitled-3.png
(22.27 kB . 270x135)
(viewed 7905 times)

Left: I have now. Right: I want to do.

Thanks!

October 31, 2016, 12:46:40 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

To give you specific steps, I would need to see the SVG file.  But generally, I would either use node editing (breaking the path manually) or a Path Operations (aka Boolean) such as Difference or Intersection. 

Here's the manual info for operations:  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-Combining.html  There might be a couple of different approaches here.

Hhmm....   I might need to write a tutorial on node editing - it's been on the back burner for a while now.

Basically, for node editing, use the Node tool  :node:  Click on a node to select it.  Look on the control bar for options like "Break path at selected nodes" or "Delete segment between 2 non-endpoint nodes".  (Or you can select several, and break all at once.)  After you break apart all the nodes, next you'll need to join them back together in the correct order, using "Join selected end nodes" or "Join selected end nodes with a new segment".

If you can share an SVG file, with a small example, I could write specific steps.

  • 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                       

October 31, 2016, 03:01:45 PM
Reply #2

Zero Tolerance

  • Sr. Newbie

  • Offline
  • **

  • 2
Thank you for reply! Finally I got it.

But now I stuck with big problem. If you don't mind, I will post in this thread.
I make some logo, but do it not quite right. My paths not cycled:


And I want fill it with a white color, exactly like that:


I do it, but not right, by creating white background via raster graphic editor.

It would be nice if you tell me how I can make same white background for my logo, but in Inkscape?

moto.svg
*moto.svg
(254.66 kB - downloaded 7772 times)

October 31, 2016, 04:49:25 PM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
It's relatively simple however the process needs some practicing.
In a nutshell it goes:

  • select all paths of the desired part
  • -preferably- combine paths together (Ctrl+K)
  • duplicate object (Ctrl+D)
  • set thinner stroke
  • convert stroke to path (Ctrl+Alt+C)
  • break path apart (Ctrl+Shift+K)
  • set white fill, lower opacity to 50%
  • group objects together (Ctrl+G)
  • enter group (Ctrl+Enter) and select previous subpaths making up the edges of the filled area with the node tool
  • combine paths together (Ctrl+K)
  • exit group (Ctrl+Backspace) and ungroup objects (Ctrl+Shift+G)
  • switch to the object select tool and deselect "fill object", delete rest -unnecessary ones-
  • raise opacity of the object and lower it in the z-order/move behind the outlines (Down).

Using layers is not so mandatory as with raster editing, in my humble opinion it is way easier if you work with one layer on such simple images.

October 31, 2016, 10:42:20 PM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Lazur's idea will work.  It's a little different from how I would do it.  I'll add some other ideas and steps.  I see there are maybe 3 different ways to approach this.

1 -- Make a traditional Fill, which means to join or combine nodes together so that you have closed paths.  Paths that are not closed can have a fill, but you have the risk of gaps, if the paths are not all either closed or combined properly.  For example, if you select the jacket and the pants with the Node tool  :node: (hold the Shift key for more than 1 object), then Path menu > Combine.  Now click any color on the palette (or use Object menu > Fill and Stroke).  See how there are gaps in a few different places?  It's because the paths are not closed.  So the goal is to close the paths.

Look at the attached bike1.png image, where I've highlighted a piece with a thin green line.  That path is already closed, so you can click the white chip on the palette and color it white.  But there are many parts of the drawing where you must have open paths.  Like at the bottom of the jacket, just before the pants start, you have to keep that path open.  And on the sleeve at the wrist, there's another part where you can't close the path.

So I think that might not be the best approach, in this case.  But it is one way to do it.

2 - Probably this would be my choice.  It's combining paths and joining nodes, so that you have a closed path.  But the reason it works in this case (opposed to #1), is that you'll duplicate all the paths.  I would put the duplicates on a separate layer.  (Lazur and I have different opinions about layers.  I use them liberally, because it makes it easier to select things, when you have a complex drawing.  If I can hide all the layers below something, I can drag a selection box around what I need and not have to worry about accidentally moving objects in lower layers.)  (Or you could start locking paths, to avoid accidentally moving objects.  But that soon gets to be a pain.)

So, make a 2nd layer, duplicate all the paths, and move them up into that layer (leaving the original on Layer 1).  Open Layers menu > Layers, or use the indicator in the status bar.  Select Layer 2 and click the tiny eye icon   :vis:.  After you click, it looks like  :hid: .  So you can always know what's happening and not have to remember.

Now, you can select those 2 paths which make the jacket and pants object, and start node editing.  For the open end of the path which makes the end of the jacket (right before the pants start),  you need to delete the part that's inside, and make sure the 2 ends are either overlaping each other, or almost touching each other.  Use the Node tool, drag a tiny selection box around the 2 nodes, and click "Join selected nodes" button.  Go all the way around that object, and make sure that the path is entirely closed and there are no open ends.

After that, you can click a color on the palette and fill it.  When you've done that for all the pieces, remove all the strokes from the filled objects.  Now you can display the 2nd layer once again, where the original paths are waiting.

Another problem you'll find, is for example, the seat of the motorcycle.  You've already used the path which makes the pants, which also forms one side of the seat.  How can you deal with that?  A couple of ways.  One way is to duplicate that pants path before you start working on the pants.  Then you'll have a path for that side of the seat.  You'll have to delete some of the nodes, so that they match the rest of the seat, so you can join them.

Depending on what you're planning to do with this drawing, there's an easier way.  It's not considered a quality or professional way of working, and in certain situations, will cause other problems.  But if this drawing is only going to be looked at, and not used for plotting or wood cutting projects, or contain any transparency etc., it's not a problem.  If you're planning to use any transparency, this won't work.

Select all the paths that make up the seat, and join all the nodes, just like before.  When  you have a single path, switch to the Pen/Bezier tool and extend those open path ends, so that they are going to be hidden under the pants.  And be sure to join the nodes so you  have a closed path.  Now that seat object is partially hidden under the pants, when you display Layer 2 with the strokes, it looks like a perfect fit.

You can use Object menu > Raise, Lower, etc, or the buttons on the Control bar (swith to Selection tool).  This is called moving objects in z-order (up and down, relative to each other).

3 - This is the easiest way of all.  You hardly have to do any node editing, and really only moving nodes.  Not nearly as much breaking apart the putting back together - just moving them (use the Node tool).  This uses the Paint Bucket tool  :fba:.  It creates a nearly identical path, that is already closed. 

Just click once inside an enclosed area.  Nodes don't have to be joined, as long as they are touching.  The first thing you'll notice is that it doesn't precisely fill the areas, all the way to the outline.  That's because it's the best this tool can do it.  That's why node editing is the more professional way.  However, if it works, it works, and no one will ever know how you did it, unless they examine the SVG file.

Fortunately, there's a way to deal with that gap.  On the Control Bar, there's a setting called Grow/Shrink.  Usually you have to do some trial and error, to figure out the best value for that.  For your drawing, I would probably start with 1.0, and then go up or down from there, as needed.  You'll never be able to find a value that is perfect, because it's just not a perfect kind of tool.  So after you fill an area, you'll still need to tweak few nodes here and there.  For example, sharp corners often don't get filled in.  Or sometimes the Paint Bucket path goes outside the black paths, on long, gentle curves. 

You'll also need to make sure all these new paths which the Paint Bucket tool makes, are below the black paths.  Use the same Raise, Lower, etc buttons that I explained above.  Then after you tweak a few nodes, you're done!


Ok, so that's a quick overview.  Please feel free to ask for clarifications  :)
  • 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