- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hiii.....I am trying to get the normal of each face of this model
public static UnitVector GetFaceNormal(Face inputFace,PartDocument doc)
{
Inventor.TransientGeometry tg = mApplication.TransientGeometry;
SurfaceEvaluator eval = inputFace.Evaluator;
// Get the center of the parametric range.
double[] center = new double[2];
center[0] = (eval.ParamRangeRect.MinPoint.X + eval.ParamRangeRect.MaxPoint.X) / 2;
center[1] = (eval.ParamRangeRect.MinPoint.Y + eval.ParamRangeRect.MaxPoint.Y) / 2;
bool status = eval.IsParamOnFace[ref center];
// Calculate the normal.
double[] normal = new double[3];
eval.GetNormal(center, normal);
// Create a unit vector to pass back the result.
UnitVector faceNormal = mApplication.TransientGeometry.CreateUnitVector(normal[0], normal[1], normal[2]);
return faceNormal;
}
But every time I got normal as (0,0,0) .Any suggestion on how can I get correct normal?
Solved! Go to Solution.