void SetUp(const ::benchmark::State& state) { int N = state.range(0); points.clear(); for (int i = 0; i < N; ++i) { points.append(makeVec()); } }
JET_BEGIN_TEST_F(ZhuBridsonPointsToImplicit3, ConvertTwo) { Array1<Vector3D> points; std::mt19937 rng{0}; std::uniform_real_distribution<> dist(0.2, 0.8); for (size_t i = 0; i < 2; ++i) { points.append({dist(rng), dist(rng), dist(rng)}); } VertexCenteredScalarGrid3 grid(128, 128, 128, 1.0 / 128, 1.0 / 128, 1.0 / 128); ZhuBridsonPointsToImplicit3 converter(0.6, 0.25); converter.convert(points.constAccessor(), &grid); TriangleMesh3 triMesh; marchingCubes(grid.constDataAccessor(), grid.gridSpacing(), grid.dataOrigin(), &triMesh, 0, kDirectionAll); saveTriangleMeshData(triMesh, "zhu_bridson_points_to_implicit3_convert_two.obj"); }