The image below is the result of the intersection between a path and some bezier lines. As you can see, the lines go beyond the path behind them.
How can this be avoided?
I am aiming for the lines to be within the path, i.e. with no overflow.
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
An easy way would be to give a stroke to the background limit shape, too, but I guess it's not the wanted answer.
Inkscape's strokes are half of the stroke width outside the actual shape borded. The border of the strokeless shape is exactly the midline of the stroke. That cannot be changed like Illustrator users can do.
Use a copy of the underlying limiting shape as clipping path. It makes the extras invisible. As well you can use a strokeless copy as a clipping path to hide the outer half of the stroke (assuming the strokes are exactly along the limiting shape edge. Clipping path can be set by applying Object > Clip > Set.
Convert the strokes to paths. Then you can subtract the extras off by making an intersection with a copy of the allowed area shape. An example:
In the left the pink shape is the allowed area, the black shape has no fill, only a stroke
In the middle the black stroke is converted to path (=Path > Stroke to Path) and the pink shape is duplicated. The duplicate in on top and for clarity I removed its fill, but inserted a green stroke
In the right The black and green shapes are selected and Path > Intersection is applied.
Multiple black shapes could be combined to one with Union or Combine.
The Object > Clip -method gives visually the same result, but it's undoable with Object > Clip > Release.
For uniformly wide stroke or actually something which resembles stroke delete or Clip to invisible the outer half of the stroke. Here's the deletion. For it the stroke must be converted to path:
In the left there's 2 black stroke only shapes and the underlying limit shape, the one whose duplicate was used to slice the black shapes to the right size by intersecting.
In the middle the black shapes are duplicated, the duplicates are on top and have green fill, no stroke.
In the left the original black strokes are converted to paths and the intersections with the green shapes are formed. One Path > Intersection is enough if black shapes are combined and the green shapes are combined, too.
Warning: Clipped shapes are selectable under the clipping path by double-clicking. It's dangerous, you can very easily destroy the composition by moving the clipped shapes. it's useful to learn to lock and select items via the objects panel.