# Render a polyline with rounded joints

I have a list of points (3D) and want to draw a line connecting all points with a specified width. The line should be rendered in OpenGL (using OSG) as triangles. The real challenge of this task is to make the line look "pleasant" for the user; meaning the joints should be round.

It should be similar to this:

Is there any library which brings this functionality?

-
So you want a smooth curve through those points? Look into bezier curves. – doppelgreener May 10 '12 at 10:03
No, i don't want a smooth curve though the points. I just want a 'think' line connecting the points with good locking joints (especially without spikes) – Andreas Roth May 10 '12 at 10:14
Could you post an example of what you want? – doppelgreener May 10 '12 at 10:22
added a link to similar code for 2d lines – Andreas Roth May 10 '12 at 12:32
There's lots of things in this link. My unserstanding is that you're only interested in rounded joints, like this: vaserenderer.sourceforge.net/blog/vaserendererdraft12/…. Am I right? – Laurent Couvidou May 11 '12 at 14:02

I'm not sure you should go through the burden of using a library just for rounded joints. You could draw thick lines with discs at the intersections, i.e.:

-
+1 - this is the most straightforward approach. Note that since the user is talking about line drawing in 3d, the 'thick lines' should actually be cylinders and the discs should be spheres since they could be being looked at from any angle; if users will be inspecting the lines up close then you'll have to be a little bit careful about polygonalizing your shapes (especially your sphere) to avoid cracks where the cylinders merge into the sphere. – Steven Stadnicki May 15 '12 at 20:25

In the CAD world a rounded corner like you describe is called a Fillet while a hard angled transition is called a Chamfer. Since you are dealing with lines, which is a CAD specialty, see if anything here: Discussion on CAD libraries has something you can use.

-