How can I crop closed paths (in a single operation) and have the result be a set of open paths?
Here's what I'm starting with:
The orange area is a closed path that I want to crop to, and the black lines are a bunch of closed paths that I want to be cropped. This is what I want the result to look like:
The lines must be open in the final result. That is, each line is just that - a line with no fill. (But ideally, they'd keep the stroke I've set initially.)
It's important that this solution applies to much more complex scenarios too. For example, I'd want to crop the lines in this example down to the purple areas:
I'm open to using any software available, but I'd prefer something open source / scriptable. Illustrator or Inkscape would do.