From 43cbf8a3a0c3e2152306876e8481fbcab797f7f8 Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Mon, 5 Feb 2024 00:10:13 -0500 Subject: [PATCH] Add relations to center and orient the construction --- engine-proto/Engine.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engine-proto/Engine.jl b/engine-proto/Engine.jl index 72b5923..ac9ed35 100644 --- a/engine-proto/Engine.jl +++ b/engine-proto/Engine.jl @@ -178,8 +178,17 @@ function realize(ctx::Construction{T}) where T # turn relations into equations eqns = vcat( equation.(ctx.relations), - [elt.rel for (_, elt) in eltenum if !isnothing(elt.rel)], + [elt.rel for (_, elt) in eltenum if !isnothing(elt.rel)] ) + + # add relations to center and orient the construction + if !isempty(ctx.points) + append!(eqns, [sum(pt.coords[k] for pt in ctx.points) for k in 1:3]) + end + if !isempty(ctx.spheres) + append!(eqns, [sum(sph.coords[k] for sph in ctx.spheres) for k in 3:4]) + end + Generic.Ideal(coordring, eqns) end