Mesher Class

NOTE: This member is now obsolete. Mesher class is deprecated, please use UtilityEx.Triangulate() method instead.

2D meshing.

Mesher class is deprecated, please use UtilityEx.Triangulate method instead.

Public Class Mesher 
Inherits Delaunay
This language is not supported or no code example is available.
public class Mesher : Delaunay
This language is not supported or no code example is available.
Name Description
Public constructor Mesher(ICurve, IList<ICurve>, double, mesherSmoothingType, int) Element size and smoothing control constructor.
Public constructor Mesher(ICurve, IList<ICurve>, IList<ICurve>, double, mesherSmoothingType, int) Smoothing control constructor.
Public constructor Mesher(ICurve, IList<ICurve>, IList<ICurve>, double) Element size and internal curves constructor.
Public constructor Mesher(ICurve, IList<ICurve>, double) Element size constructor.
Public constructor Mesher(Region, double) Element size constructor.
Public constructor Mesher(Region, double, mesherSmoothingType, int) Element size and smoothing control constructor.
Top
Name Description
Public property ComputeMeshQuality If true, mesh quality will be computed.
Public property ExecutionTime Gets the (last) work execution time in milliseconds. (inherited from WorkUnit).
Public property Log Gets the list of errors and warnings generated during execution. (inherited from WorkUnit).
Public property OutputType Gets or sets the triangulation output type. (inherited from Delaunay).
Public property Result Gets the resulting mesh. (inherited from Delaunay).
Public property SmoothingText Gets or sets the progress bar text displayed when executed asynchronously.
Public property Status Gets the WorkUnit status. (inherited from WorkUnit).
Public property TriangulatingText Gets or sets the progress bar text displayed when executed asynchronously. (inherited from Delaunay).
Top
Methods
 
Name Description
Protected method AddPointsAlongEdge(IndexLine, ref int) Adds points along the edge if possible (not too close to the others).
Internal protected (Protected Friend) method Cancelled(BackgroundWorker, DoWorkEventArgs) Checks if the user has requested cancellation of the background operation. (inherited from WorkUnit).
Protected method DoSmoothing(BackgroundWorker, DoWorkEventArgs)
Internal protected (Protected Friend) method DoWork(BackgroundWorker, DoWorkEventArgs) Does the actual work allowing progress bar update and cancellation. (inherited from Delaunay).
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Public method GetType Gets the Type of the current instance. (inherited from Object).
Protected method MakeMesh() (inherited from Delaunay).
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Protected method ProcessContours(IList<Point3D>, IList<Point3D>, IList<IList<Point3D>>, IList<IList<Point3D>>, bool) (inherited from Delaunay).
Protected method ProcessTriangulation(int, int, string, bool, BackgroundWorker, DoWorkEventArgs) Triangulate the points with indices between startFrom and endAt indices. (inherited from Delaunay).
Internal protected (Protected Friend) method ResetProgressParallel(int) Resets the progress bar for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method StartContinuousAnimation(string, BackgroundWorker, params string[]) Start the animation for the continuous progress bar. (inherited from WorkUnit).
Internal protected (Protected Friend) method StopContinuousAnimation(BackgroundWorker) Stop the animation for the continuous progress bar. (inherited from WorkUnit).
Public method ToString Returns a string that represents the current object. (inherited from Object).
Protected method Triangulate(BackgroundWorker, DoWorkEventArgs)
Public method Triangulate(out Point3D[], out IndexTriangle[]) Performs triangulation.
Protected method TriangulateInternal(BackgroundWorker, DoWorkEventArgs) (inherited from Delaunay).
Internal protected (Protected Friend) method UpdateProgress(double, double, string, BackgroundWorker, bool, params string[]) Updates the progress bar value. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgress(int, int, string, BackgroundWorker, bool, params string[]) Updates the progress bar value. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressAndCheckCancelled(int, int, string, BackgroundWorker, DoWorkEventArgs, bool, params string[]) Updates the progress bar value and checks if the worker thread has been canceled. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressAndCheckCancelledParallel(int, string, BackgroundWorker, DoWorkEventArgs, params string[]) Updates the progress bar value and checks if the worker thread has been canceled, for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressParallel(double, string, BackgroundWorker, params string[]) Updates the progress bar value for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressTo100(string, BackgroundWorker, params string[]) Set the progress bar to 100% and forces screen update. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkCancelled(Environment) Called when the work is cancelled. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkCompleted(Environment) Called when the work has completed. In the case you are modeling something, the environment parameter allows you to easily add the model to the entities collection. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkFailed(Environment) Called when the work has failed. (inherited from WorkUnit).
Top
Events
 
Name Description
Public event ProgressChanged Occurs when the DoWork() is called synchronously and the progress has changed. (inherited from WorkUnit).
Top
Fields
 
Name Description
Protected field adjacency (inherited from Delaunay).
Protected field boundaryVertexCount
Protected field brMin Min corner of the problem bounding rectangle. (inherited from Delaunay).
Protected field brRange Size of the bounding rectangle. (inherited from Delaunay).
Protected field elementSize
Protected field gridSize (inherited from Delaunay).
Internal protected (Protected Friend) field log (inherited from WorkUnit).
Protected field loops (inherited from Delaunay).
Protected field smoothing
Protected field smoothingMode
Protected field smoothingPasses
Protected field triangles (inherited from Delaunay).
Top
Example
 
The following sample summarizes the steps needed to perform an asynchronous composite curve meshing.
 public partial class Form1 : Form
  {
 
      public Form1()
      {	
          InitializeComponent();
          // adds event handler for WorkCompleted event
          viewport1.WorkCompleted += new Viewport.WorkCompletedEventHandler(viewport1_WorkCompleted);
      }
 
      protected override void OnShown(EventArgs e)
      {
 
          viewport1.DisplayMode = displayType.Shaded;
 
          CompositeCurve outer = new CompositeCurve();
 
          outer.CurveList.Add(new Line(0, 0, 10, 0));
          outer.CurveList.Add(new Line(10, 0, 10, 6));
          outer.CurveList.Add(new Line(10, 6, 0, 6));
          outer.CurveList.Add(new Line(0, 6, 0, 0));
 
          CompositeCurve inner1 = new CompositeCurve();
 
          inner1.CurveList.Add(new Line(2, 2, 6, 2));
          inner1.CurveList.Add(new Line(6, 2, 2, 3));
          inner1.CurveList.Add(new Line(2, 3, 2, 2));
 
          CompositeCurve inner2 = new CompositeCurve();
 
          inner2.CurveList.Add(new Circle(8, 4, 0, 1));
 
          CompositeCurve inner3 = new CompositeCurve();
 
          inner3.CurveList.Add(new Circle(6, 4, 0, .75));
 
          Mesher me = new Mesher(outer, new CompositeCurve[] { inner1, inner2, inner3 }, .15, mesherSmoothingType.AreaCentroidWeighted, 2);
 
          viewport1.StartWork(me);
 
          base.OnShown(e);
 
      }
 
      public void viewport1_WorkCompleted(object sender, WorkCompletedEventArgs e)
      {
 
          // checks the WorkUnit type, more than one can be present in the same application
          if (e.WorkUnit is Mesher)
          {
 
              Mesher me = (Mesher)e.WorkUnit;
 
              Mesh m = me.Result;
 
              // adds the mesh to the viewport
              viewport1.Entities.Add(m, 0, Color.Coral);
 
              viewport1.SetView(viewType.Trimetric);
              viewport1.ZoomFit();
              viewport1.Invalidate();
 
          }
 
      }
 
  }					
This language is not supported or no code example is available.
 Public Partial Class Form1
  	Inherits Form
 
 	Public Sub New()
 
 		InitializeComponent()
 
 		' adds event handler for WorkCompleted event
 		Viewport1.WorkCompleted += New Viewport.WorkCompletedEventHandler(Viewport1_WorkCompleted)
 
 	End Sub
 
  	Protected Overrides Sub OnShown(e As EventArgs)
 
  		Viewport1.DisplayMode = displayType.Shaded
 
  		Dim outer As New CompositeCurve()
 
  		outer.CurveList.Add(New Line(0, 0, 10, 0))
  		outer.CurveList.Add(New Line(10, 0, 10, 6))
  		outer.CurveList.Add(New Line(10, 6, 0, 6))
  		outer.CurveList.Add(New Line(0, 6, 0, 0))
 
  		Dim inner1 As New CompositeCurve()
 
  		inner1.CurveList.Add(New Line(2, 2, 6, 2))
  		inner1.CurveList.Add(New Line(6, 2, 2, 3))
  		inner1.CurveList.Add(New Line(2, 3, 2, 2))
 
  		Dim inner2 As New CompositeCurve()
 
  		inner2.CurveList.Add(New Circle(8, 4, 0, 1))
 
  		Dim inner3 As New CompositeCurve()
 
  		inner3.CurveList.Add(New Circle(6, 4, 0, 0.75))
 
  		Dim [me] As New Mesher(outer, New CompositeCurve() {inner1, inner2, inner3}, 0.15, mesherSmoothingType.AreaCentroidWeighted, 2)
 
  		Viewport1.StartWork([me])
 
  		MyBase.OnShown(e)
 
  	End Sub
 
  	Public Sub Viewport1_WorkCompleted(sender As Object, e As WorkCompletedEventArgs)
 
  		' checks the WorkUnit type, more than one can be present in the same application
  		If TypeOf e.WorkUnit Is Mesher Then
 
  			Dim [me] As Mesher = DirectCast(e.WorkUnit, Mesher)
 
  			Dim m As Mesh = [me].Result
 
  			' adds the mesh to the viewport
 
  			Viewport1.Entities.Add(m, 0, Color.Coral)
 
             Viewport1.SetView(viewType.Trimetric)
             Viewport1.ZoomFit()
             Viewport1.Invalidate()
 
  		End If
 
  	End Sub
 
  End Class					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.8

In this article

Definition