How to join two curves?

Post questions on how to use or achieve an effect in Inkscape.
srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

How to join two curves?

Postby srynoname » Mon Jan 23, 2017 12:37 am

I have drawn two spiro curves in Inkscape. Both have the same endpoint, but when zooming in on the connection between these two curves, it does not look fine:
Image
Note the gap between both curves. What I finally want to have is this (simulated using paint):
Image
Getting both curves red is not the problem, but note the rounded edge that I want to have. How can I get this rounded edge? Thanks!

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: How to join two curves?

Postby tylerdurden » Mon Jan 23, 2017 1:37 am

I'd try "Cap" mode in the stroke style tab of the fill/stroke panel.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: How to join two curves?

Postby srynoname » Mon Jan 23, 2017 3:17 am

Thank you, when using the round cap, it indeed works and basically looks like requested in my initial post! I just noted that the curved edge doesn't look as good as expected, especially because only the outer edge is curved.
a) is it possible to also make the inner edge rounded?
b) is it possible to make matching edges, that are not rounded, meaning extend the black line a little bit and cut a little bit of it off, so it matches the angle of the red line? [is there an automatic/easy way to do this. obviously that could be somehow contrucsted manually]

Thanks!

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to join two curves?

Postby Moini » Mon Jan 23, 2017 3:35 am

If you don't care about the colors being identical after the joining, you could also join the two paths
(hold Shift + click on them to select both paths, hold Shift and drag a seleciton box around nodes to select both):

Bildschirmfoto_2017-01-22_18-33-09.png
Bildschirmfoto_2017-01-22_18-33-09.png (44.33 KiB) Viewed 1390 times
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How to join two curves?

Postby brynn » Tue Jan 24, 2017 9:32 am

Joining the 2 end nodes, as Moini suggested, will make the corner sharp. But then, you can change the Join Style, which is right beside where you changed the end cap style, to make it round or angled.

To make the inner part rounded, will take some work (as opposed to clicking a button or changing an option somewhere). Essentially, you change the line from being a stroked single path to a filled set of 2 paths. If you think you will need to edit other parts of the path, then you should do it first. Because after you do this, it will be much harder to edit. You'll see why, probably easier than me explaining it.

That fastest way would be to start by joining the nodes, as Moini suggested. Then select the path and do Path menu > Stroke to Path. Then switch to the Node tool (if not already using it). Select the inner corner node, and change it to a smooth node (Ctrl + click). Then adjust the handles.

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: How to join two curves?

Postby srynoname » Tue Jan 24, 2017 9:59 pm

I created a MWE (minimum working example, find the XML at the end of this post) for some visual demonstrations:
Original: 2240 %
Image

Round cap stroke style of black curve:
Image

Make black curve red:
Image

Following the instructions of Moini (danke!):
Image

Stroke Style, Join, Round join, as suggested by Brynn, can be used to get back the round corner :
Image

For my current use case I ended up being so happy with the result of Moinis solution that I didn’t try making the inner part rounded (though I asked for this) as explained by brynn. For my kind of use it seems too complicated to me (and I like the sharp edge), but if that’s the way it’s done in Inkscape, then so it be. Still, thank you brynn for the explanation!
Thanks to everyone who replied here, I am impressed by this support and hope I could give a nice overview of the mentioned techniques here for other readers (except the thing with the rounded inner curve).

By the way, here is the XML for my minimum working example:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"
   version="1.1"
   id="svg8"
   inkscape:version="0.92.0 r15299"
   sodipodi:docname="example.svg">
  <defs
     id="defs2">
    <inkscape:path-effect
       effect="spiro"
       id="path-effect4505"
       is_visible="true" />
    <inkscape:path-effect
       effect="spiro"
       id="path-effect4509"
       is_visible="true" />
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="1.4"
     inkscape:cx="453.74839"
     inkscape:cy="830.77349"
     inkscape:document-units="mm"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1920"
     inkscape:window-height="1137"
     inkscape:window-x="-8"
     inkscape:window-y="-8"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <path
       style="display:inline;fill:none;stroke:#ff0000;stroke-width:0.52916664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="m 173.79414,66.907991 c -6.24621,-0.558976 -12.49895,-1.045111 -18.7565,-1.458272 -4.48211,-0.295936 -8.96672,-0.554437 -13.44709,-0.875678 -6.04754,-0.433607 -12.08634,-0.981449 -18.13223,-1.437445 -5.51454,-0.41592 -11.03457,-0.755398 -16.55047,-1.152985 -4.78859,-0.345162 -9.574091,-0.734124 -14.354263,-1.180965 -2.811771,-0.262839 -5.621739,-0.545706 -8.43572,-0.783733 -2.070838,-0.175166 -4.143732,-0.326037 -6.21811,-0.45257"
       id="path8468"
       inkscape:connector-curvature="0"
       inkscape:path-effect="#path-effect4505"
       inkscape:original-d="m 173.79414,66.907991 c -9.31985,-0.787537 -12.50408,-0.972447 -18.7565,-1.458272 -6.25244,-0.485825 -8.98817,-0.607756 -13.44709,-0.875678 -4.45891,-0.267925 -12.06417,-0.934855 -18.13223,-1.437445 -6.06805,-0.502586 -10.58299,-0.650398 -16.55047,-1.152985 -5.96749,-0.502589 -9.995943,-0.929804 -14.354263,-1.180965 -4.35831,-0.251161 -5.55243,-0.499049 -8.43572,-0.783733 -2.88328,-0.284686 -4.23996,-0.301977 -6.21811,-0.45257"
       sodipodi:nodetypes="cssssssc" />
    <path
       style="display:inline;fill:none;stroke:#000000;stroke-width:0.52916667;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d="m 23.692386,119.85835 c 9.179971,-3.15371 17.887859,-7.67775 25.745921,-13.37587 7.031248,-5.09857 13.444482,-11.212173 18.00211,-18.605544 2.824554,-4.581984 4.898683,-9.589308 6.63766,-14.683289 1.524936,-4.46699 2.801451,-9.018773 3.82168,-13.627304"
       id="path4493"
       inkscape:connector-curvature="0"
       inkscape:path-effect="#path-effect4509"
       inkscape:original-d="m 23.692386,119.85835 c 10.29139,-2.41342 17.164201,-8.91751 25.745921,-13.37587 8.58175,-4.45836 12.00167,-12.403959 18.00211,-18.605544 6.00045,-6.201581 4.42537,-9.789124 6.63766,-14.683289 2.21228,-4.894167 2.54805,-9.085133 3.82168,-13.627304"
       sodipodi:nodetypes="csssc" />
  </g>
</svg>


Return to “Help with using Inkscape”