Skip to content

Commit

Permalink
Allow triangles in polygon masking (fixes #757) (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
biochem-fan authored Oct 15, 2024
1 parent 4aadf21 commit 20e2a6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/761.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
+ allow triangles in polygon masking
2 changes: 1 addition & 1 deletion src/dxtbx/masking/masking.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace dxtbx { namespace masking {
*/
void mask_untrusted_polygon(scitbx::af::ref<bool, scitbx::af::c_grid<2> > mask,
const scitbx::af::const_ref<vec2<double> > &polygon) {
DXTBX_ASSERT(polygon.size() > 3);
DXTBX_ASSERT(polygon.size() >= 3);
std::size_t height = mask.accessor()[0];
std::size_t width = mask.accessor()[1];
int x0 = (int)std::floor(polygon[0][0]);
Expand Down

0 comments on commit 20e2a6e

Please sign in to comment.