4

Let's say I have a circle (A) with diameter slightly larger than the sides of a square (B), and A & B are aligned center-on-center. As these overlap, they will produce 9 separate regions. Is there any way to intersect the two curves/paths to produce these 9 independent regions/closed-paths such that I can fill/color each of the 9 regions independently?

I see in this link how to cut paths to color each stroke/line independently: https://graphicdesign.stackexchange.com/questions/90075/split-an-svg-based-on-intersecting-lines. But I'm interested in FILLING each region separately. Do I have to cut all the paths, and then manually create closed paths/regions from the newly cut paths, clicking on vertex-after-vertex, or is there a faster/better way?

EDIT:

I tried @Billy Kerr's excellent answer on some slightly more complicated shapes, (B-Spline Paths), and found that as per his suggestion I needed to convert the B-Splines to Bezier paths, using Path + Object to Path and now it works great!

enter image description here

1 Answer 1

6

Yes, there's a reasonably fast way!

  1. Draw your shapes

  2. Select both shapes, do Path > Combine or Ctrl+K. Note: the shapes will turn all one colour, but they are still there, just combined.

  3. Draw a rectangle around both, and hit End (Send to bottom)

  4. Select both pieces, do Path > Division or Ctrl+/. Each piece becomes a separate shape which can have its own fill colour, or be moved or deleted independently

enter image description here

Note: I've used different coloured fills in the example above, but the colours don't matter, these are just so you can see what's going on.

Edit after comments: Don't use Path > combine on b-spline or spiro paths, because those are path effects. You'd need to convert them to normal Bézier paths before proceeding. To do that, select them and click Path > Ojbect to Path, then Combine will work as expected.

4
  • Many thanks. That's very helpful, however, when I tried this on some slightly more complicated paths -- B-Spline Paths in the case above (please see my edit to the original question), I got a mess after I did Path + Combine. Any ideas how to handle that? Tks! Feb 29, 2020 at 23:10
  • @Crowdpleasr Hmmm . . . don't use this on b-Splines or Spiro paths - those are a path effects. You'd need to convert them to normal Bézier paths using Path > Object to Path, before proceeding.
    – Billy Kerr
    Feb 29, 2020 at 23:17
  • 1
    Many thanks. That works perfectly now! Feb 29, 2020 at 23:28
  • @Crowdpleasr - glad to please the crowd!!
    – Billy Kerr
    Feb 29, 2020 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.