0

Using a diameter list halves diameter?

Anonymous 10 years ago 0
This discussion was imported from CodePlex

SeanV12 wrote at 2013-06-18 16:45:

Sorry to do two threads back to back, but I've run into another problem.
As the title said, using a diameter list for a TubeVisual3D instead of one set diameter seems to half the diameter at every point.

I've edited streamlines to see if the problem is here, and it doesn't seem so, setting the tube diameters to one, and the cone radius to .5 produced similar diameters, so I would guess the MeshBuilder tubes are fine, but this:
 private void DiamListTube_Click(object sender, RoutedEventArgs e)
        {
            TubeVisual3D diamListTube = new TubeVisual3D();

            Point3DCollection tubePath = new Point3DCollection();
            tubePath.Add(new Point3D(0,  0, 5));
            tubePath.Add(new Point3D(32, 0, 5));

            IList<double> diameterList = new List<double>();
            diameterList.Add(10.0);
            diameterList.Add(10.0);

            diamListTube.Diameters = diameterList;
            diamListTube.Path = tubePath;
            diamListTube.Fill = Brushes.Red;
            MainViewPort.Children.Add(diamListTube);
        }

        private void NoDiamList_Click(object sender, RoutedEventArgs e)
        {
            TubeVisual3D tube = new TubeVisual3D();    

            Point3DCollection tubePath = new Point3DCollection();
            tubePath.Add(new Point3D(0, 10, 5));
            tubePath.Add(new Point3D(32, 10, 5));

            tube.Diameter = 10.0;
            tube.Path = tubePath; 
            tube.Fill = Brushes.Blue;
            MainViewPort.Children.Add(tube);

        }
Produces this:


Am I doing something wrong, or is the Diameter list the issue?

objo wrote at 2013-06-18 22:11:

thanks, this is a bug in the library! I added issue https://helixtoolkit.codeplex.com/workitem/9988

objo wrote at 2013-06-19 21:32:

I have corrected the bug in the TubeVisual3D class.
I also changed the type of the Diameters property, so we can test by the following xaml:
<HelixToolkit:TubeVisual3D Path="0 0 5,32 0 5" Diameters="10,10" Fill="Red"/>
<HelixToolkit:TubeVisual3D Path="0 10 5,32 10 5" Diameter="10" Fill="Blue"/>