Issues with Multiple LinesVisual3D

Feb 24, 2012 at 8:51 PM

Hi,

I'm using LinesVisual3D to produce an outline which works great. The problem I'm running into is having multiple outlines on screen with different properties (thickness, color, etc.). Both LineVisual3Ds are using the points from each other and creating overlapping lines. Here's a code sample:

TaperMillMainViewport.Children.Clear();

LinesVisual3D centerline = new LinesVisual3D();
centerline.Color = Colors.Gray;
centerline.Thickness = 1;
centerline.Points.Add(new Point3D(0, 0, 0));
centerline.Points.Add(new Point3D(0, 2, 0));
TaperMillMainViewport.Children.Add(centerline);
            
LinesVisual3D profile = new LinesVisual3D();
profile.Color = Colors.DarkGreen;
profile.Thickness = 2;
profile.Points.Add(new Point3D(0, 0, 0));
profile.Points.Add(new Point3D(.25, 0, 0));
profile.Points.Add(new Point3D(.25, 2, 0));
profile.Points.Add(new Point3D(0, 2, 0));
TaperMillMainViewport.Children.Add(profile);

Mar 10, 2012 at 3:36 PM

thanks for the bug report! There was a bug in the initialization of the Points dependency property - it should be corrected now. 

Also note that the Points list should contain pairs of coordinates - for each line segment. Your "profile" element will only contain two line segments.