Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tet remeshing - add sizing field #7830

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
291 commits
Select commit Hold shift + click to select a range
385e770
remove unused typedefs
janetournois Nov 3, 2023
1bbbc0a
cleaning after 2 previous commits
janetournois Nov 3, 2023
778cd85
Merge branch 'Tet_remeshing-with_sizing_field-jtournois' of https://g…
janetournois Nov 3, 2023
e96b180
use only const ref to sizing function
janetournois Nov 3, 2023
1ced7d7
there is no need to take the sqrt here!
janetournois Nov 3, 2023
8e6858c
remove useless named parameter
janetournois Nov 3, 2023
d1a7895
use adaptive sizing in demo plugin
janetournois Nov 3, 2023
a849daf
attempt to improve the sizing field
janetournois Nov 3, 2023
6798daa
add dependency to Spatial_searching
janetournois Nov 6, 2023
eb2605d
another interpolation scheme
janetournois Nov 7, 2023
ece066a
remove interpolation and keep only the sizing at closest point in kd-…
janetournois Nov 7, 2023
cbaf0e6
clean example
janetournois Nov 7, 2023
bf33ce9
add default named parameters
janetournois Nov 7, 2023
94a158c
rename adaptive example and add another one with synthetic sizing
janetournois Nov 7, 2023
d586305
reorder functions to document the one with sizing field
janetournois Nov 7, 2023
ede299e
add concept and classes
janetournois Nov 7, 2023
55780bf
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Nov 21, 2023
ac6e720
user manual
janetournois Nov 21, 2023
46e7715
add example
janetournois Nov 21, 2023
1f4601f
add new examples to doc
janetournois Nov 21, 2023
1099b6b
wip doc
janetournois Nov 23, 2023
494c18e
use sqd from traits
janetournois Nov 23, 2023
29a296b
doc
janetournois Nov 24, 2023
e218736
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Nov 28, 2023
0f03f1c
reset file to master branch version (not used in tet remeshing eventu…
janetournois Nov 28, 2023
431bacb
Merge branch 'Polyhedron_demo-fix_double_edit-jtournois' into Tet_rem…
janetournois Dec 1, 2023
8b5c27b
Merge branch 'Polyhedron_demo-fix_double_edit-jtournois' into Tet_rem…
janetournois Dec 1, 2023
5bb2533
add figures for Tetrahedral_remeshing with sizing
janetournois Dec 1, 2023
9f1d0f4
add examples in the user manual
janetournois Dec 1, 2023
a3a1a32
add concept RemeshingSizingField_3
janetournois Dec 1, 2023
cef415f
rename image label (duplicate with PMP)
janetournois Dec 1, 2023
e147cfd
remove duplicate
janetournois Dec 1, 2023
93ac33a
missing \ref
janetournois Dec 1, 2023
8a2b2bb
add hidden named parameter for extra flip-and-smooth iterations
janetournois Dec 1, 2023
00166a9
fix warnings
sloriot Dec 5, 2023
d9df110
fix more warnings
sloriot Dec 5, 2023
41a4800
add vertex_id_map() function
janetournois Dec 11, 2023
3000767
extract smooth_edges_in_complex
janetournois Dec 12, 2023
a8e4387
factorization of duplicate code
janetournois Dec 12, 2023
dc51bcc
Merge branch 'Tet_remeshing-with_sizing_field-jtournois' of https://g…
janetournois Dec 12, 2023
9731aec
extract code to smooth_vertices_on_surfaces()
janetournois Dec 14, 2023
e560936
reordering and reduce duplicate code
janetournois Dec 14, 2023
bb0fed5
smoothed_positions and neighbors can be made internal
janetournois Dec 14, 2023
17016b6
reorganization by dimension
janetournois Dec 14, 2023
b533acf
wip sizing in smoothing
janetournois Dec 21, 2023
32b5492
make fastProjectionCPU more consistent with original code
janetournois Dec 21, 2023
e31259e
use sizing and density to define masses in smoothing
janetournois Dec 21, 2023
c315dee
Merge branch 'Tet_remeshing-with_sizing_field-jtournois' into Tet_rem…
janetournois Jan 4, 2024
9e69592
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-wip-jto…
janetournois Jan 4, 2024
3e903c1
cleaning
janetournois Jan 4, 2024
c8812d6
avoid conversion warning
janetournois Jan 4, 2024
72c9eb7
[flip] add verbosity
janetournois Jan 4, 2024
88d1d4e
[flips] do not use cache sliver value when it's not valid,
janetournois Jan 5, 2024
05473f1
[flip] use optional pointer
janetournois Jan 8, 2024
1ce6685
[flip] snap cosine to [-1., 1.] when computed in doubles
janetournois Jan 9, 2024
1ea551b
[flip] display min_dihedral_angle after each step of remeshing
janetournois Jan 9, 2024
ffc2a96
[flip] remove useless optional
janetournois Jan 9, 2024
7429066
[flip] reset sliver cache that may have been populated with dihedral …
janetournois Jan 9, 2024
37925c5
Merge branch 'Tet_remeshing-flips_on_surface-jtournois' into Tet_reme…
janetournois Jan 9, 2024
e363976
[smoothing] mass should be density, not density * size
janetournois Jan 11, 2024
77fbb6d
Merge branch 'Tet_remeshing-with_sizing_field-jtournois' into Tet_rem…
janetournois Jan 11, 2024
85179e9
remove duplicate assertion code
janetournois Jan 11, 2024
906253b
add debug code
janetournois Jan 12, 2024
bab358a
collapse was leaving some complex edges behind
janetournois Jan 12, 2024
2abcf52
shorten is_smoothable check for feature vertices
janetournois Jan 12, 2024
dad1af1
add debug code
janetournois Jan 12, 2024
71c47b5
add debug macro
janetournois Jan 12, 2024
28ad54b
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Jan 15, 2024
84f5e8c
improve smoothing along features
janetournois Jan 16, 2024
a35ed6b
remove dump
janetournois Jan 16, 2024
d375cec
add case std::variant<T> to io_signature.h
janetournois Jan 16, 2024
10dc5b6
fix max_curve_index when no curve is pre-defined, though constraints …
janetournois Jan 16, 2024
86e3b1f
improve generation of cube input
janetournois Jan 16, 2024
239c3e5
add an example with features and sizing field
janetournois Jan 16, 2024
42d8ae5
minor reorganization
janetournois Jan 18, 2024
c7bdeb6
use Mesh_3 to generate the input triangulation
janetournois Jan 18, 2024
c6d6d80
re-insert constraints after split
janetournois Jan 18, 2024
3b3fa6a
clean example
janetournois Jan 18, 2024
4e42d63
fix input generation
janetournois Jan 18, 2024
001ddcf
link new example with Eigen
janetournois Jan 18, 2024
4035ecf
Merge branch 'Tet_remeshing-with_sizing_field-jtournois' into Tet_rem…
janetournois Jan 18, 2024
13c6f07
Merge branch 'Tet_remeshing-flips_on_surface-jtournois' into Tet_reme…
janetournois Jan 18, 2024
965f587
do not use MLS projection on features
janetournois Jan 18, 2024
69ade33
activate smoothing along features
janetournois Jan 18, 2024
5794c1f
Merge branch 'Tet_remeshing-with_sizing_field-jtournois' into Tet_rem…
janetournois Jan 18, 2024
03b7687
[smooth] reorganize smoothing before freezing vertices
janetournois Jan 19, 2024
ef39f52
[smooth] during flip-smooth steps, perform smoothing iff it improves …
janetournois Jan 23, 2024
013a333
[smooth] use get() for optional
janetournois Jan 23, 2024
9f8e368
[smooth] add helper functions
janetournois Jan 23, 2024
55bb9c7
[smooth] optional code to collapse only under angle condition
janetournois Jan 23, 2024
77805fd
[smooth] do not forget cells_to_update in pre-collapse max cos
janetournois Jan 25, 2024
f2a1d3c
[smooth] reorganize/clean access to vertex_id_map and free_vertices
janetournois Jan 25, 2024
a4015d1
[smooth] use m_vertex_id and m_free_vertices everywhere in class func…
janetournois Jan 25, 2024
faacad2
[smooth] do not collect incident cells for non free vertices
janetournois Jan 25, 2024
0dd99d0
[smooth] remove unused parameters
janetournois Jan 25, 2024
7147f9b
[smooth] use vertices_surface_indices, and fill it iff it's needed
janetournois Jan 25, 2024
c7174e0
[smooth] pass only the needed parameters
janetournois Jan 25, 2024
ae7c670
[collapse] remove macro-protection for collapse under angle condition
janetournois Jan 25, 2024
a1fc37d
[flip] fix verbose mode
janetournois Jan 25, 2024
23d937e
[flip] fix warnings
janetournois Jan 26, 2024
352671d
[smooth] fix warnings
janetournois Jan 26, 2024
4b3d6bf
[flip] fix more warnings
janetournois Jan 26, 2024
41a5ab2
[sizing] remove 'high' that does not exist anymore
janetournois Jan 30, 2024
b433056
[flip] check vertices_subdomain_indices[v] == 2 at both endpoints!
janetournois Jan 30, 2024
4562440
[todo] set as corners the vertices where incident complex edges form …
janetournois Jan 30, 2024
b562ffe
[sizing] move max_dimension_ helper function to helpers header
janetournois Jan 30, 2024
a1dbf85
[sizing] use sizing in max-edge-length condition, post-collapse
janetournois Jan 30, 2024
bd5ddff
[collapse] use fallback to other collapse strategies when TO_MIDPOINT…
janetournois Jan 30, 2024
39587cd
[sizing] remove useless comment
janetournois Jan 30, 2024
a979378
[flip] add non-manifold edges to the initial edge-complex
janetournois Feb 1, 2024
6829bb3
[flip] flipBoundaryEdges cleaning
janetournois Feb 1, 2024
e777601
[flip] reindent piece of code
janetournois Feb 1, 2024
83e12d0
[flip] add third_vertex(f) helper function
janetournois Feb 1, 2024
72fb087
Merge branch 'Tet_remeshing-flips_on_surface-jtournois' into Tet_reme…
janetournois Feb 2, 2024
30bb1c5
fix previous merge conflicts
janetournois Feb 2, 2024
63e7d78
Merge branch 'Tet_remeshing-flips_on_surface-jtournois' into Tet_reme…
janetournois Feb 5, 2024
1d18cd9
[sizing] add assertions
janetournois Feb 16, 2024
008e004
[sizing] when sizing for dim < 3 is set to 0, deduce size from neighb…
janetournois Feb 16, 2024
b7224a1
[sizing] use size_at_midpoint and remove size_at_point
janetournois Feb 16, 2024
6ef0734
[sizing] use average sizing in incident cells instead of max and min …
janetournois Feb 16, 2024
d2a2c68
[sizing] use average size everywhere consistently
janetournois Feb 16, 2024
2da33ac
[sizing] add macros for experimentation average/min/max
janetournois Feb 19, 2024
2000618
[sizing] tune examples
janetournois Feb 19, 2024
85da35d
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Feb 22, 2024
45ea454
use helpers
janetournois Feb 22, 2024
258b4d3
introduce new constructor in Kd_tree
janetournois Mar 7, 2024
7670f15
(wip) use one aabb_tree per surface_patch, and the kd_tree, to estima…
janetournois Mar 7, 2024
0f0e32a
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Mar 7, 2024
cbe0fff
use Remesher_types and reduce code size
janetournois Mar 7, 2024
69d6373
examples...
janetournois Mar 7, 2024
2486da4
deal with non manifold surfaces
janetournois Mar 18, 2024
042b2cb
wip adaptive sizing field
janetournois Mar 18, 2024
552c37a
clean types and improve readability
janetournois Mar 18, 2024
7aa45b0
fix include
janetournois Mar 18, 2024
9ffd2a5
add missing Eigen
janetournois Mar 19, 2024
e396633
during smoothing, reproject on an AABB tree of triangles, made from i…
janetournois Mar 21, 2024
a75ab7b
project 1D vertices on an AABB tree of segments
janetournois Mar 21, 2024
6d4af31
add an epsilon do decide projection on AABB_tree strategy
janetournois Mar 21, 2024
0548bee
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Mar 21, 2024
f547b1d
use function input_is_c3t3()
janetournois Mar 22, 2024
9bd817e
remesh fandisk to deal with darts and cusps
janetournois Mar 22, 2024
63e2e58
fix compilation (projection with MLS)
janetournois Mar 22, 2024
f035279
secure initial calls to is_in_complex()
janetournois Mar 22, 2024
1da3feb
remove skeleton
janetournois Mar 22, 2024
193c343
add dependency on aabbtree
janetournois Mar 22, 2024
30b9a63
add missing include
janetournois Mar 22, 2024
4c2f382
useless includes
janetournois Mar 22, 2024
918f175
fix collapse condition when boundary remeshing is disabled
janetournois Mar 25, 2024
9f21618
make AABB_tree projection the default and protect MLS projection with…
janetournois Mar 25, 2024
c7d0706
remove outdated macro
janetournois Mar 25, 2024
71e9081
duplicate tests to check both projection strategies
janetournois Mar 25, 2024
46cc193
fix projection to get the closest first_intersection(ray) with normal…
janetournois Mar 26, 2024
42decee
move default property map All_cells_selected to a new file
janetournois Mar 26, 2024
4c392b3
replace C3t3 by T3
janetournois Mar 26, 2024
8be3e34
deal with flat surface cases where distance is 0
janetournois Mar 26, 2024
d750394
store average edge length in the kd-tree of adaptive sizing field
janetournois Mar 26, 2024
cb5d347
choose nb of neighbors depending on dimension
janetournois Mar 26, 2024
fb90dcb
make edge_is_constrained_map robust to vertices order in pairs
janetournois Mar 26, 2024
5e57d8b
fix test : the cube edges were not correct
janetournois Mar 26, 2024
eec7e81
clean and start documentation
janetournois Mar 26, 2024
a1ea441
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Mar 26, 2024
c4036b3
fix warning
sloriot Mar 27, 2024
a167479
add missing template
sloriot Mar 27, 2024
8f973c3
move declaration/definition before using it
sloriot Mar 27, 2024
7205e10
fix compilation errors and warnings
sloriot Mar 27, 2024
1eab1c7
fix warning
sloriot Mar 27, 2024
f6adb0e
add missing TBB link + handle absence of TBB
sloriot Mar 27, 2024
bec4d2a
fix doc
sloriot Mar 27, 2024
c14ea88
rename parameters
sloriot Mar 27, 2024
dbdf28a
add missing include directive
sloriot Mar 27, 2024
b28933d
fix compilation issue
sloriot Mar 27, 2024
24defa5
remove unused include
janetournois Mar 28, 2024
aef0f80
add maybe_unused
janetournois Mar 28, 2024
bb40467
fix linking of Eigen
janetournois Mar 28, 2024
0e19978
unused parameter
janetournois Mar 28, 2024
53939bc
doc
janetournois Mar 28, 2024
acd6028
use edge_is_constrained_map in Adaptive_remeshing_sizing_field in demo
janetournois Mar 28, 2024
6d709c6
shorten test name
janetournois Mar 28, 2024
31829db
fix default ecmap
janetournois Mar 29, 2024
239d17f
fix confusion between far points and default vertex dimension which i…
janetournois Mar 29, 2024
0adc973
remove cout
janetournois Mar 29, 2024
d0f81b4
fix misleading indentation
janetournois Apr 2, 2024
0beeaae
fix warning "f not used"
janetournois Apr 2, 2024
2b038cf
remove invalid assertion
janetournois Apr 2, 2024
f64bf9d
CHANGES.md
janetournois Apr 2, 2024
81cef06
Add CGAL:: in concept
afabri Apr 2, 2024
6bc6edf
Add namespace for linking
afabri Apr 2, 2024
30bfd5a
document Uniform_sizing_field
janetournois Apr 3, 2024
6583f9e
fix the use of Point_with_info (unused function for now)
janetournois Apr 3, 2024
692725f
Fix tparam
afabri Apr 4, 2024
81174d2
doc and fix types to be consistent with concept
janetournois Apr 4, 2024
60a7f92
polish
afabri Apr 4, 2024
f020d47
examples cleaning
janetournois Apr 4, 2024
7aafe99
get create_adaptive_remeshing_sizing_field() out of class
janetournois Apr 4, 2024
1ef657d
tests cleaning
janetournois Apr 4, 2024
4d85eb0
attempt to fix "possibly dangling reference" warning
janetournois Apr 4, 2024
45a130f
update armadillo figure
janetournois Apr 4, 2024
92b2971
temporarily disable CGAL assertions to check they are responsible for…
janetournois Apr 5, 2024
33045d9
add MLS tests to the CGAL testsuite
lrineau Apr 8, 2024
c11cdb7
move sizing fields to include/CGAL
janetournois Apr 9, 2024
4e8a4c7
make calls robust to all number types convertible to double
janetournois Apr 9, 2024
40229e2
cleaning
janetournois Apr 9, 2024
2a131ef
hide enable_if in DOXYGEN_RUNNING
janetournois Apr 9, 2024
61d4de6
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Apr 9, 2024
e000d34
implementation history
janetournois Apr 9, 2024
d46474a
add doxygen group for sizing fields
janetournois Apr 9, 2024
6c5c36a
fix link
janetournois Apr 9, 2024
60ebab9
add timers in verbose mode
janetournois Apr 9, 2024
b0befd8
move dumps from verbose to debug mode
janetournois Apr 9, 2024
6aa6d8f
set number of flip-smooth steps back to default
janetournois Apr 9, 2024
3a54c88
0.9 induces up to 22 iterations
janetournois Apr 11, 2024
90bbf39
activate verbose mode on tests
janetournois Apr 11, 2024
0f43097
transform assertions into expensive_assertions
janetournois Apr 11, 2024
1dd7aa3
avoid a few vector constructions
janetournois Apr 12, 2024
c616122
activate assertions
janetournois Apr 12, 2024
cee3385
remove edges from bimap after collapse instead of checking if they ar…
janetournois Apr 12, 2024
ed72bfc
use Edge instead of pair<vertex> to avoid calling is_edge()
janetournois Apr 12, 2024
b4c28e6
Partially revert e483dacc3b44f4772043ccffa1a52c46ffcabdbe.
janetournois Apr 15, 2024
8adec59
add helper function to update bimap (as priority queue)
janetournois Apr 15, 2024
9936430
rename smoothed_positions to moves
janetournois Apr 25, 2024
b2ac9f4
add timer
janetournois Apr 26, 2024
e312817
add boundary info to collapsibility test
janetournois Apr 26, 2024
9567710
add commented dump
janetournois Apr 26, 2024
2563f90
fix dump functions used inside debug macro
janetournois Apr 26, 2024
4024802
add missing return type
janetournois Apr 26, 2024
97b5be8
move max_dimension_index() higher in file
janetournois Apr 26, 2024
e84b01b
density is 1/sizing to have mass = length/sizing a quantity with no d…
janetournois Apr 26, 2024
17736e9
compute lower and upper size bounds at edge midpoint
janetournois Apr 26, 2024
5f21b2c
add midpoint_with_info() to avoid duplicate code
janetournois Apr 26, 2024
c954e36
Improve Adaptive_remeshing_sizing_field
janetournois Apr 26, 2024
987dffb
remove comment
janetournois Apr 26, 2024
1a4fd5a
use midpoint_with_info() in density_along_segment()
janetournois Apr 26, 2024
fad15d1
cleaning
janetournois Apr 26, 2024
ebb70f7
add approximate_edge_length(edge) helper function
janetournois Apr 26, 2024
6a42415
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-with_si…
janetournois Apr 29, 2024
28f377a
fix average_edge_length_3(cell)
janetournois Apr 30, 2024
3b74baa
fix collapse condition
janetournois Apr 30, 2024
2fc25a8
fix moving with sizing formula
janetournois Apr 30, 2024
ff15dd7
turn more assertions into expensive_assertions
janetournois Apr 30, 2024
cb734cd
unused typedef
janetournois May 2, 2024
f8d3a4b
avoid copies
janetournois May 2, 2024
0b203b1
add missing 'expensive'
janetournois May 2, 2024
d4e2bd0
speedup max_cos_dihedral_angle
janetournois May 6, 2024
6727a64
Revert "fix moving with sizing formula"
janetournois May 6, 2024
de8953b
rename mass to density
janetournois May 6, 2024
f8ff5f6
verbose mode
janetournois May 6, 2024
30a6608
replace f by ff!
janetournois May 6, 2024
6389a1c
update armadillo figure
janetournois May 10, 2024
428a2bf
doc
janetournois May 10, 2024
d257b65
remove comments
janetournois May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Installation/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Release date: June 2024
- Introduced a new interactive program that demonstrates 2D arrangements embedded on the sphere called `earth`. The program (i) reads a database of all administrative boundaries of the countries in the world, (ii) displays the globe with all countries and land covered by water (which is land not covered by countries) on a window, and (ii) enables interaction with the user.

### [Tetrahedral Remeshing](https://doc.cgal.org/6.0/Manual/packages.html#PkgTetrahedralRemeshing)
- Added a sizing field as new parameter of `CGAL::tetrahedral_isotropic_remeshing()`, for non-uniform
and adaptive remeshing.
- **Breaking change**: The template parameters of
`CGAL::Tetrahedral_remeshing::Remeshing_cell_base_3`
have been modified, reverting changes introduced in CGAL 5.6.
Expand Down
6 changes: 6 additions & 0 deletions Lab/demo/Lab/Plugins/Tetrahedral_remeshing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ cgal_lab_plugin(
${tetRemeshingUI_FILES} KEYWORDS Tetrahedral_remeshing)
target_link_libraries(tetrahedral_remeshing_plugin PUBLIC scene_c3t3_item
${OPENGL_gl_LIBRARY})

find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
include(CGAL_Eigen3_support)
if(TARGET CGAL::Eigen3_support)
target_link_libraries(tetrahedral_remeshing_plugin PUBLIC CGAL::Eigen3_support)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>259</height>
<width>389</width>
<height>287</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -43,8 +43,28 @@
<property name="title">
<string>Tetrahedral remeshing</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0,0,0" columnstretch="0,0">
<item row="1" column="1">
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0,0,0,0" columnstretch="0,0,0">
<item row="4" column="0">
<widget class="QLabel" name="options_label">
<property name="text">
<string>Options :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="smoothEdges_checkBox">
<property name="toolTip">
<string extracomment="Smoothing of constrained polylines.\nWarning : this may reduce quality of dihedral angles."/>
</property>
<property name="text">
<string>Smooth constrained edges</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="nbIterations_spinbox">
<property name="minimumSize">
<size>
Expand All @@ -57,17 +77,23 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="protect_checkbox">
<property name="text">
<string>Protect boundaries</string>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="edgeLength_dspinbox">
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="checked">
<bool>false</bool>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="nbIterations_label">
<property name="text">
<string>Number of Main iterations</string>
Expand All @@ -80,7 +106,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand All @@ -96,22 +122,6 @@
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="edgeLength_dspinbox">
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="edgeLength_label">
<property name="text">
Expand All @@ -126,22 +136,19 @@
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="smoothEdges_checkBox">
<property name="toolTip">
<string extracomment="Smoothing of constrained polylines.\nWarning : this may reduce quality of dihedral angles."/>
</property>
<widget class="QCheckBox" name="protect_checkbox">
<property name="text">
<string>Smooth constrained edges</string>
<string>Protect boundaries</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="options_label">
<item row="0" column="2">
<widget class="QCheckBox" name="adaptiveSizing_checkbox">
<property name="text">
<string>Options :</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Adaptive</string>
</property>
</widget>
</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <CGAL/tetrahedral_remeshing.h>
#include <CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h>
#include <CGAL/Adaptive_remeshing_sizing_field.h>

#include <unordered_map>
#include <memory>
Expand Down Expand Up @@ -98,10 +99,11 @@ public Q_SLOTS:
std::cout << "Remeshing aborted" << std::endl;
return;
}
double target_length = ui.edgeLength_dspinbox->value();
unsigned int nb_iter = ui.nbIterations_spinbox->value();
bool protect = ui.protect_checkbox->isChecked();
bool smooth_edges = ui.smoothEdges_checkBox->isChecked();
const double target_length = ui.edgeLength_dspinbox->value();
const bool adaptive_sizing = ui.adaptiveSizing_checkbox->isChecked();
const unsigned int nb_iter = ui.nbIterations_spinbox->value();
const bool protect = ui.protect_checkbox->isChecked();
const bool smooth_edges = ui.smoothEdges_checkBox->isChecked();

// collect constraints
using Vertex_handle = Tr::Vertex_handle;
Expand All @@ -126,15 +128,27 @@ public Q_SLOTS:
}
}

CGAL::tetrahedral_isotropic_remeshing(
c3t3_item->c3t3(),
target_length,
CGAL::parameters::remesh_boundaries(!protect)
.number_of_iterations(nb_iter)
.smooth_constrained_edges(smooth_edges)
.edge_is_constrained_map(Constraints_pmap(constraints))
);

if (adaptive_sizing)
{
CGAL::tetrahedral_isotropic_remeshing(
c3t3_item->c3t3(),
CGAL::create_adaptive_remeshing_sizing_field(c3t3_item->c3t3().triangulation(),
CGAL::parameters::edge_is_constrained_map(Constraints_pmap(constraints))),
CGAL::parameters::remesh_boundaries(!protect)
.number_of_iterations(nb_iter)
.smooth_constrained_edges(smooth_edges)
.edge_is_constrained_map(Constraints_pmap(constraints))
);
}
else
{
CGAL::tetrahedral_isotropic_remeshing(
c3t3_item->c3t3(),
target_length,
CGAL::parameters::remesh_boundaries(!protect)
.number_of_iterations(nb_iter)
.smooth_constrained_edges(smooth_edges));
}
std::cout << "Remeshing done (" << time.elapsed() << " ms)" << std::endl;

c3t3_item->invalidateOpenGLBuffers();
Expand Down Expand Up @@ -215,6 +229,7 @@ public Q_SLOTS:
ui.edgeLength_dspinbox->setRange(1e-6 * diago_length, //min
2. * diago_length);//max
ui.edgeLength_dspinbox->setValue(0.05 * diago_length);
ui.adaptiveSizing_checkbox->setChecked(false);

std::ostringstream oss;
oss << "Diagonal length of the Bbox of the triangulation to remesh is ";
Expand All @@ -231,6 +246,8 @@ public Q_SLOTS:

connect(ui.protect_checkbox, SIGNAL(toggled(bool)),
ui.smoothEdges_checkBox, SLOT(setDisabled(bool)));
connect(ui.adaptiveSizing_checkbox, SIGNAL(toggled(bool)),
ui.edgeLength_dspinbox, SLOT(setDisabled(bool)));

return ui;
}
Expand Down
9 changes: 9 additions & 0 deletions SMDS_3/include/CGAL/SMDS_3/io_signature.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ struct Get_io_signature<double>
}
};

template <typename T>
struct Get_io_signature<std::variant<T> >
{
std::string operator()() {
return std::string("std::variant<") +
Get_io_signature<T>()() + ">";
}
};

lrineau marked this conversation as resolved.
Show resolved Hide resolved
template <typename T, typename U>
struct Get_io_signature<std::variant<T,U> >
{
Expand Down
44 changes: 26 additions & 18 deletions SMDS_3/include/CGAL/facets_in_complex_3_to_triangle_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,28 @@ void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3,
const bool normals_point_outside_of_the_subdomain = true,
const bool export_all_facets = false)
{
typedef typename PointContainer::value_type Point_3;
typedef typename PointContainer::value_type Range_point;
typedef typename FaceContainer::value_type Face;

typedef typename C3T3::Triangulation Tr;
typedef typename C3T3::Surface_patch_index Surface_patch_index;

typedef typename Tr::Cell_handle Cell_handle;
typedef typename Tr::Weighted_point Weighted_point;
typedef typename Tr::Facet Facet;

typedef std::unordered_map<Point_3, std::size_t> PIM;
typedef std::unordered_map<Range_point, std::size_t> PIM;

typedef typename C3T3::size_type size_type;

// triangulation point to range point
CGAL::Cartesian_converter<typename CGAL::Kernel_traits<typename Tr::Geom_traits::Point_3>::type,
typename CGAL::Kernel_traits<Point_3>::type> t2r;
using Tr_Bare_point = typename Tr::Geom_traits::Point_3;
using Tr_kernel = typename CGAL::Kernel_traits<Tr_Bare_point>::type;
using Range_kernel = typename CGAL::Kernel_traits<Range_point>::type;

using CC = CGAL::Cartesian_converter<Tr_kernel, Range_kernel>;
using Id = CGAL::Identity<Range_point>;
using T2R = typename std::conditional<std::is_same<Tr_kernel, Range_kernel>::value, Id, CC>::type;
T2R tr_to_range;

size_type nf = c3t3.number_of_facets_in_complex();
faces.reserve(faces.size() + nf);
Expand All @@ -87,26 +92,29 @@ void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3,

for(Facet fit : c3t3.facets_in_complex())
{
Cell_handle c = fit.first;
int s = fit.second;
const Cell_handle c = fit.first;
const int s = fit.second;
const Surface_patch_index spi = c->surface_patch_index(s);
Face f;
resize(f, 3);

typename C3T3::Subdomain_index cell_sdi = c3t3.subdomain_index(c);
typename C3T3::Subdomain_index opp_sdi = c3t3.subdomain_index(c->neighbor(s));
const typename C3T3::Subdomain_index cell_sdi = c3t3.subdomain_index(c);
const typename C3T3::Subdomain_index opp_sdi = c3t3.subdomain_index(c->neighbor(s));

if(!export_all_facets && cell_sdi != sd_index && opp_sdi != sd_index)
continue;

for(std::size_t i=1; i<4; ++i)
Face f;
resize(f, 3);

std::size_t i = 0;
for(typename Tr::Vertex_handle v : c3t3.triangulation().vertices(Facet(c, s)))
{
CGAL_assertion_code(typedef typename Tr::Vertex_handle Vertex_handle;)
CGAL_assertion_code(Vertex_handle v = c->vertex((s+i)&3);)
CGAL_assertion(v != Vertex_handle() && !c3t3.triangulation().is_infinite(v));
CGAL_assertion(v != typename Tr::Vertex_handle());
CGAL_assertion(!c3t3.triangulation().is_infinite(v));

const Weighted_point& wp = c3t3.triangulation().point(c, (s+i)&3);
const Point_3& bp = t2r(c3t3.triangulation().geom_traits().construct_point_3_object()(wp));
const typename Tr::Point tr_wp = c3t3.triangulation().point(v);
const typename Tr_kernel::Point_3
tr_bp = c3t3.triangulation().geom_traits().construct_point_3_object()(tr_wp);
const Range_point bp = tr_to_range(tr_bp);

auto insertion_res = p_to_ids.emplace(bp, inum);
if(insertion_res.second) // new point
Expand All @@ -115,7 +123,7 @@ void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3,
++inum;
}

f[i-1] = insertion_res.first->second;
f[i++] = insertion_res.first->second;
}

if(export_all_facets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ CGAL_add_named_parameter(remesh_boundaries_t, remesh_boundaries, remesh_boundari
CGAL_add_named_parameter(cell_selector_t, cell_selector, cell_is_selected_map)
CGAL_add_named_parameter(facet_is_constrained_t, facet_is_constrained, facet_is_constrained_map)
CGAL_add_named_parameter(smooth_constrained_edges_t, smooth_constrained_edges, smooth_constrained_edges)
CGAL_add_named_parameter(nb_flip_smooth_iterations_t, nb_flip_smooth_iterations, nb_flip_smooth_iterations)

// List of named parameters used in Alpha_wrap_3
CGAL_add_named_parameter(do_enforce_manifoldness_t, do_enforce_manifoldness, do_enforce_manifoldness)
Expand Down
10 changes: 8 additions & 2 deletions Spatial_searching/doc/Spatial_searching/CGAL/Kd_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,20 @@ Constructs an empty `k-d` tree.
Kd_tree(Splitter s=Splitter(),Traits t=Traits());

/*!

Constructs a `k-d` tree on the elements from the sequence
`[first, beyond)` using the splitting rule implemented by `s`.
The value type of the `InputIterator` must be `Point_d`.

*/
template <class InputIterator> Kd_tree(InputIterator first, InputIterator beyond, Splitter s=Splitter(),Traits t=Traits());

/*!
Constructs a `k-d` tree on the elements from the range `points`
using the splitting rule implemented by `s`.
The value type of elements in `PointRange` must be `Point_d`.
*/
template <class PointRange>
Kd_tree(const PointRange& points, Splitter s = Splitter(), const Traits t = Traits());

/*!
The constructor does not build the internal data structure, and it
is also not updated after calls to `insert()`.
Expand Down
9 changes: 9 additions & 0 deletions Spatial_searching/include/CGAL/Kd_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ class Kd_tree {
: traits_(traits), split(s), pts(first, beyond), built_(false)
{ }

template <class PointRange>
Kd_tree(const PointRange& points,
Splitter s = Splitter(), const SearchTraits traits = SearchTraits())
: traits_(traits),
split(s),
pts(std::begin(points), std::end(points)),
built_(false)
{ }

bool empty() const {
return pts.empty();
}
Expand Down
Loading