Commit Graph

312 Commits

Author SHA1 Message Date
Jane Tournois c9fab91c9a fix conversion warnings
and constify what should be
2020-05-14 08:45:48 +02:00
Sébastien Loriot 41d1898abf fix warning 2020-05-13 18:45:54 +02:00
Jane Tournois 916d09f451 prevent surface from self-folding during collapse
collapse_preserves_surface_star() checks that normals to the surface
do not get inverted and the surface stars do not "fold" on themselves
2020-05-13 07:47:07 +02:00
Jane Tournois 83e007f59e fix conversion warnings and comment unused code 2020-05-07 08:54:44 +02:00
Jane Tournois a9b461c156 fix warnings 2020-05-07 06:31:14 +02:00
Jane Tournois 9f40dac8d9 fix warnings (conversion, initialization order, brackets...)
and minor cleaning
2020-05-06 16:26:48 +02:00
Jane Tournois 1482f32514 add missing helper functions 2020-05-06 15:23:34 +02:00
Jane Tournois cb2a346427 add make_cells_set_manifold
the surface of `cells_to_insert` may be non manifold
using this function improves the chances to build a valid triangulation

+ use the boolean return value of build_triangulation()
2020-05-06 15:23:04 +02:00
Jane Tournois 8ec09f40fc remove dependency on Skin_surface_3
by replacing Triangulation_incremental_builder_3 by
build_triangulation() from tet_soup_to_c3t3.h
(which is part of Mesh_3 as C3T3)
2020-05-04 16:09:27 +02:00
Jane Tournois 3c42e84a38 name points to improve readability of example 2020-05-04 14:01:46 +02:00
Jane Tournois ab1063194c fix conversion warnings 2020-05-04 07:51:03 +02:00
Jane Tournois b91eed1bfb more doc reviews 2020-05-04 07:39:31 +02:00
Jane Tournois 891c162c56 doc reviews 2020-05-04 07:32:55 +02:00
Jane Tournois e9383b4790 fix dependencies 2020-04-28 09:21:02 +02:00
Jane Tournois 3f275b8fcb add missing include 2020-04-24 16:03:28 +02:00
Jane Tournois 09f98fc5cd remove trailing whitespaces 2020-04-24 13:51:25 +02:00
Jane Tournois 0039cf45cc fix compilation with some C3t3 types 2020-04-24 08:02:07 +02:00
Jane Tournois 206499d4aa fix the code when Surface_patch_index is pair<Subdomain_index, Subdomain_index> 2020-04-23 06:36:46 +02:00
Jane Tournois f4f3ec034f fix the code when Surface_patch_index is pair<Subdomain_index, Subdomain_index> 2020-04-23 06:32:19 +02:00
Jane Tournois adaa8e02bb remove extra template parameter 2020-04-22 15:50:43 +02:00
Jane Tournois 288c520cd0 fix more warnings 2020-04-22 07:20:47 +02:00
Laurent Rineau 3790250916 Fix a warning 2020-04-21 17:09:13 +02:00
Laurent Rineau fe1f731e22 Fix timestamps 2020-04-21 17:08:57 +02:00
Jane Tournois 4396909ea6 fix conversion warnings (and some indentation) 2020-04-20 14:51:31 +02:00
Jane Tournois 081b811cb0 fix warnings 2020-04-20 14:17:00 +02:00
Jane Tournois 96bab4d9e3 fix warning about double brackets
and use range iterators
2020-04-20 07:20:55 +02:00
Jane Tournois bb961ff466 fix typo 2020-04-17 16:51:40 +02:00
Jane Tournois fbd1952169 use base class is_facet_on_surface() function 2020-04-17 16:46:43 +02:00
Jane Tournois 3d181f5fe2 use range iterators 2020-04-17 16:44:00 +02:00
Jane Tournois c951383f48 fix internal c3t3 when input is not a C3T3
because add_to_complex(cell) does not do anything when subdomain_index
is not null, we need to remove cell from c3t3 first
2020-04-17 16:33:01 +02:00
Jane Tournois 3d003490c9 remove unused include 2020-04-17 15:36:00 +02:00
Jane Tournois 48e648dfe8 hardcode input file name, because cube corners are hardcoded above 2020-04-17 15:35:38 +02:00
Jane Tournois dacca12c3f reorder Cb and Vb consistently with the ones of T3 and Tds 2020-04-17 15:05:19 +02:00
Jane Tournois c6fe1e72bb use CGAL::save_binary_triangulation 2020-04-17 14:35:45 +02:00
Jane Tournois ba15e9f0a9 clean tests and add macro CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES 2020-04-17 14:16:44 +02:00
Laurent Rineau 5005c31f00 I/O: close the streams to flush the files buffers 2020-04-17 10:37:20 +02:00
Jane Tournois 9a886d8f27 rename tetrahedral_adaptive_remeshing() to tetrahedral_isotropic_remeshing()
because it is not adaptive yet
the adaptive version will come later, with a named parameter
2020-04-17 09:32:36 +02:00
Jane Tournois 68277d58ac doc 2020-04-17 09:13:07 +02:00
Jane Tournois 07f6879513 uniformize IO and add namespace 2020-04-17 09:06:34 +02:00
Jane Tournois 7c170f4f69 doc : user manual and figs 2020-04-17 08:34:49 +02:00
Jane Tournois 5b5595c08c add _3 to vertex base and cell base names 2020-04-17 06:52:30 +02:00
Jane Tournois 9dd3733efb complete IO test with both ascii and binary, save and load 2020-04-16 08:38:41 +02:00
Jane Tournois 1a4ad2623f add a test for IO 2020-04-16 07:42:05 +02:00
Jane Tournois e2cd7c7a33 use base class operators << and >> for Remeshing cell base 2020-04-16 07:41:44 +02:00
Jane Tournois 07b221e703 move IO header 2020-04-16 07:41:00 +02:00
Jane Tournois 49d72dc30c get all inherited functions from Triangulation_3 2020-04-16 07:39:46 +02:00
Jane Tournois a40559c7a2 use load/save for triangulation 2020-04-15 15:15:52 +02:00
Jane Tournois f96f5fd43e first version of tests
execution depends on random initialization,
with seed printed, to test varying data sets and
be able to reproduce errors from the test suite
2020-04-15 15:14:43 +02:00
Jane Tournois 3604e800a8 user manual 2020-04-15 12:35:10 +02:00
Jane Tournois 0fae00577d explicitely use CGAL::NULL_VECTOR instead of Vector_3() 2020-04-15 11:42:21 +02:00
Jane Tournois 0a0f8a631a add missing initialization 2020-04-15 11:33:54 +02:00
Jane Tournois 15cb9cb62d simplify examples for the user manual
more complicated code will move to the tests
2020-04-15 07:54:26 +02:00
Jane Tournois 807eac022d fix maybe uninitialized warning - important if default constructed is not 0,0,0 2020-04-14 15:25:57 +02:00
Jane Tournois 29350cb260 fix the update of c3t3 facets in the flip step 2020-04-14 15:09:59 +02:00
Jane Tournois 54d72e9533 remove (too) expensive assertion 2020-04-14 08:30:24 +02:00
Jane Tournois 9660846c03 reintroduce collapse/flip/smooth 2020-04-14 08:23:02 +02:00
Jane Tournois 32dfc3380a keep c3t3 number of facets valid during collapse
using add_to_complex(facet) and remove_from_complex(facet) increment
and decrement the number

this commit removes before collapse facets that will disappear from
triangulation
2020-04-14 08:22:05 +02:00
Jane Tournois 6220e11b59 avoid creation of degenerate cells with split() 2020-04-14 08:16:18 +02:00
Jane Tournois 844d7d697a Merge branch 'Tetrahedral_remeshing-new-jtournois' of github.com:janetournois/cgal into Tetrahedral_remeshing-new-jtournois 2020-04-14 05:41:19 +01:00
Jane Tournois d5a061a326 create single function for both dumps too ascii and medit 2020-04-14 06:38:13 +02:00
Sébastien Loriot 608272d2a5 fix compilation errors and a warning 2020-04-13 10:46:09 +02:00
Jane Tournois 2aac945e2f dump c3t3 using output_to_medit() 2020-04-11 15:44:36 +02:00
Jane Tournois e3547c1962 reorganize examples and keep only IO in the tetrahedral_remeshing_io.h file 2020-04-10 16:15:33 +02:00
Jane Tournois de568c718b use range iterators 2020-04-10 16:14:41 +02:00
Jane Tournois 139ef738c4 remove member variables that are used only once 2020-04-10 14:56:36 +02:00
Sébastien Loriot 825f77baaa add license include directives 2020-04-10 14:14:30 +02:00
Sébastien Loriot c929edcfd6 more identation using astyle -s2 2020-04-10 11:26:31 +02:00
Sébastien Loriot e8295bee19 more identation 2020-04-10 11:26:31 +02:00
Sébastien Loriot 9b4a53326c remove extra indentation 2020-04-10 11:26:31 +02:00
Sébastien Loriot 81541b2981 fix warnings + compilation error 2020-04-10 11:26:31 +02:00
Jane Tournois b3c44b837a replace all malloc/free code with std::vector's
and remove unused code
2020-04-10 11:26:31 +02:00
Sébastien Loriot acd6d9d8de removing tabs and trailing whitespaces 2020-04-10 11:26:31 +02:00
Jane Tournois 76cf92daaa replace Vec3D.h with CGAL::Vector_3 2020-04-10 11:26:30 +02:00
Jane Tournois a70473f361 rename debugging function 2020-04-10 11:26:17 +02:00
Jane Tournois 0446f85873 replace test on volume by test on orientation
CGAL::orientation is filtered, and CGAL::volume is not,
so there results can be different in nearly degenerate cases
2020-04-10 11:26:17 +02:00
Jane Tournois 022c261b93 make sure no cell has its volume negative after smoothing
if so, we shorten the move by 10% - several times is necessary -
while making sure every cell still has a positive volume
2020-04-10 11:26:17 +02:00
Sébastien Loriot 9a40e58877 fix warnings and compilation errors 2020-04-10 11:26:16 +02:00
Jane Tournois dd755c82e3 move package info to package_info/Tetrahedral_remeshing directory 2020-04-10 11:26:16 +02:00
Jane Tournois 933a5bc776 remove useless file 2020-04-10 11:26:14 +02:00
Jane Tournois 5e4de872a1 fix copyright headers 2020-04-10 11:25:32 +02:00
Jane Tournois 819aeded44 fix file name 2020-04-07 13:34:28 +02:00
Jane Tournois 82ca7db4c2 add const ref 2020-04-01 14:49:19 +02:00
Jane Tournois feefdde5a1 use latest API of named parameters (after merging master) 2020-04-01 14:15:21 +02:00
Jane Tournois 53843de366 protect smoothing of sharp edges with a macro 2020-04-01 07:59:27 +02:00
Jane Tournois b70b47fdd6 derecursify computation of facets normals
it was causing stack overflow on some models
2020-04-01 07:17:08 +02:00
Jane Tournois 3310ef054d disable smoothing on sharp edges for now
reprojection does projection on incident patches successively,
and this tends to smooth the shape of complex polylines, though
this is not desired

it seems that 1d smoothing does not really improve the quality nor
complexity of the output mesh, so let's disable it for now
2020-03-30 15:45:51 +02:00
Jane Tournois 78fbe290d1 avoid dependency on PMP for computing normals 2020-03-30 13:59:59 +02:00
Jane Tournois a0ee6b7ca9 use more boost::optional 2020-03-27 15:05:27 +01:00
Jane Tournois 69cf037280 extra iterations re-introduced 2020-03-27 07:54:43 +01:00
Jane Tournois 077a588bf2 during smoothing, always reproject to the input surface
instead of reprojecting to the evolving surface
this prevents from smoothing the shape again and again and "losing" features
2020-03-27 07:54:20 +01:00
Jane Tournois 8dab9317d0 remove outdated code 2020-03-26 16:35:22 +01:00
Jane Tournois a9324d4128 get 3 extra iterations of flip/smooth back 2020-03-26 15:58:45 +01:00
Jane Tournois cde5ec9e48 speedup normals computation
this new solution avoids all the calls to map.find(facet)
first fill a map with boundary facets and NULL_VECTOR the associated normal
facets are made canonical (with comparison of their 2 incident cells) to make
sure we always consider the same facet
2020-03-26 15:34:11 +01:00
Jane Tournois 91f1b1e7dd remove debug code 2020-03-26 13:43:17 +01:00
Jane Tournois b6c00b74b9 use boost::optional<Facet>
instead of returning a boolean and a facet if boolean is true
2020-03-26 13:31:05 +01:00
Jane Tournois 6bcb145163 speedup computation of facet normals
just counting the number of normals to be computed is 50 times
faster than testing find(f) and find(mf) successfully a lot
of times

this is a first shot and can definitely be improved a lot
2020-03-26 13:24:20 +01:00
Jane Tournois 66d3c1492f compute consistently oriented normals on surface patches
walk on facets with same surface patch index, with no "crossing" of
complex edges, and a normal that evolves while walking to keep
a smooth transition between neighbor facets
2020-03-25 15:23:38 +01:00
Jane Tournois cee1b435e7 not all edges should be update wrt the c3t3 2020-03-25 07:55:12 +01:00
Jane Tournois 3f6abd4ff7 fix smoothing of 3d vertices
count neighbors from 0, not -1, because there is no
pre-counting as it is done for surfaces
2020-03-20 06:37:38 +01:00
Jane Tournois 0f7a0eac64 add missing ifdef macro 2020-03-19 16:37:02 +01:00
Jane Tournois 62641ded15 simplify is_boundary(edge) 2020-03-19 16:16:51 +01:00
Jane Tournois 543ac23805 protect add_to_complex(vertex) with a condition 2020-03-19 16:15:31 +01:00
Jane Tournois 90653caddc fix smoothing!
for each vertex :
- on complex edges, collect incident complex edges
- on surfaces, collect incident surface edges
- inside volume, collect incident volume edges
2020-03-19 16:10:24 +01:00
Jane Tournois 8ede983726 keep 1d complex valid throughout the collapse step 2020-03-19 13:49:20 +01:00
Jane Tournois b8c9abd234 check normals per patch with dump 2020-03-18 08:19:48 +01:00
Jane Tournois cd69e12d81 replace clear+resize by assign 2020-03-17 16:37:07 +01:00
Jane Tournois 94ed9b6f34 simplify smoothing code
is_feature_MAD is not needed anymore because it corresponds to
the info stored in the c3t3
2020-03-17 16:11:32 +01:00
Jane Tournois bd6c8c03e1 add missing const 2020-03-17 15:58:38 +01:00
Jane Tournois 09ad664cb0 computing circumradius of degenerate cell crashes, avoid it 2020-03-17 15:58:10 +01:00
Jane Tournois 2645c1b47a fix is_boundary(edge)
facets that have exactly one incident cell which is infinite
are facets of the convex hull, not of the domain boundary
2020-03-17 15:37:06 +01:00
Jane Tournois 5060fb8fb1 fix get_edge_info and protect corners 2020-03-17 13:29:27 +01:00
Jane Tournois 3e7f75b3db use surface indices instead of subdomain indices when it makes more sense
- when we have surface indices, there is no need to count subdomains around,
- use c3t3 complex information instead of re-evaluating it

various cleaning and comments
2020-03-17 06:54:47 +01:00
Jane Tournois 08383dbf2d do not add to complex an edge that already is
it's the case when the input is a c3t3 with edge protection
2020-03-16 14:34:22 +01:00
Jane Tournois 0b030ed9bd use vertices_surface_indices
instead of the assumption that a surface is incident to two subdomains
There can always be a surface incident to 2 subvolumes with the same index
2020-03-16 14:29:37 +01:00
Jane Tournois 0ca5574c3f add const 2020-03-13 15:24:23 +01:00
Jane Tournois f421743670 fix indices in access to points 2020-03-13 15:24:06 +01:00
Jane Tournois ad0c8d7680 fix orientation of normals 2020-03-13 14:43:41 +01:00
Jane Tournois a8a74c4e19 sum of normals starts with n, not NULL_VECTOR
and add dump of normals for debugging purposes
2020-03-13 14:32:14 +01:00
Jane Tournois 096b724ec1 uncomment and adapt code with upsample > 0 2020-03-13 14:26:05 +01:00
Jane Tournois eb1a8778a0 wip make code as similar as possible to initial code 2020-03-10 16:37:00 +01:00
Jane Tournois f85e8549cf make smoothing code as close as possible to original MAD mesher code
to fix bugs

with this version :
- internal smoothing works perfectly
- surface smoothing is still broken
2020-03-10 11:42:47 +01:00
Jane Tournois 6e58599054 add package_info 2020-03-09 11:43:58 +01:00
Jane Tournois 535a50217f avoid iterating twice 2020-03-06 17:11:45 +01:00
Jane Tournois 593489a614 wip smoothing using FMLS
reorganize code to have smaller functions,
use c++11 for loops on ranges,
constify variables...
2020-02-28 16:51:00 +01:00
Jane Tournois ad6de49304 and const's and use range iterators in smoothing
and remove outdated code
2020-02-28 14:28:20 +01:00
Jane Tournois 1c6d251859 fix conversion warning 2020-02-28 13:45:06 +01:00
Jane Tournois a7b745a446 fix init_c3t3() and the collapse() step
* the code of collapse() is made simpler because the C3t3 already embeds a lot
of topology information that we do not need to re-test

* init_c3t3() now fixes the dimension() of vertices because it was not always
properly set in the input c3t3

* add counters in the plugin to understand why some collapse of very short edges
fail
2020-02-28 13:40:00 +01:00
Jane Tournois 9517760261 fix example
missing const and remove useless code
2020-02-28 13:32:02 +01:00
Jane Tournois baefa0d307 fix cout 2020-02-28 11:46:53 +01:00
Jane Tournois bb76c17ae5 use FMLS in smoothing, and revert to an older version
fix compilation with c3t3

this version is buggy and produces nan, I don't know why yet so smoothing is
commented out
2020-02-14 17:02:59 +01:00
Jane Tournois 2ef615d65d reset smoothing function to its initial version
and make sure it compiles with C3t3 requirements and a regular triangulation
2020-02-14 11:32:27 +01:00
Jane Tournois 628b800077 move back to helpers file the functions that are needed by smoothing 2020-02-14 11:31:46 +01:00
Jane Tournois b2686b35cc fix cout 2020-02-13 12:13:10 +01:00
Jane Tournois a7c2de7521 improve/fix collapse step
the topology_test was too restrictive and now makes better use of the info
stored in the C3t3

this commit also moves collapse-specific code to the corresponding file
(instead of the general "helpers" header)
2020-02-13 12:12:48 +01:00
Jane Tournois 7f8790332e fix iteration counting 2020-02-13 12:10:52 +01:00
Jane Tournois 8bacd01349 minor cout fix 2020-02-07 16:49:59 +01:00
Jane Tournois d0baa099d0 remove max_si computation, not needed anymore
also fix the count of c3t3 simplices in init_c3t3
(protected by debug macro anyway)
2020-02-07 16:49:35 +01:00
Jane Tournois 14b326bbe4 "far points" of Mesh_3 have dimension -1
deal with those, and keep their dimension "invalid" to be able to detect them
2020-02-07 15:39:31 +01:00
Jane Tournois 22e07a4a32 factor code 2020-02-07 12:16:28 +01:00
Jane Tournois 9ae27914cf fix the c3t3 surfaces in flip_n_to_m 2020-02-07 11:35:31 +01:00
Jane Tournois 707cdae9ed use c++11 for loops 2020-02-07 10:02:38 +01:00
Jane Tournois d345c2fe51 flip_3_to_2 does not break surfaces anymore
updating the outer hull of the set of modified cells is not enough,
"internal" facets should also be updated
2020-02-06 17:41:03 +01:00
Jane Tournois 62c390c354 use c++11 for loops, add const when possible, and rename containers 2020-02-06 16:44:23 +01:00
Jane Tournois 83df2cea52 rename is_inside(edge) to is_internal(edge)
for more readability
2020-02-06 11:27:07 +01:00
Jane Tournois 9eb178247d remove is_convex(tr) that has become useless 2020-02-06 11:20:41 +01:00
Jane Tournois 74243bae58 fix is_inside(edge)
by taking care also of facets that are in complex though incident
to the same subdomain on both sides
2020-02-06 11:19:27 +01:00
Jane Tournois 575f8111c3 remove imaginary stuff, and use CGAL internal named parameters 2020-02-04 17:23:30 +01:00
Jane Tournois dc496f5db6 add "peeling" of ultra-thin surface slivers 2020-02-04 16:32:32 +01:00
Jane Tournois 9d527321c4 cleaning 2020-02-04 15:30:04 +01:00
Jane Tournois a9e254efb4 flip does not break surfaces anymore 2020-02-04 15:29:49 +01:00