Skip to content

Commit 0ddcb67

Browse files
authored
Merge pull request #169 from nschloe/exude-time
expose more exude options
2 parents f34de13 + 5b78828 commit 0ddcb67

10 files changed

Lines changed: 68 additions & 8 deletions

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pygalmesh.svg?style=flat-square)](https://pypi.org/pypi/pygalmesh/)
1010
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5564818.svg?style=flat-square)](https://doi.org/10.5281/zenodo.5564818)
1111
[![GitHub stars](https://img.shields.io/github/stars/nschloe/pygalmesh.svg?style=flat-square&label=Stars&logo=github)](https://github.com/nschloe/pygalmesh)
12-
[![PyPi downloads](https://img.shields.io/pypi/dm/pygalmesh.svg?style=flat-square)](https://pypistats.org/packages/pygalmesh)
12+
[![Downloads](https://pepy.tech/badge/pygalmesh/month?style=flat-square)](https://pepy.tech/project/pygalmesh)
13+
<!--[![PyPi downloads](https://img.shields.io/pypi/dm/pygalmesh.svg?style=flat-square)](https://pypistats.org/packages/pygalmesh)-->
1314

1415
[![Discord](https://img.shields.io/static/v1?logo=discord&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/Z6DMsJh4Hr)
1516

@@ -295,7 +296,7 @@ mesh = pygalmesh.generate_surface_mesh(
295296
```
296297

297298
Refer to [CGAL's
298-
documention](https://doc.cgal.org/latest/Surface_mesher/index.html) for the
299+
documentation](https://doc.cgal.org/latest/Surface_mesher/index.html) for the
299300
options.
300301

301302
#### Periodic volume meshes

pygalmesh/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def generate_mesh(
4343
max_facet_distance: float = 0.0,
4444
max_circumradius_edge_ratio: float = 0.0,
4545
max_cell_circumradius: float | Callable[..., float] = 0.0,
46+
exude_time_limit: float = 0.0,
47+
exude_sliver_bound: float = 0.0,
4648
verbose: bool = True,
4749
seed: int = 0,
4850
):
@@ -121,6 +123,8 @@ def _select(obj):
121123
max_circumradius_edge_ratio=max_circumradius_edge_ratio,
122124
max_cell_circumradius_value=max_cell_circumradius_value,
123125
max_cell_circumradius_field=max_cell_circumradius_field,
126+
exude_time_limit=exude_time_limit,
127+
exude_sliver_bound=exude_sliver_bound,
124128
verbose=verbose,
125129
seed=seed,
126130
)
@@ -244,6 +248,8 @@ def generate_volume_mesh_from_surface_mesh(
244248
max_facet_distance: float = 0.0,
245249
max_circumradius_edge_ratio: float = 0.0,
246250
max_cell_circumradius: float = 0.0,
251+
exude_time_limit: float = 0.0,
252+
exude_sliver_bound: float = 0.0,
247253
verbose: bool = True,
248254
reorient: bool = False,
249255
seed: int = 0,
@@ -270,6 +276,8 @@ def generate_volume_mesh_from_surface_mesh(
270276
max_facet_distance=max_facet_distance,
271277
max_circumradius_edge_ratio=max_circumradius_edge_ratio,
272278
max_cell_circumradius=max_cell_circumradius,
279+
exude_time_limit=exude_time_limit,
280+
exude_sliver_bound=exude_sliver_bound,
273281
verbose=verbose,
274282
reorient=reorient,
275283
seed=seed,
@@ -293,6 +301,8 @@ def generate_from_inr(
293301
max_facet_distance: float = 0.0,
294302
max_circumradius_edge_ratio: float = 0.0,
295303
max_cell_circumradius: float | dict[int | str, float] = 0.0,
304+
exude_time_limit: float = 0.0,
305+
exude_sliver_bound: float = 0.0,
296306
verbose: bool = True,
297307
seed: int = 0,
298308
):
@@ -313,6 +323,8 @@ def generate_from_inr(
313323
max_facet_distance=max_facet_distance,
314324
max_circumradius_edge_ratio=max_circumradius_edge_ratio,
315325
max_cell_circumradius=max_cell_circumradius,
326+
exude_time_limit=exude_time_limit,
327+
exude_sliver_bound=exude_sliver_bound,
316328
verbose=verbose,
317329
seed=seed,
318330
)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pygalmesh
3-
version = 0.10.5
3+
version = 0.10.6
44
author = Nico Schlömer
55
author_email = nico.schloemer@gmail.com
66
description = Python frontend to CGAL's mesh generation capabilities

src/generate.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ generate_mesh(
7272
const double max_cell_circumradius_value,
7373
const std::shared_ptr<pygalmesh::SizingFieldBase> & max_cell_circumradius_field,
7474
//
75+
const double exude_time_limit,
76+
const double exude_sliver_bound,
77+
//
7578
const bool verbose,
7679
const int seed
7780
)
@@ -166,7 +169,12 @@ generate_mesh(
166169
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
167170
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
168171
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
169-
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude()
172+
exude ?
173+
CGAL::parameters::exude(
174+
CGAL::parameters::time_limit = exude_time_limit,
175+
CGAL::parameters::sliver_bound = exude_sliver_bound
176+
) :
177+
CGAL::parameters::no_exude()
170178
);
171179
if (!verbose) {
172180
std::cerr.clear();

src/generate.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ void generate_mesh(
3737
const double max_cell_circumradius_value = 0.0,
3838
const std::shared_ptr<pygalmesh::SizingFieldBase> & max_cell_circumradius_field = nullptr,
3939
//
40+
const double exude_time_limit = 0.0,
41+
const double exude_sliver_bound = 0.0,
42+
//
4043
const bool verbose = true,
4144
const int seed = 0
4245
);

src/generate_from_inr.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ generate_from_inr(
4747
const double max_facet_distance,
4848
const double max_circumradius_edge_ratio,
4949
const double max_cell_circumradius,
50+
const double exude_time_limit,
51+
const double exude_sliver_bound,
5052
const bool verbose,
5153
const int seed
5254
)
@@ -80,7 +82,12 @@ generate_from_inr(
8082
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
8183
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
8284
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
83-
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude()
85+
exude ?
86+
CGAL::parameters::exude(
87+
CGAL::parameters::time_limit = exude_time_limit,
88+
CGAL::parameters::sliver_bound = exude_sliver_bound
89+
) :
90+
CGAL::parameters::no_exude()
8491
);
8592
if (!verbose) {
8693
std::cerr.clear();
@@ -110,6 +117,8 @@ generate_from_inr_with_subdomain_sizing(
110117
const double max_radius_surface_delaunay_ball,
111118
const double max_facet_distance,
112119
const double max_circumradius_edge_ratio,
120+
const double exude_time_limit,
121+
const double exude_sliver_bound,
113122
const bool verbose,
114123
const int seed
115124
)
@@ -148,7 +157,12 @@ generate_from_inr_with_subdomain_sizing(
148157
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
149158
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
150159
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
151-
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude()
160+
exude ?
161+
CGAL::parameters::exude(
162+
CGAL::parameters::time_limit = exude_time_limit,
163+
CGAL::parameters::sliver_bound = exude_sliver_bound
164+
) :
165+
CGAL::parameters::no_exude()
152166
);
153167
if (!verbose) {
154168
std::cerr.clear();

src/generate_from_inr.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ void generate_from_inr(
1919
const double max_facet_distance = 0.0,
2020
const double max_circumradius_edge_ratio = 0.0,
2121
const double max_cell_circumradius = 0.0,
22+
const double exude_time_limit = 0.0,
23+
const double exude_sliver_bound = 0.0,
2224
const bool verbose = true,
2325
const int seed = 0
2426
);
@@ -39,7 +41,9 @@ generate_from_inr_with_subdomain_sizing(
3941
const double max_radius_surface_delaunay_ball = 0.0,
4042
const double max_facet_distance = 0.0,
4143
const double max_circumradius_edge_ratio = 0.0,
42-
const bool verbose = true,
44+
const double exude_time_limit = 0.0,
45+
const double exude_sliver_bound = 0.0,
46+
const bool verbose = true,
4347
const int seed = 0
4448
);
4549

src/generate_from_off.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ void generate_from_off(
5959
const double max_facet_distance,
6060
const double max_circumradius_edge_ratio,
6161
const double max_cell_circumradius,
62+
const double exude_time_limit,
63+
const double exude_sliver_bound,
6264
const bool verbose,
6365
const bool reorient,
6466
const int seed
@@ -135,7 +137,13 @@ void generate_from_off(
135137
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
136138
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
137139
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
138-
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude());
140+
exude ?
141+
CGAL::parameters::exude(
142+
CGAL::parameters::time_limit = exude_time_limit,
143+
CGAL::parameters::sliver_bound = exude_sliver_bound
144+
) :
145+
CGAL::parameters::no_exude()
146+
);
139147
if (!verbose) {
140148
std::cerr.clear();
141149
}

src/generate_from_off.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ generate_from_off(
2020
const double max_facet_distance = 0.0,
2121
const double max_circumradius_edge_ratio = 0.0,
2222
const double max_cell_circumradius = 0.0,
23+
const double exude_time_limit = 0.0,
24+
const double exude_sliver_bound = 0.0,
2325
const bool verbose = true,
2426
const bool reorient = false,
2527
const int seed = 0

src/pybind11.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
286286
py::arg("max_circumradius_edge_ratio") = 0.0,
287287
py::arg("max_cell_circumradius_value") = 0.0,
288288
py::arg("max_cell_circumradius_field") = nullptr,
289+
py::arg("exude_time_limit") = 0.0,
290+
py::arg("exude_sliver_bound") = 0.0,
289291
py::arg("verbose") = true,
290292
py::arg("seed") = 0
291293
);
@@ -333,6 +335,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
333335
py::arg("max_facet_distance") = 0.0,
334336
py::arg("max_circumradius_edge_ratio") = 0.0,
335337
py::arg("max_cell_circumradius") = 0.0,
338+
py::arg("exude_time_limit") = 0.0,
339+
py::arg("exude_sliver_bound") = 0.0,
336340
py::arg("verbose") = true,
337341
py::arg("reorient") = false,
338342
py::arg("seed") = 0
@@ -351,6 +355,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
351355
py::arg("max_facet_distance") = 0.0,
352356
py::arg("max_circumradius_edge_ratio") = 0.0,
353357
py::arg("max_cell_circumradius") = 0.0,
358+
py::arg("exude_time_limit") = 0.0,
359+
py::arg("exude_sliver_bound") = 0.0,
354360
py::arg("verbose") = true,
355361
py::arg("seed") = 0
356362
);
@@ -370,6 +376,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
370376
py::arg("max_radius_surface_delaunay_ball") = 0.0,
371377
py::arg("max_facet_distance") = 0.0,
372378
py::arg("max_circumradius_edge_ratio") = 0.0,
379+
py::arg("exude_time_limit") = 0.0,
380+
py::arg("exude_sliver_bound") = 0.0,
373381
py::arg("verbose") = true,
374382
py::arg("seed") = 0
375383
);

0 commit comments

Comments
 (0)