|
|
@ -48,7 +48,7 @@ fn main() { |
|
|
|
let c4 = relation::PointAngle::new_vertical(p1.clone(), p2.clone()); |
|
|
|
let c4 = relation::PointAngle::new_vertical(p1.clone(), p2.clone()); |
|
|
|
let c3 = relation::PointAngle::new_horizontal(p2.clone(), p3.clone()); |
|
|
|
let c3 = relation::PointAngle::new_horizontal(p2.clone(), p3.clone()); |
|
|
|
let c2 = relation::AlignedDistance::new_vertical(p1.clone(), p2.clone(), 12.); |
|
|
|
let c2 = relation::AlignedDistance::new_vertical(p1.clone(), p2.clone(), 12.); |
|
|
|
let c5 = relation::PointAngle::new(p1.clone(), p3.clone(), Rot2::from_angle_deg(45.)); |
|
|
|
let c5 = relation::PointAngle::new(p1.clone(), p3.clone(), Rot2::from_angle_deg(0.572938698)); |
|
|
|
let mut relations: Vec<Box<dyn Relation>> = |
|
|
|
let mut relations: Vec<Box<dyn Relation>> = |
|
|
|
vec![/*Box::new(c1),*/ Box::new(c2), Box::new(c3), Box::new(c4), Box::new(c5)]; |
|
|
|
vec![/*Box::new(c1),*/ Box::new(c2), Box::new(c3), Box::new(c4), Box::new(c5)]; |
|
|
|
let mut constrained: Vec<Box<dyn Relation>> = Vec::new(); |
|
|
|
let mut constrained: Vec<Box<dyn Relation>> = Vec::new(); |
|
|
@ -94,7 +94,7 @@ fn main() { |
|
|
|
let e2 = eqn::Eqn::new(eqn::Expr::Unkn(u2), eqn::Expr::Const(1.)); |
|
|
|
let e2 = eqn::Eqn::new(eqn::Expr::Unkn(u2), eqn::Expr::Const(1.)); |
|
|
|
let eqns = eqn::Eqns(vec![e1, e2]); |
|
|
|
let eqns = eqn::Eqns(vec![e1, e2]); |
|
|
|
for p in &mut points { |
|
|
|
for p in &mut points { |
|
|
|
p.borrow_mut().pos.evaluate_with(&eqns); |
|
|
|
p.borrow_mut().pos.resolve_with(&eqns); |
|
|
|
} |
|
|
|
} |
|
|
|
print_points(&points); |
|
|
|
print_points(&points); |
|
|
|
} |
|
|
|
} |
|
|
|