cgal icon indicating copy to clipboard operation
cgal copied to clipboard

Mesh_3 - add detection of intersection lines from labeled images

Open janetournois opened this issue 4 years ago • 29 comments

Summary of Changes

This PR introduces automatic detection of triple lines in labeled images. The constructor function

 CGAL::Mesh_domain_with_polyline_features_3<Labeled_mesh_domain_3> create_labeled_image_mesh_domain_with_features(A_i&...);

creates a mesh domain, with triple lines detected and ready to be protected using Mesh_3 protecting balls.

Release Management

  • Affected package(s): Mesh_3
  • Small Feature: link
  • Link to compiled documentation link
  • License and copyright ownership: unchanged

Todo

  • [x] create small feature
  • [x] update changes.md

janetournois avatar Nov 16 '21 10:11 janetournois

The current API of this PR is to add a function called CGAL::Mesh_3::detect_triple_lines<Word_type>(image, domain), which does not really fit the Labeled_mesh_domain (since Labeled_image_mesh_domain is deprecated). I suggest to transform that into adding a domain creation function called create_labeled_image_mesh_domain_with_features() that would return a Mesh_domain_with_polyline_features_3<Labeled_mesh_domain_3<Gt>> . What do you think @lrineau ?

janetournois avatar May 06 '22 14:05 janetournois

The current API of this PR is to add a function called CGAL::Mesh_3::detect_triple_lines<Word_type>(image, domain), which does not really fit the Labeled_mesh_domain (since Labeled_image_mesh_domain is deprecated). I suggest to transform that into adding a domain creation function called create_labeled_image_mesh_domain_with_features() that would return a Mesh_domain_with_polyline_features_3<Labeled_mesh_domain_3<Gt>> . What do you think @lrineau ?

That sounds good.

lrineau avatar May 06 '22 15:05 lrineau

/build:v1

janetournois avatar May 13 '22 16:05 janetournois

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6129/v1/Manual/index.html

github-actions[bot] avatar May 13 '22 16:05 github-actions[bot]

/force-build:v1

janetournois avatar May 16 '22 07:05 janetournois

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6129/v1/Manual/index.html

github-actions[bot] avatar May 16 '22 07:05 github-actions[bot]

Would it be a good idea to add an example subsection in the User Manual?

afabri avatar May 16 '22 08:05 afabri

/force-build:v1

janetournois avatar May 16 '22 09:05 janetournois

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6129/v1/Manual/index.html

github-actions[bot] avatar May 16 '22 09:05 github-actions[bot]

We usually prefer "feature lines"

janetournois avatar Jun 27 '22 06:06 janetournois

We usually prefer "feature lines"

Should not that be feature curves?

lrineau avatar Jun 27 '22 09:06 lrineau

We should keep clear that we do not detect all features, but only the "triple or more" lines. We don't know how to detect sharp features that are not at the intersection of 3 subdomains yet

janetournois avatar Jun 28 '22 10:06 janetournois

@ChristopherNcl You have some trailing whitespaces that should be removed.

You also have some unsued variables:

  • Mesh_3/include/CGAL/Mesh_3/features_detection/features_detection.h:1851:52: warning: unused parameter ‘prec’ [-Wunused-parameter] 1851 | std::vector<std::vector<P>> poly01121223(const int prec = 10)

  • Mesh_3/include/CGAL/Mesh_3/features_detection/features_detection.h:2959:52: warning: unused parameter ‘prec’ [-Wunused-parameter]

sloriot avatar Jun 30 '22 15:06 sloriot

@janetournois @lrineau Do you agree with e0f99d3 ?

sloriot avatar Jul 22 '22 06:07 sloriot

@janetournois @lrineau Do you agree with e0f99d3 ?

Yes, that commit seems right.

lrineau avatar Jul 24 '22 12:07 lrineau

Successfully tested in CGAL-5.6-Ic-34

sloriot avatar Jul 27 '22 15:07 sloriot

The plugin should be tested by someone who can display the protecting balls. Protection of triple (and more) lines is performed by choosing the option "Triple+ lines detected" in the meshing dialog image

janetournois avatar Jul 29 '22 09:07 janetournois

Successfully tested in CGAL-5.6-Ic-39.

sloriot avatar Aug 03 '22 17:08 sloriot

In this branch, the display of C3t3 generated from a polyhedral surface is broken. I'll have a look at it, but the branch can't be merged as is.

janetournois avatar Aug 04 '22 09:08 janetournois

We have tested on data with 4 subdomains intersecting at one point (3 inside subdomains and the outside), the result is great!

janetournois avatar Aug 04 '22 12:08 janetournois

@lrineau I think this PR can be merged, except if you want to do a last review.

sloriot avatar Sep 13 '22 13:09 sloriot

@lrineau I think this PR can be merged, except if you want to do a last review.

I have actually never reviewed the documentation, so far. I'll do it today.

lrineau avatar Sep 21 '22 10:09 lrineau

/build:v2

lrineau avatar Sep 21 '22 12:09 lrineau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/6129/v2/Manual/index.html

github-actions[bot] avatar Sep 21 '22 12:09 github-actions[bot]

In the polyhedron demo, open 420.inr, and mesh it with default parameters:

Screenshot_20220921_161706

then the produced mesh does not have any protecting balls:

Screenshot_20220921_161808

lrineau avatar Sep 21 '22 14:09 lrineau

I will fix the demo issue

janetournois avatar Sep 22 '22 06:09 janetournois

Actually it works. In the meshing dialog, I have added an item to the "Protect sharp edges" list, to separate protection of

  • Polylines on cube, and
  • Triple+ lines (including polylines on cube)

image

Do you think we should do it another way? Or maybe have "triple+ lines" as the default?

janetournois avatar Sep 22 '22 08:09 janetournois

Maybe I have not understood. With the default option "Polyhedron on cube", I expected to have sharp features on the border of the cube (and not inside the cube), but there was none.

lrineau avatar Sep 22 '22 08:09 lrineau

It's fixed. Here is now what I get

  • (left) with no protection
  • (middle) with protection of polylines on bbox
  • (right) with protection of all detected triple lines

420_with_and_without_protection

janetournois avatar Sep 22 '22 10:09 janetournois

b98d6d6 seems to be a merge of another PR. The dependency must be indicated in the PR labels + description. IMO when no needed we should avoid such merges.

sloriot avatar Sep 23 '22 07:09 sloriot