Skip to content

Commit

Permalink
fix: visited plane must be able to handle sqrt(3) in any direction
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Feb 14, 2024
1 parent a53a8a4 commit 3a674a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xs3d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ float cross_sectional_area_helper(
) {
std::vector<bool> ccl(sx * sy * sz);

uint64_t plane_size = 2 * std::max(std::max(sx,sy), sz);
uint64_t plane_size = 2 * sqrt(3) * std::max(std::max(sx,sy), sz) + 1;

// maximum possible size of plane
uint64_t psx = plane_size;
uint64_t psy = psx;

std::unique_ptr<bool[]> visited(new bool[psx * psy]());
std::vector<bool> visited(psx * psy);

Vec3 basis1 = normal.cross(ihat);
if (basis1.is_null()) {
Expand Down

0 comments on commit 3a674a5

Please sign in to comment.