Hello,
I apologize if this has already been discussed, but I tried searching the forum to no avail.
I am fairly new to Inkscape... My goal is to trim the edges of a line so that they fit within another shape. Specifically in this case, I need the white line's edges to fit within the edge of the heart shape. I have posted a screenshot of what I've got currently in Inkscape (a heart object and a white line - the black portion is just a temporary background layer), and what I'm hoping to achieve (I used GIMP to trim pixels as a quick example).
Thanks in advance for you help!
Trim Line to Match Shape Outline
Trim Line to Match Shape Outline
- Attachments
-
- Current Inkscape Document Screen Capture
- inkscape_working_copy.png (19.43 KiB) Viewed 1892 times
-
- Desired Result
- heartrate-512-final.png (19.01 KiB) Viewed 1892 times
Re: Trim Line to Match Shape Outline
Duplicate your heart shape. Select the heart and the line and do object>clip. The heart must be "above" the line.
EDITED TO ADD ALTERNATE METHOD
You could also use the path functions to do this and end up with something that might be easier to edit down the line than a clipped object.
1. Select the line and do Path>Stroke to path.
2. Duplicate the heart shape.
3. Select heart and line and do Path>Intersection.
EDITED TO ADD ALTERNATE METHOD
You could also use the path functions to do this and end up with something that might be easier to edit down the line than a clipped object.
1. Select the line and do Path>Stroke to path.
2. Duplicate the heart shape.
3. Select heart and line and do Path>Intersection.
Last edited by llogg on Mon Feb 20, 2012 10:43 am, edited 1 time in total.
Re: Trim Line to Match Shape Outline

Welcome to InkscapeForum!
There may be a few ways to do this. And it might not matter which way you do it. But there are certain situations where one or the other might be preferred. So if this causes a problem down the road, we can offer other options.
The one that's easiest to explain is clipping (and some would argue the easiest way).
-- select the heart
-- duplicate (Edit menu or control bar button)
-- give the duplicate some other color, doesn't matter what, just something different
-- select the duplicate heart and the white line
-- Object menu > Clip > Set
Now if you ever need to undo this, for some reason down the road, you can use Object menu > Clip > Release. This is when the duplicate being a different color might be helpful, because it will allow you to distinguish it from the original.
I think I would probably use a technique called 'node editing' to make the white line ends match the heart border. That's because I'm quite comfortable with node editing. However, many people avoid node editing if at all possible. If it turns out that clipping causes some as yet unforeseen problem, then we can explain either node editing or even some other technique.
Let us know how it goes

Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design