BUGFIX: Torus: don't normalize the cross section normal

this would have led to incorrectly scaled current measurements
(but not incorrect current generation). we were likely severely
over-estimating the current.
This commit is contained in:
2022-08-12 00:37:39 -07:00
parent ae1eb861be
commit 090b1ca09a
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ dyn_clone::clone_trait_object!(Region);
/// some (volume) which has a tangent vector everywhere inside/on it.
/// for example, a cylinder has tangents everywhere except its axis.
/// the return vector should be normalized, or zero.
/// the returned vector should represent the area of the cross section.
pub trait HasCrossSection {
fn cross_section_normal(&self, p: Meters) -> Vec3<f32>;
}

View File

@@ -109,7 +109,7 @@ impl HasCrossSection for Torus {
let axis = self.axis();
let to_coord = *coord - *self.center();
// this creates a normal which always points "counter-clockwise" along the shape
axis.cross(to_coord).norm()
axis.cross(to_coord)
}
}