Skip to content

Commit

Permalink
Update src/utilities/geometry/Intersection.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Marrec <[email protected]>
  • Loading branch information
ggartside and jmarrec authored Mar 3, 2023
1 parent b270448 commit bacbb94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utilities/geometry/Intersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,11 @@ std::ostream& operator<<(std::ostream& os, const BoostMultiPolygon& boostPolygon
return os;
}

// Scale factor for parameters passed to boost
double scaleBy = 1000.0;
// Scale factor for parameters when converting between openstudio and boost data formats to improve the numerical accuracy of the boolean operations.
// Idea came from this comment in the boostorg/geometry repo: https://github.com/boostorg/geometry/issues/1034#issuecomment-1284180101
// where the author indicates that scaling the values by 10 improved the result and talks about rounding to an integer grid,
// so by increasing the range of values we pass to boost we should be improving the resolution of the integer rounding
static constexpr double scaleBy = 1000.0;

// Cleans a polygon by shrinking and expanding. Can return multiple polygons
std::vector<BoostPolygon> removeSpikesEx(const BoostPolygon& polygon) {
Expand Down

0 comments on commit bacbb94

Please sign in to comment.