Visualization of level surfaces

I am trying to develop a surface level visualizer using this method (I don’t know if this is a standard method or if something is better):

  • 1. Take any function
f(x,y,z)=k (where k is a constant) and the boundaries for x, y and z. Also take two grid options stepX and stepZ.
  • 2. To reduce to the level of the problem curve, iterations from zMin to zMax with the interval stepZ. So,
f(x,y,z)=k => f(x,y,fixedZ)=k
  • 3. Repeat the same procedure with stepX, reducing the problem to
f(fixedX, y, fixedZ)=k
  • 4. Decide
f(fixedX, y, fixedZ) - k = 0 for all y values ​​that will satisfy this equation (using some kind of root search algorithm).
  • 5. For all created points, draw them as a level curve (the inner loop generates level curves for a given z, then for different z values ​​there are only stacks of level curves)
  • 6 (optional). Create a grid of these level / point curves that belong to a set of levels.

The problem I am facing is step 4. I do not know how many possible y values ​​satisfy this equation (more precisely, how many unique and real y values).

In addition, I try to make the program as general as possible, so I try not to restrict the original function f(x,y,z)=k any constraints, such as smoothness or a polynomial other than k, that should be constant as required for level surface.

Is there an algorithm (without using a CAS / symbolic solution) that can identify the root of a function, even if it has multiple roots? I know that bisection methods are not easy with this because of the possibility of any sign changes by region, but how does the secant / newtons method work? What set of functions can the secant / newtons method use, and can it detect and find all the unique real roots within two given boundaries? Or is there a better method for creating / visualizing level surfaces?

+4
source share
3 answers

I think I found a solution to my problem. I did a bit more research and found that the level surface is synonymous with isosurface. Therefore, in theory, something like the marching cubes method should work.

+2
source

Easy way

2D: plot (x, y) with color = gender (q * f (x, y)) in shades of gray, where q is some arbitrary coefficient. 3D: plot (x, y, floor (q * f (x, y))

The effective heights of the equivalent function will be displayed on the same level surface.

If you get level curves, you can use the 2D method and edge definition / region categorization to get points (x, y) at the same level.

+1
source

If you need an example Marching Cubes algorithm, check

http://stemkoski.github.com/Three.js/Marching-Cubes.html

(JavaScript / Three.js is used for graphics).

For more on theory, you should check out the article on

http://paulbourke.net/geometry/polygonise/

+1
source

Source: https://habr.com/ru/post/1335319/


All Articles