forked from glen/dyna3
Add relations to center and orient the construction
This commit is contained in:
parent
21f09c4a4d
commit
43cbf8a3a0
1 changed files with 10 additions and 1 deletions
|
@ -178,8 +178,17 @@ function realize(ctx::Construction{T}) where T
|
||||||
# turn relations into equations
|
# turn relations into equations
|
||||||
eqns = vcat(
|
eqns = vcat(
|
||||||
equation.(ctx.relations),
|
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)
|
Generic.Ideal(coordring, eqns)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue