Minor changes and additions.
This commit is contained in:
@@ -8,7 +8,7 @@ namespace TriangleNet.Examples
|
||||
using TriangleNet.Smoothing;
|
||||
|
||||
/// <summary>
|
||||
/// Refine only a part of a polygon mesh be using region pointers and an area constraint.
|
||||
/// Refine only a part of a polygon mesh by using region pointers and an area constraint.
|
||||
/// </summary>
|
||||
public class Example4
|
||||
{
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
|
||||
namespace TriangleNet.Examples
|
||||
{
|
||||
using System;
|
||||
using TriangleNet.Geometry;
|
||||
using TriangleNet.Meshing;
|
||||
using TriangleNet.Meshing.Iterators;
|
||||
using TriangleNet.Rendering.Text;
|
||||
|
||||
/// <summary>
|
||||
@@ -26,7 +28,18 @@ namespace TriangleNet.Examples
|
||||
};
|
||||
|
||||
// Generate mesh using the polygons Triangulate extension method.
|
||||
var mesh = poly.Triangulate(quality);
|
||||
var mesh = (Mesh)poly.Triangulate(quality);
|
||||
|
||||
// Validate.
|
||||
foreach (var e in EdgeIterator.EnumerateEdges(mesh))
|
||||
{
|
||||
double length = Math.Sqrt(DistSqr(e.GetVertex(0), e.GetVertex(1)));
|
||||
|
||||
if (length > MAX_EDGE_LENGTH)
|
||||
{
|
||||
Console.WriteLine("Something's wrong in here ...");
|
||||
}
|
||||
}
|
||||
|
||||
if (print) SvgImage.Save(mesh, "example-7.svg", 500);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace TriangleNet.Examples
|
||||
/// </summary>
|
||||
public class Example9
|
||||
{
|
||||
public static void Run()
|
||||
public static void Run(bool print = false)
|
||||
{
|
||||
var pts = new List<Vertex>
|
||||
{
|
||||
@@ -39,7 +39,7 @@ namespace TriangleNet.Examples
|
||||
|
||||
var list = MeshValidator.GetDegenerateBoundaryTriangles(mesh);
|
||||
|
||||
if (list.Any())
|
||||
if (print && list.Any())
|
||||
{
|
||||
Console.WriteLine("Iteration {0}: found {1} degenerate triangle(s) of {2}.",
|
||||
i, list.Count(), mesh.Triangles.Count);
|
||||
|
||||
Reference in New Issue
Block a user