Skip to content

Commit 97b1e95

Browse files
committed
more seed
1 parent c785456 commit 97b1e95

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

pygalmesh/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ def generate_from_array_with_subdomain_sizing(
442442
facet_distance=0.0,
443443
cell_radius_edge_ratio=0.0,
444444
verbose=True,
445+
seed=0,
445446
):
446447
assert vol.dtype in ["uint8", "uint16"]
447448
fh, inr_filename = tempfile.mkstemp(suffix=".inr")
@@ -460,6 +461,7 @@ def generate_from_array_with_subdomain_sizing(
460461
facet_distance,
461462
cell_radius_edge_ratio,
462463
verbose,
464+
seed,
463465
)
464466
os.remove(inr_filename)
465467
return mesh

src/generate_from_inr.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ generate_from_inr(
4747
const double facet_distance,
4848
const double cell_radius_edge_ratio,
4949
const double cell_size,
50-
const bool verbose
50+
const bool verbose,
51+
const int seed
5152
)
5253
{
54+
CGAL::get_default_random() = CGAL::Random(seed);
55+
5356
CGAL::Image_3 image;
5457
const bool success = image.read(inr_filename.c_str());
5558
if (!success) {

src/generate_from_inr.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ generate_from_inr_with_subdomain_sizing(
3939
const double facet_size = 0.0,
4040
const double facet_distance = 0.0,
4141
const double cell_radius_edge_ratio = 0.0,
42-
const bool verbose = true
42+
const bool verbose = true,
43+
const int seed = 0
4344
);
4445

4546
} // namespace pygalmesh

0 commit comments

Comments
 (0)