Skip to content

Commit

Permalink
update the PoissonDiskSampler test
Browse files Browse the repository at this point in the history
  • Loading branch information
nzfeng committed Aug 24, 2024
1 parent 129494d commit b97d026
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions test/src/poisson_disk_sampler_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,8 @@ size_t sampleSquareDisk(double width, double sampling_distance) {
std::unique_ptr<VertexPositionGeometry> geometry;
std::tie(mesh, geometry) = makeManifoldSurfaceMeshAndGeometry(simpleMesh.polygons, simpleMesh.vertexCoordinates);

geometry->requireEdgeLengths();
double meanEdgeLength = 0.;
for (auto e : mesh->edges()) {
meanEdgeLength += geometry->edgeLengths[e];
}
meanEdgeLength /= mesh->nEdges();
geometry->unrequireEdgeLengths();

PoissonDiskOptions options;
options.rCoef = sampling_distance / meanEdgeLength;
options.r = sampling_distance;

// make tests reproducible
geometrycentral::util_mersenne_twister.seed(101);
Expand Down

0 comments on commit b97d026

Please sign in to comment.