//first add the outer boundry points (taken from the modellines) to the polygon p
p.Add(new Contour(boundary.Select(px => new Vertex(px.X, px.Y, 1)), 1));
//Add borehole points
p.Points.AddRange(boreholepts.Select(qy => new Vertex(qy.X, qy.Y, 1)));
// Add ellipse segments to the main geometry PSLG
List<XYZ> ellipse = AddEllipse(boreholepts[4], 1, 1);
p.Add(new Contour(ellipse.Select(px => new Vertex(px.X, px.Y, 1)), 1));
// Add line segment, where mesh is to be refined to the main geometry PSLG
List<XYZ> linesegment = new List<XYZ> { boreholepts[0], boreholepts[1] };
p.Add(new Contour(linesegment.Select(px => new Vertex(px.X, px.Y, 1)), 1));
p.Regions.Add(new RegionPointer(linesegment[0].X, linesegment[0].Y, 11, 0.5));
// Define regions in polygon where mesh must be refined.
for (int i =0;i<boreholepts.Count;i++)
{
//Add refinement region for each borehole point
p.Regions.Add(new RegionPointer(boreholepts[i].X, boreholepts[i].Y,i,0.5)) ;
}
var options = new ConstraintOptions() { ConformingDelaunay = true };
var triQuality = new QualityOptions()
{
MinimumAngle = 30,
MaximumArea = MaxArea
};
// The aCute refinement algorithm might fail when used with variable
// area constraints, so we use Ruppert's refinement algorithm here.
triQuality.UseLegacyRefinement = true;
//var mesh = p.Triangulate(new ConstraintOptions() { Convex = true });
var mesh = p.Triangulate(options, triQuality);//,triQuality`
the mesh does refine around the ellipse but not around the borehole points and the line segment. Any idea whats missing in the geometry description. Thanks in Advance.
Hi,
i am struggling to achieve mesh refinement around a line segment and around some points inside a polygon. i used this code below to define the geometry for the PSLG for meshing, i have a n Ellipse and a line segment inside the Polygon and some points. i want to refine the mesh around all of them, here is my code:
`
var p = new TriangleNet.Geometry.Polygon();
the mesh does refine around the ellipse but not around the borehole points and the line segment. Any idea whats missing in the geometry description. Thanks in Advance.