Page 1 of 1

DeletThinTriangles

Posted: Fri Mar 02, 2007 11:52 am
by simply
Is it possible to get an example of use of this command?

Posted: Fri Mar 02, 2007 12:08 pm
by DPlotAdmin
If you have the DPLOTLIB demo programs run ctest.exe. Select 3 (contour plot with randomly-spaced points). Use 1000 or so points.

Once the plot is produced switch to a 3D view so it will be a little more obvious what is going on. You'll probably see near-vertical triangles along the edges of the surface. Those are the triangles we want to eliminate.

Select File>Macro. Type a name for the macro, then click Edit/Create. In the macro editor type

DeleteThinTriangles(5)

This will delete all triangles along the exterior of the surface with interior angles less than 5 degrees.

From your own program, you'd use

DPlot_Command(DocNum,"[DeleteThinTriangles(5)]");

Posted: Fri Mar 02, 2007 12:20 pm
by simply
DPlotAdmin wrote:I

DeleteThinTriangles(5)

This will delete all triangles along the exterior of the surface with interior angles less than 5 degrees.

From your own program, you'd use

DPlot_Command(DocNum,"[DeleteThinTriangles(5)]");
why you choose 5 degrees?

Posted: Fri Mar 02, 2007 12:26 pm
by DPlotAdmin
No particular reason. If you're looking for an answer to "what's the best angle to use?" - there isn't one. 5 will generally get rid of most problem triangles. Any value greater than 15 or so and you risk deleting triangles you might have wanted to keep. But there is no standard, always correct answer; you need to know something about the layout of your data to know what value is appropriate.