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](
|
auto compute_elastic_section_modulus = [&line_dir](
|
||||||
const Vec3f ¢roid_accumulator, const Vec2f &second_moment_of_area_accumulator, const float &area) {
|
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;
|
Vec3f centroid = centroid_accumulator / area;
|
||||||
Vec2f variance = (second_moment_of_area_accumulator / area
|
Vec2f variance = (second_moment_of_area_accumulator / area
|
||||||
- centroid.head<2>().cwiseProduct(centroid.head<2>()));
|
- centroid.head<2>().cwiseProduct(centroid.head<2>()));
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace SupportSpotsGenerator {
|
||||||
struct Params {
|
struct Params {
|
||||||
// the algorithm should use the following units for all computations: distance [mm], mass [g], time [s], force [N]
|
// 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 = 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 min_distance_between_support_points = 3.0f; //mm
|
||||||
const float support_points_interface_radius = 0.6f; // mm
|
const float support_points_interface_radius = 0.6f; // mm
|
||||||
|
|
Loading…
Reference in a new issue