0

TubeVisual3D and Diameters

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Lekarsenten wrote at 2013-02-16 20:25:

Have nice time of a day.
At first, I want to say "thank you", Your project is something awesome.
I didn't dive deep into Your code yet, but i have a question. As I can see, TubeVisual3D is an element for making curve tubes with variable diameters throug path - so, what i'm doing wrong?:
TubeVisual3D t = new TubeVisual3D();
            t.Fill = System.Windows.Media.Brushes.Black;
            
            Point3DCollection p3dc = new Point3DCollection();
            List<double> diamlist = new List<double>();
            double dx = 15;
            double dy = 15;
            double dz = 15;
            double dd = 10;
            int n = 30;
            for (int i = 1; i < n; i++)
            {
                p3dc.Add(new Point3D(0 + Math.Pow((double)i / n, 3) * dx, 0 + ((double)i / n) * dy, 0 + ((double)i / n) * dz));
                diamlist.Add(3.5 + ((double)i / n) * dd);
            }
            t.Path = p3dc;
            t.Diameters = diamlist;            
            _HelixViewport3D.Children.Add(t);
and i'm got curve pipe with constant diameter of 1.

Best regards.

p.s. sorry for my bad english, it isn't my native language)

objo wrote at 2013-02-16 22:18:

try changing the order of setting Diameters and Path
t.Diameters = diamlist;
t.Path = p3dc;
If you set the diameters last, the mesh will be generated twice.
I will correct the bug.

lekarsenten wrote at 2013-02-17 07:15:

Wow! Great. TY.