0

TubeVisual over TubeVisual

Anonymous 10 years ago 0
This discussion was imported from CodePlex

terry_513 wrote at 2014-01-23 13:13:

Hello,
I want to create a TubeVisual3D on a  TubeVisual3D - inner tube & outer tube. I want the inner tube to be on the Outer tube -so inner tube can be visible over outer. My code is :- 
            <HelixToolkit:TubeVisual3D Path="-12 7 -1.45 -2 0.5 0 -8 -55 0.45" x:Name="myTube" Diameter="5" Fill="Gray" IsPathClosed="False"
                                          />
            <HelixToolkit:TubeVisual3D Path="-10 5 -0.45 2 0.5 0 -8 -55 0.45" x:Name="myInnerTube" Diameter="2" Fill="White" 
                                          />
But with this, myInnerTube (the inner tube) is seen behind the outer. How do I make it see the myInnerTube on the outer tube ?? What should I add in that tube control ?

Also I am not able to bind the Path of the TubeVisual3D.
<HelixToolkit:TubeVisual3D x:Name="tube1" Path="{Binding TubePipe}" Diameter="1.5" IsPathClosed="False"
                                        Fill="#FFD61D1D"/>

// Code Behind

public WellBoreWindow()
        {
            InitializeComponent();
            //Pipe = CreatePath();
            TubePipe = CreateTubeVisual();
            DataContext = this;
        }

private IList<Point3D> CreateTubeVisual()
        {
            // -9 0 -0.45 -8 0.1 0 -9 0 0.45
            List<Point3D> pts = new List<Point3D>();
            pts.Add(new Point3D(-12, 0, 0.45));
            pts.Add(new Point3D(-11, 0.1, 0));
            pts.Add(new Point3D(-12, 0, 0.45));
            return pts.ToList();
        }


        public IList<Point3D> TubePipe { get; set; }
It doesn't show naything, why so ??

objo wrote at 2014-01-25 22:36:

1) Sharp corners on the tube and extruded visuals are not supported.
I think this needs an approach similar to GLE - http://linas.org/gle/

2) Note that the Path dependency property is of type Point3DCollection. It seems like the Point3DCollectionConverter converter only supports strings, not IList<Point3D>. You can work around by changing to
            TubePipe = new Point3DCollection(CreateTubeVisual());
You also need to change the points in your example (same reason as for #1) to see anything:
            pts.Add(new Point3D(-12, 0, 0.45));
            pts.Add(new Point3D(-11, 0.1, 0));
            pts.Add(new Point3D(-10, 0, 0.45));

terry_513 wrote at 2014-01-27 06:56:

Thanks objo,

My binding issue got resolved.
1) Sharp corners on the tube and extruded visuals are not supported.
So u mean, I can't draw a tube on a tube. Then how an I achieve this goal....
I need to draw a tube, an inner tube in it (through which chemical/liquid passes). So got to show chemical, arrow also on it. Which control to use to achieve the goal....

I didn't get how GLE can help me with this...

Thanks

objo wrote at 2014-02-02 12:02:

Sorry, I don't understand what you try to model here. Can you draw a figure or model it in some other program?

GLE is a tubing and extrusion library for OpenGL, written in C. This library does proper joins - see http://linas.org/gle/join.html
I am not aware of anything similar in C#.
We can add it as a new feature in the issue list, but I think it is a rather big task to implement this.