Calculating the normal vector of each TIN facet

2495
1
07-13-2014 09:35 AM
YufanMiao
New Contributor

Dear all,

I have a set of 3d points with x, y, z values. I would like to make TIN model (Delaunay triangulation is also fine for me )out of these points and calculate the normal vector of each TIN facet with ArcObjects, better in C sharp. Does anyone have an idea how I can achieve that?

Kind regards

Yvan

0 Kudos
1 Reply
nicogis
MVP Frequent Contributor

for create a tin from point:

// Instantiate a new empty TIN.

ITinEdit TinEdit = new TinClass();

// Initialize the TIN with an envelope. The envelope's extent should be set large enough to

// encompass all the data that will be added to the TIN. The envelope's spatial reference, if

// if has one, will be used as the TIN's spatial reference. If it is not set, as in this case,

// the TIN's spatial reference will be unknown.

IEnvelope Env = new EnvelopeClass();

Env.PutCoords(0, 0, 10, 10);

TinEdit.InitNew(Env);

// Add points to the TIN. These will become triangle nodes.

IPoint Point = new PointClass();

Point.X = 2;

Point.Y = 2;

Point.Z = 0;

TinEdit.AddPointZ(Point, 0);

Point.Y = 7;

TinEdit.AddPointZ(Point, 0);

Point.X = 7;

TinEdit.AddPointZ(Point, 0);

// Save the TIN to disk. The overwrite parameter is used to indicate whether an existing

// TIN with the same name is allowed to be replaced with this one.

object overwrite = true;

TinEdit.SaveAs("c:\\data\\my_tin", ref overwrite);

when you have tin you get triangle component and use ITinTriangle.QueryNormal ( ArcObjects Help for .NET developers‌ )

0 Kudos