FuncViz examples
Generalized bitree/quadtree/octree library
Loading...
Searching...
No Matches
surface_plot_corner.cpp File Reference

Surface with a sharp edge. More...

Go to the source code of this file.

Detailed Description

Surface with a sharp edge.

Author
Mitch Richling http://www.mitchr.me/
Date
2024-07-16
Standards
C++23
Details


The function illustrated here is continuous on the entire plane, but has no derivative on the unit circle. While no derivative exists on the unit circle, directional derivatives pointing from the origin approach infinity as we get close to the unit circle. The derivative at the origin is zero. Thus the surface is not only zero on the unit circle, but it drops to zero very quickly from it's local extrema at the origin.

If we sample on a uniform grid, some of the resulting polygons will have vertexes both inside and outside the unit circle. These polygons will never touch the x-y plane, and thus the surface will not appear to have a uniform zero set on the unit circle. At low resolution the results are so bad they are difficult to interpret. At higher resolutions we see what appears to be a jagged edge over the unit circle. Meaning the results are visually quite wrong, but an astute viewer might well guess the true behavior of the function from the resulting image. In order to correct this graph we need sample points in the triangulation that are on, or very near, the unit circle. We can do that by folding and resampling the cell complex on the unit circle.

  • How to drive up the sample rate near a particular SDF – so that we get higher resolution where the surface meets the plane.
  • How to "fold" the resulting triangles to achieve higher accuracy on the non-differentiable edge.
  • How to use tsampf_to_cdatf() & tsdf_to_csdf() to adapt functions designed for a MR_rect_tree for use with a MR_cell_cplx.

Definition in file surface_plot_corner.cpp.