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

Define boundaries without angle? #7

Open
updega2 opened this issue Mar 20, 2016 · 13 comments
Open

Define boundaries without angle? #7

updega2 opened this issue Mar 20, 2016 · 13 comments
Labels
kind: question question part: mesh adaptation mesh adaptation mode specificity part: surface model specific to surface model

Comments

@updega2
Copy link
Contributor

updega2 commented Mar 20, 2016

I've been testing out mmgs on some triangle surfaces, and I really like what it can do!

Is it possible to give mmgs feature boundaries to use instead of a feature angle?

Ideally, this would be giving each triangle an integer marker and when two adjacent triangles have a different integer marker, this would be the feature boundary.

Thanks!

@Algiane
Copy link
Member

Algiane commented Mar 21, 2016

Hello,

It is hard to give a response, To have a reliable surface reconstruction model is a tricky problem.

@updega2
Copy link
Contributor Author

updega2 commented Mar 21, 2016

I'm not sure what you mean by surface reconstruction. Can you explain more?

I was thinking it wouldn't be very different than using a feature angle. Just a different way to mark the features. Is is possible to mark edges in some way?

@Algiane
Copy link
Member

Algiane commented Mar 21, 2016

Sorry, I send by error the previous message without ended it :-). (I will edit it in few minutes)

It is possible to mark the triangle/edges, with the references for now, but we can add a way to mark it differently if needed.

To add points, not in the middle of edges, but on an "ideal" smooth surface, we reconstruct this one from the piecwise linear mesh: this is the surface reconstruction. For now we use the element normals to recover the ideal surface, thus it is hard to change this. We just can modified the sharp angle detection.

Which kind of features are you thinking instead of angles?

@updega2
Copy link
Contributor Author

updega2 commented Mar 21, 2016

No worries! Okay, so I can use the ref to assign markers to points and triangles? Is this information carried through and output as well?

Are you constructing a bezier patch from the piecewise linear mesh? I thought I saw a bezier function somewhere. Are you doing this for a single triangle or forming a bezier (or something else) patch for each connected region?

I was just thinking in the case that you know the features you want to preserve. Then you can give triangles different markers. The boundaries between triangles with different markers are the features you want to preserve. In my application, I already know the features, and a hard angle separation doesn't always pick them out correctly.

@Algiane
Copy link
Member

Algiane commented Mar 22, 2016

Hello,
Yes, you can use the triangle references to assign markers, and this information is preserved during the remesh process. We use it for exemple to assign local minimal/maximal edge size and local hausdorff distance.
The point entities have a reference field too but it is not used for now and the inserted points are created with the 0 ref (thus you can not use this ref to associate a feature to the mesh).

Indeed, we use Bezier patches to approach the surface geometry. We compute one triangular patch per triangle but we ensure the C1 continuity between patches at regular points (not over ridges or corners of course).

If you want, you can give "by hand" the ridges and specify to the remesher to not detect sharp angles ( MMGS_Set_ridge and MMGS_Set_iparameter(mesh,sol,MMGS_IPARAM_angle,0) functions ) .

If you know the normals at the initial vertices of the mesh, you can specify it (for now, only in command line and with the very last version of the master branch but I can add the API function in the develop branch if you need it).

I hope this will help you...

@updega2
Copy link
Contributor Author

updega2 commented Mar 22, 2016

Thanks for the reply!

Sounds great. I will try to give that a shot and see if it works out. Thats okay, I shouldn't need API functions to do it. I'll figure out how to specify that.

Sorry for all the questions! But I have another one. When specifying local minimal/maximal edge sizes, as you mentioned is possible, how much can you do this? Is it possible to specify a local min/max for almost every triangle in the mesh?

Thanks again for the help!

@Algiane
Copy link
Member

Algiane commented Mar 23, 2016

Good morning,

Feel free to ask as much as you want!

It is possible to associate local min/max (and local maximal Hausdorff distance too) to triangle references. The local parameters are then applied on each edge of the triangles (for edges at interfaces of 2 refs, the more restrictive parameters are applied).
Thus:

  • for mmgs that modify surface mesh, it is possible to specify a local min/max for every triangle in the mesh.
  • for mmg3d that modify volume mesh, you can specify local parameters only for surface triangles because we don't keep the other one in memory.
    Note that we consider the triangles at the interface between 2 subdomains with different refs as surface triangles.
  • this feature is not yet implemented in mmg2d but will be in the next release.

Regards

@updega2
Copy link
Contributor Author

updega2 commented Mar 23, 2016

Thanks for the answers!

For mmgs, I actually tested this out and it didn't seem to work. I used:
MMGS_Set_iparameter(mesh,met,MMGS_IPARAM_numberOfLocalParam,npar) where npar is the number of triangles in my mesh.

And then I used:
MMGS_Set_localParameter(mesh,met,MMG5_Triangle,ref,fp1,fp2,hausd) and I increased ref by one every time, and I used the same fp1, fp2, and hausd.

This should essentially be the same as giving a global min/max and hausd right? When I tried this, it didn't crash, but it just hung up and didn't seem to compute the remesh.

Thanks!

@Algiane
Copy link
Member

Algiane commented Mar 23, 2016

I cannot reproduce this behaviour. Your function call seems to be ok.
However, having one reference per triangle may lead to a very poor mesh because we create a singular point at each intersection of 3 or more interface edges.

Please, can you send me, either a minimal reproducer or the backtrace when the livelock occurs in mmgs?

@updega2
Copy link
Contributor Author

updega2 commented Mar 23, 2016

Okay, thanks for the info.

In some cases, I start with a pretty poor mesh quality, so it sounds like it isn't a good idea to do this. I will figure out a way to do what I want without setting a ref for every triangle.

I can see if I can make a simple test case and send it your way.

Thanks again for your help!

@updega2
Copy link
Contributor Author

updega2 commented Mar 24, 2016

Hi Algiane, you are right. I was probably just trying on too complicated of an example, and it was still computing.

I tried on a very simple case (a cylinder), and it worked. It just took really long, and as you mentioned the output triangulation was really poor.

@Algiane
Copy link
Member

Algiane commented Mar 25, 2016

Hi,

I am relieved to see that we don't have a livelock in mmgs!

For your computationnal time problem, you can check the time that take mmgs with the same triangle references and global parameters instead of the local ones.

You must obtain the same output meshes in both cases but I think that it is really faster with only global parameters: in fact, I see no means to be efficient with a lot of local parameters (this option was added to allow to have different degrees of approximations for multiple objects, thus for a low number of local param).

So, in fact, I think that I need to add you a field in the triangle entity to define your feature (if you are ok, a char rather than an int).

Say me if you think that it is the best solution.

Regards,

@Algiane Algiane added kind: question question part: mesh adaptation mesh adaptation mode specificity part: surface model specific to surface model labels May 13, 2022
@Algiane
Copy link
Member

Algiane commented May 13, 2022

Hi @updega2 ,

I am trying to clean up old pending issues of the repository. We a fresh reading of your initial question: can I close this issue?

Thank you by advance,
Algiane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question question part: mesh adaptation mesh adaptation mode specificity part: surface model specific to surface model
Projects
None yet
Development

No branches or pull requests

2 participants