0

Curved Line

Anonymous 10 years ago 0
This discussion was imported from CodePlex

lmat619 wrote at 2012-06-08 20:55:

Hello. I am wondering if there is anything in the toolkit that gives a curved line. Something kind of like a mix between the PieSliceVisual and the LineVisual? Just wondering if it's out there before I start writing code to make one. Thanks!


objo wrote at 2012-06-09 22:18:

there is a CanonicalSplineHelper class that will interpolate a list of points. You can use this with the LinesVisual3D or TubeVisual3D. (note that the Points collection in LinesVisual3D defines line segments, so you need to modify the result from the CanonicalSplineHelper...)


lmat619 wrote at 2012-06-11 17:53:

Thanks so much! That's exactly what I was looking for. I have one last (stupid) question. The result from CanonicalSplineHelper creates dashed lines. Is there any way I can make it a solid line?

edit:

Nevermind, I figured it out. In the Segment function in CanonicalSplineHelper where the points are added, I changed the way it adds the points to:

if (points.Count == 0)
    points.Add(pt);
else
{
    points.Add(pt);
    points.Add(points.ElementAt(points.Count - 1));
}

This way, a line is made from each point to its preceding point.