Refining regions in the new version

Jan 12, 2016 at 1:34 PM

First of all thanks for the tip-top library!

I created a mesh with multiple regions and am trying to choose a different net precision in each one.

This seemed a cakewalk in the older version as can be seen in the example “Refining regions” on your site.

However I can’t figure it out for the new version. My best try so long was the following ( analogous to your old example but in VB.NET):
    '// Define the mesh parameters:
Dim options As New ConstraintOptions With {.ConformingDelaunay = True, .UseRegions = True}

Dim quality As New QualityOptions With {.MinimumAngle = 25, .MaximumAngle = 180, .MaximumArea = 300}
    '// Triangulate the mesh:
    Dim mesh = Q.Triangulate(options, quality)

    '// Calculate mesh quality
    Dim qualitycheck As New QualityMeasure

    '// Use the minimum triangle area for region refinement
    Dim area As Double = 1.75 * qualitycheck.AreaMinimum

    For Each t In mesh.Triangles

        '// Set area constraint for all triangles in region 1
        If t.Label = 1 Then t.Area = area

    Next t

    '// Use per triangle area constraint for next refinement
    quality.VariableArea = True

    Dim s = New SimpleSmoother
Refining the mesh in this way has unfortunately shown no effect and the smoother throws an internal error.

Is it possible? How can I achieve this?

Thank you
Jan 12, 2016 at 4:02 PM
Edited Jan 12, 2016 at 4:03 PM
The VariableArea option wasn't taken into account.

Please download the latest source code and take a look at the new example.
Jan 13, 2016 at 12:12 PM
Thanks a lot for the update!

Now it's working perfectly