Profile Picture

NTriangulatedSurfaceSeries dos not displays with data point increase

Posted By Daniel Csimszi 10 Years Ago

NTriangulatedSurfaceSeries dos not displays with data point increase

Author
Message
Daniel Csimszi
Question Posted 10 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Hi,

I am playing with he surface graph. I'm trying to display an arch just now with this code:


int maxj = 10;
for (int i = 0; i <= 180; i++)
      {
       for (int j = 0; j < maxj; j++)
       {
          //x
          surface.XValues.Add(j);
          //y
          surface.Values.Add(Math.Round(Math.Sin(i * Math.PI / 180) * 100, 2));
          //z
          surface.ZValues.Add(Math.Round(Math.Cos(i * Math.PI / 180) * 100 + 100, 2));
          surface.Colors.Add(returnColor(0, 20, 10));
       }
      }


My problem is that if the maxj is 10 then I cannot see the graph, if I decrease it to 3 then it is displayed.

It is not the number of points as if display the same or even more points without drawing the arc, using Sin/Cos then it works.

Any idea?

Thanks,
Daniel

Tags
Daniel Csimszi
Posted 10 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Some update:

I tried a few different things. I am drawing 2 half circles/cylinders one outer and one inner, the code of the outer:


for (int i = 0; i <= 180 - degree * 2; i++)
      {
       for (int j = 0; j < maxj; j++)
       {
          //x
          double x = i*(r*2/180) - r + degree;
          surface.XValues.Add(x);
          //y
          double y = Math.Sqrt(Math.Pow(r, 2) - Math.Pow(x, 2));
          surface.Values.Add(y);
          //z
          double z = j;
          surface.ZValues.Add(z);
          surface.Colors.Add(returnColor(0, 20, 10));
       }
      }

Code for my inner circle:

for (int i = 0; i <= 180 - degree * 2; i++)
      {
       double x = 0;
       double y = 0;
       double z = 0;
       for (int j = 0; j < maxj; j++)
       {
          x = r * (Math.Sin(Math.Abs(i - 90) * Math.PI / 180));
          if (i < 90)
            x *= -1;
          surface.XValues.Add(x);
          //y
          y = r * (Math.Sin((90 - Math.Abs(i - 90)) * Math.PI / 180));
          surface.Values.Add(y);
          //z
          z = j;
          surface.ZValues.Add(z);
          surface.Colors.Add(returnColor(0, 20, 10));
       }
       //Console.WriteLine(i + ": " + x + ", " + y);
      }

  • If I live the codes the way like that I have both of the half cylinder.
  • If I change the outer code to the same as the inner then the inner circle does not displays
  • If I change the outer plus uncomment the inner writeline I can see the inner circle but not the outer
  • If I do not display the outer circle in purpse just the inner the inner does not displays with or without the writelines
  • If I display just the inner circle in purpose and use the writelines plus add nchartcontrol.refresh() to the chart control onclik method then I can see the inner circle.
There is something really weird with that, something with to refreshing or the memory handling, I do not know.
Are there any way to check if the values are wrong that I input? I mean if I put in logically wrong values I guess the graph wont be displayed anyway, it would be nice if it can be viewed anywhere if its can be processed or not.
In my case the values seems to be right as I can display the graphs some times but the sometimes is really not a solution.

Thank you,
Daniel





Nevron Support
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 12 hours ago
Posts: 3,043, Visits: 3,769
Hello Daniel,

In general, triangulation algorithms implemented with double precision arithmetic are not stable with certain kinds of input, especially ordered sets of points like the ones that you are displaying. In other words, sometimes the surface series simply fails to triangulate the points that you specify. You can configure the chart to use geometric calculations with adaptive precision - this will make the triangulation somewhat slower, but more robust. To enable this feature, you have to set the UsePreciseGeometry property to true.

By the way, the occurrence of this problem is often a sign that the triangulated surface might not be appropriate. You can display the same surface with the Mesh Surface series - no issues with the precision and it renders much faster.

Best Regards,
Nevron Support Team



Daniel Csimszi
Posted 10 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Thank you, I need to color each point the way I want to so I think I just going to stay with the triangulated surface.

I am just wondering can nevron display a torus? or at least the top half of it?

Nevron Support
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 12 hours ago
Posts: 3,043, Visits: 3,769
Shapes like torus or the top half of a torus can only be displayed with the Mesh surface series. It is possible to display something similar to a half torus with the triangulated surface too, but the hole in the middle cannot be displayed.

Best Regards,
Nevron Support Team



Daniel Csimszi
Posted 10 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
No worries.
It can display torus.



Similar Topics


Reading This Topic