Skip to content

Commit

Permalink
Update AutoBody.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
weymouth committed Oct 5, 2023
1 parent 66a8e79 commit 3b40b0e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/AutoBody.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function measure(body::AutoBody,x,t)
# eval d=f(x,t), and n̂ = ∇f
d = body.sdf(x,t)
n = ForwardDiff.gradient(x->body.sdf(x,t), x)
any(isnan.(n)) && return (d,zero(x),zero(x))

# correct general implicit fnc f(x₀)=0 to be a pseudo-sdf
# f(x) = f(x₀)+d|∇f|+O(d²) ∴ d ≈ f(x)/|∇f|
Expand Down

0 comments on commit 3b40b0e

Please sign in to comment.