Skip to content

Commit

Permalink
Correctly handle the nan init values when figuring out the bounding b…
Browse files Browse the repository at this point in the history
…ox extents
  • Loading branch information
Chrismarsh committed Oct 25, 2024
1 parent ef8ee8e commit e1b12eb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/mesh/triangulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ void triangulation::from_json(pt::ptree &mesh)
_max_z = std::max(_max_z,vertex[2]);
_min_z = std::min(_min_z,vertex[2]);

_bounding_box.x_max = std::max(_bounding_box.x_max, vertex[0]);
_bounding_box.x_min = std::min(_bounding_box.x_min, vertex[0]);
_bounding_box.x_max = std::fmax(_bounding_box.x_max, vertex[0]);
_bounding_box.x_min = std::fmin(_bounding_box.x_min, vertex[0]);

_bounding_box.y_max = std::max(_bounding_box.y_max, vertex[1]);
_bounding_box.y_min = std::min(_bounding_box.y_min, vertex[1]);
_bounding_box.y_max = std::fmax(_bounding_box.y_max, vertex[1]);
_bounding_box.y_min = std::fmin(_bounding_box.y_min, vertex[1]);


Vertex_handle Vh = this->create_vertex();
Expand Down Expand Up @@ -879,11 +879,11 @@ void triangulation::load_mesh_from_h5(const std::string& mesh_filename)
_max_z = std::max(_max_z, vertex[i][2]);
_min_z = std::min(_min_z, vertex[i][2]);

_bounding_box.x_max = std::max(_bounding_box.x_max, vertex[i][0]);
_bounding_box.x_min = std::min(_bounding_box.x_min, vertex[i][0]);
_bounding_box.x_max = std::fmax(_bounding_box.x_max, vertex[i][0]);
_bounding_box.x_min = std::fmin(_bounding_box.x_min, vertex[i][0]);

_bounding_box.y_max = std::max(_bounding_box.y_max, vertex[i][1]);
_bounding_box.y_min = std::min(_bounding_box.y_min, vertex[i][1]);
_bounding_box.y_max = std::fmax(_bounding_box.y_max, vertex[i][1]);
_bounding_box.y_min = std::fmin(_bounding_box.y_min, vertex[i][1]);

Vertex_handle Vh = this->create_vertex();
Vh->set_point(pt);
Expand Down

0 comments on commit e1b12eb

Please sign in to comment.