Skip to content

Commit

Permalink
Problem calculating the cuts range.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Serrano committed May 26, 2017
1 parent 09a0b6d commit 4e5f0c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion geomodelr/cpp/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Model::Model( const std::tuple<std::tuple<double,double,double>, std::tuple<doub
point2 b0(g0(g0(bbox)), g1(g0(bbox)));
point2 b1(g0(g1(bbox)), g1(g1(bbox)));
point2 b2(g0(g0(bbox)), g1(g1(bbox)));
point2 b3(g1(g1(bbox)), g1(g0(bbox)));
point2 b3(g0(g1(bbox)), g1(g0(bbox)));

auto cut = [base_point, direction]( point2& v ) {
geometry::subtract_point(v, base_point);
Expand All @@ -44,6 +44,7 @@ Model::Model( const std::tuple<std::tuple<double,double,double>, std::tuple<doub

vector<double> cuts = { cut(b0), cut(b1), cut(b2), cut(b3) };
std::sort(cuts.begin(), cuts.end());

this->cuts_range = std::make_pair(cuts[0], cuts[3]);
}

Expand Down

0 comments on commit 4e5f0c5

Please sign in to comment.