3D Surface Inaccurate Display


https://www.nevron.com/Forum/Topic8685.aspx
Print Topic | Close Window

By Daniel Csimszi - 10 Years Ago
Hi,

I am trying to display a 3D object with NTriangulatedSurfaceSeries but unfortunately I does no really get the object that I would like. I double checked the coordinates that I input and they seems to be right.

I would like to make a bend with a V shape in it, please find attached example.png. It is made with paint so do not except a lotBigGrin

I have attached how it looks just now as well, mesh.png

This is code how I create the coordinate:
for (int i = 90; i < 180; i++)
      {
       for (int j = 0; j < 5; j++)
         {
            //x
            surface.XValues.Add(Math.Cos(i * Math.PI / 180) * 90 + 100 + Math.Abs(j-2) * 10);
            //y
            surface.Values.Add(Math.Sin(i * Math.PI / 180) * 90);
            //z
            surface.ZValues.Add(Math.Sin(180 / 4 * j * Math.PI / 180) * 4);
            surface.Colors.Add(Color.Green);
            Console.WriteLine(j + ", " + Math.Sin(i * Math.PI / 180) * 90 + ", " + (Math.Cos(i * Math.PI / 180) * 90 + 100 + Math.Abs(-2 + j)*10));
          }
      }

Here is the output of the bottom line:

z  y                           x
0, 1.57071657935551, 30.0137074359248
1, 1.57071657935551, 20.0137074359248
2, 1.57071657935551, 10.0137074359248
3, 1.57071657935551, 20.0137074359248
4, 1.57071657935551, 30.0137074359248

The coordinates seems to be OK, any idea why it does not display the way I think it should?

Thank you,
Daniel
By Nevron Support - 10 Years Ago
Hi Joel,

From the "example.png" image it is a bit hard to understand what the surface should look like, but it seems that the triangulated surface is not the right choice. As you know, for the triangulated surface you have to specify just a set of points (with x,y,z coordinates) and no adjacency information. The surface series builds a triangular network in such a way that if you project the surface on the XZ plane, you will get a convex polygon. The surface that you are trying to display doesn't look like this, probably you have to use the Mesh Surface series.