fixed bug with zero area section modulus returning nans
This commit is contained in:
parent
2808e41238
commit
cdf68039f7
2 changed files with 2 additions and 1 deletions
|
@ -638,6 +638,7 @@ public:
|
|||
|
||||
auto compute_elastic_section_modulus = [&line_dir](
|
||||
const Vec3f ¢roid_accumulator, const Vec2f &second_moment_of_area_accumulator, const float &area) {
|
||||
if (area < EPSILON) return 0.0f;
|
||||
Vec3f centroid = centroid_accumulator / area;
|
||||
Vec2f variance = (second_moment_of_area_accumulator / area
|
||||
- centroid.head<2>().cwiseProduct(centroid.head<2>()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue