Fixes to compile on MSVC

This commit is contained in:
tamasmeszaros 2022-06-20 16:52:59 +02:00
parent bf1303b9cf
commit f3d4a90721
3 changed files with 9 additions and 9 deletions

View File

@ -77,7 +77,7 @@ void build_tree(PointCloud &nodes, Builder &builder)
case BED: {
closest_node.weight = w;
if (closest_it->dst_branching > nodes.properties().max_branch_length()) {
auto hl_br_len = float(nodes.properties().max_branch_length()) / 2.;
auto hl_br_len = float(nodes.properties().max_branch_length()) / 2.f;
Node new_node {{node.pos.x(), node.pos.y(), node.pos.z() - hl_br_len}, node.Rmin};
new_node.id = int(nodes.next_junction_id());
new_node.weight = nodes.get(node_id).weight + hl_br_len;

View File

@ -34,9 +34,9 @@ inline BoundingBox3Base<Vec3f> get_support_cone_bb(const Vec3f &p, const Propert
double gnd = props.ground_level() - EPSILON;
double h = p.z() - gnd;
double phi = PI / 2 - props.max_slope();
double r = std::min(h * std::tan(phi), props.max_branch_length() * std::sin(phi));
auto r = float(std::min(h * std::tan(phi), props.max_branch_length() * std::sin(phi)));
Vec3f bb_min = {p.x() - r, p.y() - r, gnd};
Vec3f bb_min = {p.x() - r, p.y() - r, float(gnd)};
Vec3f bb_max = {p.x() + r, p.y() + r, p.z()};
return {bb_min, bb_max};
@ -221,7 +221,7 @@ public:
namespace bgi = boost::geometry::index;
float brln = 2 * m_props.max_branch_length();
BoundingBox3Base<Vec3f> bb{{pos.x() - brln, pos.y() - brln,
m_props.ground_level() - EPSILON},
float(m_props.ground_level() - EPSILON)},
{pos.x() + brln, pos.y() + brln,
m_ktree.bounds().max_corner().get<Z>()}};

View File

@ -185,7 +185,7 @@ bool is_outside_support_cone(const Vec3f &supp, const Vec3f &pt, float angle)
TEST_CASE("BranchingSupports::MergePointFinder", "[SLASupportGeneration][Branching]") {
SECTION("Identical points have the same merge point") {
Vec3f a{0.f, 0.f, 0.f}, b = a;
float slope = PI / 4.f;
auto slope = float(PI / 4.);
auto mergept = branchingtree::find_merge_pt(a, b, slope);
@ -200,7 +200,7 @@ TEST_CASE("BranchingSupports::MergePointFinder", "[SLASupportGeneration][Branchi
// | b * <= mergept
SECTION("Points at different heights have the lower point as mergepoint") {
Vec3f a{0.f, 0.f, 0.f}, b = {0.f, 0.f, -1.f};
float slope = PI / 4.f;
auto slope = float(PI / 4.);
auto mergept = branchingtree::find_merge_pt(a, b, slope);
@ -214,7 +214,7 @@ TEST_CASE("BranchingSupports::MergePointFinder", "[SLASupportGeneration][Branchi
// * <= mergept
SECTION("Points at different X have mergept in the middle at lower Z") {
Vec3f a{0.f, 0.f, 0.f}, b = {1.f, 0.f, 0.f};
float slope = PI / 4.f;
auto slope = float(PI / 4.);
auto mergept = branchingtree::find_merge_pt(a, b, slope);
@ -234,7 +234,7 @@ TEST_CASE("BranchingSupports::MergePointFinder", "[SLASupportGeneration][Branchi
// * <= mergept
SECTION("Points at different Y have mergept in the middle at lower Z") {
Vec3f a{0.f, 0.f, 0.f}, b = {0.f, 1.f, 0.f};
float slope = PI / 4.f;
auto slope = float(PI / 4.);
auto mergept = branchingtree::find_merge_pt(a, b, slope);
@ -250,7 +250,7 @@ TEST_CASE("BranchingSupports::MergePointFinder", "[SLASupportGeneration][Branchi
SECTION("Points separated by less than critical angle have the lower point as mergept") {
Vec3f a{0.f, 0.f, 0.f}, b = {-0.5f, -0.5f, -1.f};
float slope = PI / 4.f;
auto slope = float(PI / 4.);
auto mergept = branchingtree::find_merge_pt(a, b, slope);