Use ghost mode to put key elements within reach

Also, remove formatting errors and old code.
This commit is contained in:
Aaron Fenyes 2025-06-12 11:51:47 -07:00
parent 6928ac8765
commit f1fea9e40e

View file

@ -9,6 +9,7 @@ use crate::{
AppState,
assembly::{
Assembly,
Element,
ElementColor,
InversiveDistanceRegulator,
Point,
@ -253,15 +254,16 @@ fn load_irisawa_hexlet_assemb(assembly: &Assembly) {
let _ = assembly.try_insert_element(sphere);
}
// fix the curvature of the outer sphere
// put the outer sphere in ghost mode and fix its curvature
let outer = assembly.elements_by_id.with_untracked(
|elts_by_id| elts_by_id["outer"].clone()
);
outer.ghost().set(true);
let outer_curvature_regulator = outer.regulators().with_untracked(
|regs| regs.first().unwrap().clone()
);
outer_curvature_regulator.set_point().set(
SpecifiedValue::try_from((1.0 / 3.0/*30.0*/).to_string()).unwrap()
SpecifiedValue::try_from((1.0 / 3.0).to_string()).unwrap()
);
// impose the desired tangencies
@ -380,6 +382,7 @@ fn load_radius_ratio_assemb(assembly: &Assembly) {
}
);
for face in faces {
face.ghost().set(true);
let _ = assembly.try_insert_element(face);
}