You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add only the necessary nodes, I think that the sphere surface needs to be sampled from all three cartesian directions.
If you use only one direction, holes appear:
This happens because the angle between the surface normal and this direction is bigger than 45° (see left of where the arrow points).
If the surface is sampled from all three directions, no holes should appear. Positions at the opposite surface sides are trivial because of the symmetry.
Assume that the surface is sampled in Z direction (an orthographic projection). The height at (x,y) is then sqrt(r*r-x*x-y*y) if (x,y) is on the surface.
The (transposed) gradient is (-x/sqrt(r*r-x*x-y*y), -y/sqrt(r*r-x*x-y*y)). If both the (absolute value of the) x and y component of the gradient are less than one, holes cannot appear, so these positions need to be sampled in the Z direction. |-x/sqrt(r*r-x*x-y*y)| <= 1, x <= sqrt(r*r-x*x-y*y), x*x <= r*r-x*x-y*y, 2*x*x <= r*r-y*y
forall x, y:
if x*x+y*y <= r*r -- on circle, this test is actually redundant
and 2*x*x <= r*r-y*y and 2*y*y <= r*r-x*x then -- small gradient
z = round(sqrt(r*r-x*x-y*y))
-- add nodes at (x,y,z) and (x,y,-z)
end
end
-- do the same in X and Y directions
Why does the hollow sphere currently have more nodes than necessary?
The text was updated successfully, but these errors were encountered:
To add only the necessary nodes, I think that the sphere surface needs to be sampled from all three cartesian directions.
If you use only one direction, holes appear:
This happens because the angle between the surface normal and this direction is bigger than 45° (see left of where the arrow points).
If the surface is sampled from all three directions, no holes should appear. Positions at the opposite surface sides are trivial because of the symmetry.
Assume that the surface is sampled in Z direction (an orthographic projection). The height at (x,y) is then
sqrt(r*r-x*x-y*y)
if(x,y)
is on the surface.The (transposed) gradient is
(-x/sqrt(r*r-x*x-y*y), -y/sqrt(r*r-x*x-y*y))
. If both the (absolute value of the) x and y component of the gradient are less than one, holes cannot appear, so these positions need to be sampled in the Z direction.|-x/sqrt(r*r-x*x-y*y)| <= 1, x <= sqrt(r*r-x*x-y*y), x*x <= r*r-x*x-y*y, 2*x*x <= r*r-y*y
Why does the hollow sphere currently have more nodes than necessary?
The text was updated successfully, but these errors were encountered: