fixed bug with zero area section modulus returning nans

This commit is contained in:
PavelMikus 2022-07-26 10:30:13 +02:00
parent 2808e41238
commit cdf68039f7
2 changed files with 2 additions and 1 deletions

View File

@ -638,6 +638,7 @@ public:
auto compute_elastic_section_modulus = [&line_dir](
const Vec3f &centroid_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>()));

View File

@ -10,7 +10,7 @@ namespace SupportSpotsGenerator {
struct Params {
// the algorithm should use the following units for all computations: distance [mm], mass [g], time [s], force [N]
const float bridge_distance = 12.0f; //mm
const float bridge_distance_decrease_by_curvature_factor = 5.0f; // allowed bridge distance = bridge_distance / (this factor * (curvature / PI) )
const float bridge_distance_decrease_by_curvature_factor = 3.0f; // allowed bridge distance = bridge_distance / (this factor * (curvature / PI) )
const float min_distance_between_support_points = 3.0f; //mm
const float support_points_interface_radius = 0.6f; // mm