create multiple regions

Sep 1, 2015 at 9:02 PM
i'm looking to split the mesh in different regions. i want to have different mesh density and also I'd like to assigned different properties to the elements .

i tried addRegion(x,y) but i get a bigger region than i need.

is it possible? how can i achieve this?

thank you
Coordinator
Sep 2, 2015 at 10:02 AM
Edited Sep 2, 2015 at 10:02 AM
Are all regions protected by segments?
// Example: 2 boxes inside a rectangle

var geometry = new InputGeometry(12);

// Outer box:
geometry.AddPoint(0.0, 0.0, 1);
geometry.AddPoint(5.0, 0.0, 1);
geometry.AddPoint(5.0, 3.0, 1);
geometry.AddPoint(0.0, 3.0, 1);

geometry.AddSegment(0, 1, 1);
geometry.AddSegment(1, 2, 1);
geometry.AddSegment(2, 3, 1);
geometry.AddSegment(3, 0, 1);

// Left inner box:
geometry.AddPoint(1.0, 1.0, 2);
geometry.AddPoint(2.0, 1.0, 2);
geometry.AddPoint(2.0, 2.0, 2);
geometry.AddPoint(1.0, 2.0, 2);

geometry.AddSegment(4, 5, 2);
geometry.AddSegment(5, 6, 2);
geometry.AddSegment(6, 7, 2);
geometry.AddSegment(7, 4, 2);

// Right inner box:
geometry.AddPoint(3.0, 1.0, 3);
geometry.AddPoint(4.0, 1.0, 3);
geometry.AddPoint(4.0, 2.0, 3);
geometry.AddPoint(3.0, 2.0, 3);

geometry.AddSegment( 8,  9, 3);
geometry.AddSegment( 9, 10, 3);
geometry.AddSegment(10, 11, 3);
geometry.AddSegment(11,  8, 3);

// Add regions:
geometry.AddRegion(0.5, 1.5, 1); // Outer box
geometry.AddRegion(1.5, 1.5, 2); // Left box
geometry.AddRegion(3.5, 1.5, 3); // Right box
Sep 2, 2015 at 9:25 PM
Thank you very much for your prompt reply. Your help is much appreciated. BTW - awesome tool.

can a triangle belong to more than 1 region?

can I split the mesh into partitions and then each partition into regions having each triangle belonging to one partition/region? if so how can I create partitions?

thanks a bunch
Coordinator
Sep 4, 2015 at 9:55 AM
A triangle can belong to exactly one region.

Triangle.NET won't help you to partition the mesh. I suggest you take a look at METIS.
Sep 4, 2015 at 1:41 PM
that helps. i'm using Mesh Explorer to learn about this tool. i've split a surface in multiple regions and I assigned them colors for an easy/quick check.
if i go back and forth between "Refine" and "Smooth" the colors are not consistent. Any suggestions?

thank you very much
Coordinator
Sep 6, 2015 at 12:28 AM
The colors shouldn't change as long as the region value doesn't change. I've never had this kind of issue...

The colors get set in the MeshRenderer.Core.ColorManager.MakeRegionMap() method, so you might want to see if it works as expected.