Engine prototype #13

Merged
glen merged 133 commits from engine-proto into main 2024-10-21 03:18:48 +00:00
Showing only changes of commit 023759a267 - Show all commits

View File

@ -31,6 +31,11 @@ end
append!(J, [6, 4, 6, 5, 7, 5, 7, 3, 8, 3, 8, 4]) append!(J, [6, 4, 6, 5, 7, 5, 7, 3, 8, 3, 8, 4])
append!(K, [4, 6, 5, 6, 5, 7, 3, 7, 3, 8, 4, 8]) append!(K, [4, 6, 5, 6, 5, 7, 3, 7, 3, 8, 4, 8])
append!(values, fill(-1, 12)) append!(values, fill(-1, 12))
#= make construction rigid
append!(J, [3, 4, 4, 5])
append!(K, [4, 3, 5, 4])
append!(values, fill(-0.5, 4))
=#
gram = sparse(J, K, values) gram = sparse(J, K, values)
# set initial guess (random) # set initial guess (random)
@ -42,6 +47,7 @@ gram = sparse(J, K, values)
## guess = Engine.rand_on_shell(fill(BigFloat(-1), 8)) ## guess = Engine.rand_on_shell(fill(BigFloat(-1), 8))
# set initial guess # set initial guess
#=
guess = hcat( guess = hcat(
Engine.plane(BigFloat[0, 0, 1], BigFloat(0)), Engine.plane(BigFloat[0, 0, 1], BigFloat(0)),
Engine.sphere(BigFloat[0, 0, 0], BigFloat(1//2)), Engine.sphere(BigFloat[0, 0, 0], BigFloat(1//2)),
@ -52,6 +58,17 @@ guess = hcat(
Engine.sphere(BigFloat[cos(-pi/3), sin(-pi/3), 0], BigFloat(1//5)), Engine.sphere(BigFloat[cos(-pi/3), sin(-pi/3), 0], BigFloat(1//5)),
Engine.sphere(BigFloat[cos(pi/3), sin(pi/3), 0], BigFloat(1//5)) Engine.sphere(BigFloat[cos(pi/3), sin(pi/3), 0], BigFloat(1//5))
) )
=#
guess = hcat(
Engine.plane(BigFloat[0, 0, 1], BigFloat(0)),
Engine.sphere(BigFloat[0, 0, 0], BigFloat(0.9)),
Engine.plane(BigFloat[1, 0, 0], BigFloat(1)),
Engine.plane(BigFloat[cos(2pi/3), sin(2pi/3), 0], BigFloat(1)),
Engine.plane(BigFloat[cos(-2pi/3), sin(-2pi/3), 0], BigFloat(1)),
Engine.sphere(4//3*BigFloat[-1, 0, 0], BigFloat(1//3)),
Engine.sphere(4//3*BigFloat[cos(-pi/3), sin(-pi/3), 0], BigFloat(1//3)),
Engine.sphere(4//3*BigFloat[cos(pi/3), sin(pi/3), 0], BigFloat(1//3))
)
# complete the gram matrix using gradient descent # complete the gram matrix using gradient descent
L, history = Engine.realize_gram(gram, guess, max_descent_steps = 200) L, history = Engine.realize_gram(gram, guess, max_descent_steps = 200)