BUGFIX: Torus: don't norm
alize 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:
@@ -20,7 +20,7 @@ dyn_clone::clone_trait_object!(Region);
|
|||||||
|
|
||||||
/// some (volume) which has a tangent vector everywhere inside/on it.
|
/// some (volume) which has a tangent vector everywhere inside/on it.
|
||||||
/// for example, a cylinder has tangents everywhere except its axis.
|
/// 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 {
|
pub trait HasCrossSection {
|
||||||
fn cross_section_normal(&self, p: Meters) -> Vec3<f32>;
|
fn cross_section_normal(&self, p: Meters) -> Vec3<f32>;
|
||||||
}
|
}
|
||||||
|
@@ -109,7 +109,7 @@ impl HasCrossSection for Torus {
|
|||||||
let axis = self.axis();
|
let axis = self.axis();
|
||||||
let to_coord = *coord - *self.center();
|
let to_coord = *coord - *self.center();
|
||||||
// this creates a normal which always points "counter-clockwise" along the shape
|
// this creates a normal which always points "counter-clockwise" along the shape
|
||||||
axis.cross(to_coord).norm()
|
axis.cross(to_coord)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user