1

In Inkscape, how to make two circle to be a rounded rectangle?

Lets say, I have blue circle and red circle. Both of them position like below image:

enter image description here

How to join that two circle so I have perfect rounded rectangle based on the blue and red circle position? So the output something like this:

enter image description here

  • 1
    A trick from graphics programmers, and math classes, is that you can always transform to a case that you can trivially solve. In this case rotate to horisontal vertical connect and counter rotate has been suggested. It works, and in fact half of all you see on a monitor relies on a trick like this. I do however wonder why everybody has to copy how adobe has neglected tangent snapping. Most cad apps implement this elegantly without needong super complicated stuff. – joojaa Nov 26 '19 at 15:57
4

I think I'd use the InkTan extension to generate the outline. Still needs a bit of path joining afterwards, but it will be exact by default.

https://github.com/Rhysun/inkTan

inkTan extension

To turn these three objects into a single one, connect the ends of the tangents with new segments, so they form a rectangle, then do Path > Union with all three objects.

| improve this answer | |
  • Can you show me additional steps how to make that to be a perfect rounded rectangle? – Engkus Kusnadi Nov 27 '19 at 14:14
  • Updated my answer, @EngkusKusnadi . – Moini Nov 27 '19 at 20:35
  • Still can't got it. I'm very new to inkscape. – Engkus Kusnadi Nov 28 '19 at 3:09
  • Updated gif, @EngkusKusnadi . – Moini Nov 29 '19 at 2:55
  • 1
    Got it! Thanks @Moini, that answer and the GIF is very awesome! – Engkus Kusnadi Nov 29 '19 at 5:40
3

Make sure the circles are aligned either vertically or horizontally, then draw a rectangle between them, ensuring that the size matches and that it ends at the centers of both circles. Then merge with the pathfinder tool and rotate/recolor as needed. demonstration

| improve this answer | |
  • So, if the position of both circle is verticaly or horizontaly, Instead I'll directly create a rounded rectangle. And its look you are using Illustrator instead Inkscape that I'm ask. – Engkus Kusnadi Nov 26 '19 at 2:14
  • Oh, I misread what application you're using. This method would work with both Inkscape and illustrator, but you obviously the interface and vocabulary are different. In inkscape, instead of pathfinder, you'd use "Path > Combine" – superluminal Nov 26 '19 at 16:27
  • You could simply delete the right anchor on the left circle, and the left anchor on the right circle, then simply join the top and bottom anchors. No need for a rectangle. – Scott Nov 27 '19 at 20:39
  • Yes, but I also have an unnusual love for the addition/subtraction tools, soooooooo – superluminal Nov 27 '19 at 20:46
2

The case is already solved with a tangent drawing extension. Actually in this special case the tangents can be drawn also without that extension. They are as long as the line between the circle midpoints and they can be made by duplicating that connection line. Placing them properly with snapping happens when one draws a 90 degrees rotated copy of the line. Its midpoint snaps to the circle midpoint. In inkscape snap to crossing works well.

enter image description here

The tangents are joined, the resulted rectangle and the circles are combined with Path > Union.

BTW in Inkscape closed areas like circles often cause false snaps if they have a stroke. For that reason it's useful keep them strokeless during the construction.

| improve this answer | |
0

If it is acceptable to place the two circles either vertically or horizontally to perform the creation, then rotate the creation, the process is straightforward.

Use the align feature for placement. Convert the circles to paths (Path, Object to Path) and break the nodes for both circles at the diameter. Delete the semi-circles that are no longer needed. Add lines between the remaining semi-circles. Join the nodes and fill with desired color.

Rotate to desired angle.

| improve this answer | |
  • Maybe create rounded rectangle is a good idea. But, can you show me how to create rounded rectangle, and rotate that so the both sides position 'exact' in both blue circle and red circle position? – Engkus Kusnadi Nov 26 '19 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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