<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10311362#M8908</link>
    <description>&lt;P&gt;Hi nnikbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;It worked Okay for all the 7 faces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot nnilbin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thurai&lt;/P&gt;</description>
    <pubDate>Thu, 13 May 2021 18:22:03 GMT</pubDate>
    <dc:creator>tperam</dc:creator>
    <dc:date>2021-05-13T18:22:03Z</dc:date>
    <item>
      <title>Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10301492#M8897</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using API, how to Determine the Normal Vector from a given point inside a solid to a face, the point not being at the face, preferably using C++.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an object in Fusion 360 with this functionality?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thurai&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 00:14:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10301492#M8897</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-10T00:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10303878#M8898</link>
      <description>&lt;P&gt;I tried the following, which did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Face[IFace] = Faces-&amp;gt;item(IFace);&lt;/P&gt;&lt;P&gt;with IFace ranging from 0 to Number of faces.&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;SurfaceEvaluator&amp;gt; FaceSurfaceEvaluator;&lt;/P&gt;&lt;P&gt;FaceSurfaceEvaluator[IFace] = Face[IFace]-&amp;gt;evaluator();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Output Normal Vector */&lt;BR /&gt;Ptr&amp;lt;Vector3D&amp;gt;&amp;nbsp;normalVector;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* A Point inside the Solid */&lt;BR /&gt;Ptr&amp;lt;Point3D&amp;gt; point =Point3d::create(0,0,0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bool returnValue = FaceSurfaceEvaluator[IFace]-&amp;gt;getNormalAtPoint(point, normalVector);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping normalVector will have the Normal Vector.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thurai&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 23:31:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10303878#M8898</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-10T23:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10304071#M8899</link>
      <description>&lt;P&gt;Usually if we find a vector with minimum distance from a point inside a body to its face, it will be normal to the face. It has exceptions but in most cases it works fine. Also for open faces it is possible to have no answer for finding a normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For finding the minimum distance we can use&amp;nbsp;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-DDA91B87-6A18-40A1-A9D3-8094E34807C7" target="_blank" rel="noopener"&gt;MeasureManager.measureMinimumDistance Method&lt;/A&gt;. The returned &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-0BB9202B-604B-433F-A4DB-058FA83F6DF4" target="_blank" rel="noopener"&gt;MeasureResults&lt;/A&gt; has the data for the minimum distance vector. But unfortunately it seems that it does not work for the point inside a single face BRepBody (it works for the outside points).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is a workaround. You can create a patch using BRepFace. Then the MeasureManager works correctly using the patch face. After your work is done you can delete the patch. In the following code I used OffsetFeature with zero offset to create the patch but perhaps there is some better methods. At the end of this method I checked if the vector is normal to face or not by using CrossProduct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Ptr&amp;lt;Vector3D&amp;gt; Test::getNormalVectorToFace(Ptr&amp;lt;Point3D&amp;gt;&amp;amp; point, Ptr&amp;lt;BRepFace&amp;gt;&amp;amp; face)
{
	Ptr&amp;lt;Component&amp;gt; component = face-&amp;gt;body()-&amp;gt;parentComponent();
	
	Ptr&amp;lt;ObjectCollection&amp;gt; objectCollection = ObjectCollection::create();
	objectCollection-&amp;gt;add(face);

	Ptr&amp;lt;OffsetFeatureInput&amp;gt; offsetInput = component-&amp;gt;features()-&amp;gt;offsetFeatures()-&amp;gt;createInput(objectCollection, ValueInput::createByReal(0), FeatureOperations::NewBodyFeatureOperation);

	Ptr&amp;lt;OffsetFeature&amp;gt; offsetFeature = component-&amp;gt;features()-&amp;gt;offsetFeatures()-&amp;gt;add(offsetInput);
	Ptr&amp;lt;BRepFace&amp;gt; offsetFace = offsetFeature-&amp;gt;faces()-&amp;gt;item(0);

	Ptr&amp;lt;MeasureManager&amp;gt; measureManager = Application::get()-&amp;gt;measureManager();
	Ptr&amp;lt;MeasureResults&amp;gt; measureResult = measureManager-&amp;gt;measureMinimumDistance(point, offsetFace);

	Ptr&amp;lt;Vector3D&amp;gt; vectorToFace = measureResult-&amp;gt;positionTwo()-&amp;gt;vectorTo(measureResult-&amp;gt;positionOne());
	Ptr&amp;lt;Vector3D&amp;gt; normalAtFace;
	face-&amp;gt;geometry()-&amp;gt;evaluator()-&amp;gt;getNormalAtPoint(measureResult-&amp;gt;positionOne(), normalAtFace);

	Ptr&amp;lt;Vector3D&amp;gt; crossProduct = normalAtFace-&amp;gt;crossProduct(vectorToFace);
	offsetFace-&amp;gt;body()-&amp;gt;deleteMe();

	if (crossProduct-&amp;gt;length() &amp;lt; 0.000001)
	{
		vectorToFace-&amp;gt;normalize();
		return vectorToFace;
	}
	else
	{
		return nullptr;
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 02:29:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10304071#M8899</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-05-11T02:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10305496#M8900</link>
      <description>&lt;P&gt;Thanks nnikbin.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I will try you method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Thurai&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 14:01:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10305496#M8900</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-11T14:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10305810#M8901</link>
      <description>&lt;P&gt;Hi nnikbin.&lt;/P&gt;&lt;P&gt;I tried the Following as given below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Solid has 7 Faces. Your routine Ptr&amp;lt;Vector3D&amp;gt; NormalVectorToFace(Ptr&amp;lt;Point3D&amp;gt;&amp;amp; point, Ptr&amp;lt;BRepFace&amp;gt;&amp;amp; face),&lt;/P&gt;&lt;P&gt;worked for two out of 7 faces; Face 0 and 3, which are planer faces, and gave the following printouts;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IFace = 0, normalVector x = 0.000e+000, y = 0.000e+000, z = 1.000e+000&lt;/P&gt;&lt;P&gt;IFace = 3, normalVector x = 0.000e+000, y = 0.000e+000, z = - 1.000e+000.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But it did not work for the other faces; Face 1, 2, 4, 5 and 6. which are obtained by lofting the profiles with the planer faces Face 0 and 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like a method which works for all the faces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Thurai&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;///////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;Vector3D&amp;gt; NormalVectorToFace(Ptr&amp;lt;Point3D&amp;gt;&amp;amp; point, Ptr&amp;lt;BRepFace&amp;gt;&amp;amp; face);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(IFace = 0; IFace &amp;lt;= longeron.ComponentFaceCount - 1; IFace++)&lt;BR /&gt;{//IFace&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ComponentFace[IFace] = ComponentFaces-&amp;gt;item(IFace);&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;Point3D&amp;gt; Point = Point3D::create(0,0,0);&lt;/P&gt;&lt;P&gt;normalVector[IFace] = NormalVectorToFace(Point, ComponentFace[IFace]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;fprintf(Com.out," \n\n IFace = %4d, normalVectorPoint[JPhi][0] x = %10.3e, y = %10.3e, z = %10.3e \n ",&lt;BR /&gt;IFace, longeron.normalVector[JPhi][IFace]-&amp;gt;x(), longeron.normalVector[JPhi][IFace]-&amp;gt;y(), longeron.normalVector[JPhi][IFace]-&amp;gt;z());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}//IFace&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Ptr&amp;lt;Vector3D&amp;gt; NormalVectorToFace(Ptr&amp;lt;Point3D&amp;gt;&amp;amp; point, Ptr&amp;lt;BRepFace&amp;gt;&amp;amp; face)&lt;BR /&gt;{//NormalVectorToFace(&lt;BR /&gt;Ptr&amp;lt;Component&amp;gt; component = face-&amp;gt;body()-&amp;gt;parentComponent();&lt;BR /&gt;&lt;BR /&gt;Ptr&amp;lt;ObjectCollection&amp;gt; objectCollection = ObjectCollection::create();&lt;BR /&gt;objectCollection-&amp;gt;add(face);&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;OffsetFeatureInput&amp;gt; offsetInput = component-&amp;gt;features()-&amp;gt;offsetFeatures()-&amp;gt;createInput(objectCollection, ValueInput::createByReal(0), FeatureOperations::NewBodyFeatureOperation);&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;OffsetFeature&amp;gt; offsetFeature = component-&amp;gt;features()-&amp;gt;offsetFeatures()-&amp;gt;add(offsetInput);&lt;BR /&gt;Ptr&amp;lt;BRepFace&amp;gt; offsetFace = offsetFeature-&amp;gt;faces()-&amp;gt;item(0);&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;MeasureManager&amp;gt; measureManager = Application::get()-&amp;gt;measureManager();&lt;BR /&gt;Ptr&amp;lt;MeasureResults&amp;gt; measureResult = measureManager-&amp;gt;measureMinimumDistance(point, offsetFace);&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;Vector3D&amp;gt; vectorToFace = measureResult-&amp;gt;positionTwo()-&amp;gt;vectorTo(measureResult-&amp;gt;positionOne());&lt;BR /&gt;Ptr&amp;lt;Vector3D&amp;gt; normalAtFace;&lt;BR /&gt;face-&amp;gt;geometry()-&amp;gt;evaluator()-&amp;gt;getNormalAtPoint(measureResult-&amp;gt;positionOne(), normalAtFace);&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;Vector3D&amp;gt; crossProduct = normalAtFace-&amp;gt;crossProduct(vectorToFace);&lt;BR /&gt;offsetFace-&amp;gt;body()-&amp;gt;deleteMe();&lt;/P&gt;&lt;P&gt;if (crossProduct-&amp;gt;length() &amp;lt; 0.000001)&lt;BR /&gt;{&lt;BR /&gt;vectorToFace-&amp;gt;normalize();&lt;BR /&gt;return vectorToFace;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;return nullptr;&lt;BR /&gt;}&lt;BR /&gt;}//end NormalVectorToFace()&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 16:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10305810#M8901</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-11T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309265#M8902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6402734"&gt;@tperam&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the following code (the add-in is attached as a zip file) based on the same algorithm in my previous reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After running the add-in the add-in prompt to select a sketch point, then a body. The add-in creates sketch lines which are corrsponding to minimum distance lines from the selected sketch point to the faces of the selected body. You can easily convert them to unique length vectors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;Core/CoreAll.h&amp;gt;
#include &amp;lt;Fusion/FusionAll.h&amp;gt;
#include &amp;lt;CAM/CAMAll.h&amp;gt;

using namespace adsk::core;
using namespace adsk::fusion;
using namespace adsk::cam;

Ptr&amp;lt;Application&amp;gt; app;
Ptr&amp;lt;UserInterface&amp;gt; ui;

void drawNormalsToBodyFaces(Ptr&amp;lt;SketchPoint&amp;gt;&amp;amp; sketchPoint, Ptr&amp;lt;BRepBody&amp;gt;&amp;amp; body);

extern "C" XI_EXPORT bool run(const char* context)
{
	app = Application::get();
	if (!app)
		return false;

	ui = app-&amp;gt;userInterface();
	if (!ui)
		return false;

	Ptr&amp;lt;Selection&amp;gt; sketchPointSelection = ui-&amp;gt;selectEntity("Select a point", "SketchPoints");
	if (!sketchPointSelection)
	{
		ui-&amp;gt;messageBox("Selection Canceled");
		return false;
	}

	Ptr&amp;lt;Selection&amp;gt; bodySelection = ui-&amp;gt;selectEntity("Select a body", "Bodies");
	if (!bodySelection)
	{
		ui-&amp;gt;messageBox("Selection Canceled");
		return false;
	}

	Ptr&amp;lt;SketchPoint&amp;gt; sketchPoint = sketchPointSelection-&amp;gt;entity();
	Ptr&amp;lt;BRepBody&amp;gt; body = bodySelection-&amp;gt;entity();

	drawNormalsToBodyFaces(sketchPoint, body);
	body-&amp;gt;opacity(0.6);

	return true;
}

#ifdef XI_WIN

#include &amp;lt;windows.h&amp;gt;

BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved)
{
	switch (reason)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

void drawNormalsToBodyFaces(Ptr&amp;lt;SketchPoint&amp;gt;&amp;amp; sketchPoint, Ptr&amp;lt;BRepBody&amp;gt;&amp;amp; body)
{
	Ptr&amp;lt;Sketch&amp;gt; sketch = sketchPoint-&amp;gt;parentSketch();

	for (Ptr&amp;lt;BRepFace&amp;gt; face : body-&amp;gt;faces())
	{
		Ptr&amp;lt;Component&amp;gt; component = body-&amp;gt;parentComponent();

		Ptr&amp;lt;ObjectCollection&amp;gt; objectCollection = ObjectCollection::create();
		objectCollection-&amp;gt;add(face);

		Ptr&amp;lt;OffsetFeatureInput&amp;gt; offsetInput = component-&amp;gt;features()-&amp;gt;offsetFeatures()-&amp;gt;createInput(objectCollection, ValueInput::createByReal(0), FeatureOperations::NewBodyFeatureOperation);

		Ptr&amp;lt;OffsetFeature&amp;gt; offsetFeature = component-&amp;gt;features()-&amp;gt;offsetFeatures()-&amp;gt;add(offsetInput);
		Ptr&amp;lt;BRepFace&amp;gt; offsetFace = offsetFeature-&amp;gt;faces()-&amp;gt;item(0);

		Ptr&amp;lt;MeasureManager&amp;gt; measureManager = Application::get()-&amp;gt;measureManager();
		Ptr&amp;lt;MeasureResults&amp;gt; measureResult = measureManager-&amp;gt;measureMinimumDistance(sketchPoint-&amp;gt;worldGeometry(), offsetFace);

		Ptr&amp;lt;Point3D&amp;gt; sketchSpacePoint1 = sketch-&amp;gt;modelToSketchSpace(measureResult-&amp;gt;positionOne());
		Ptr&amp;lt;Point3D&amp;gt; sketchSpacePoint2 = sketch-&amp;gt;modelToSketchSpace(measureResult-&amp;gt;positionTwo());

		Ptr&amp;lt;SketchLine&amp;gt; sketchLine = sketch-&amp;gt;sketchCurves()-&amp;gt;sketchLines()-&amp;gt;addByTwoPoints(sketchSpacePoint2, sketchSpacePoint1);
		Ptr&amp;lt;Vector3D&amp;gt; normalAtFace;
		face-&amp;gt;geometry()-&amp;gt;evaluator()-&amp;gt;getNormalAtPoint(measureResult-&amp;gt;positionOne(), normalAtFace);

		Ptr&amp;lt;Vector3D&amp;gt; vectorToFace = measureResult-&amp;gt;positionTwo()-&amp;gt;vectorTo(measureResult-&amp;gt;positionOne());

		Ptr&amp;lt;Vector3D&amp;gt; crossProduct = normalAtFace-&amp;gt;crossProduct(vectorToFace);
		offsetFace-&amp;gt;body()-&amp;gt;deleteMe();

		sketchLine-&amp;gt;isConstruction(crossProduct-&amp;gt;length() &amp;gt; 0.000001);
	}
}
#endif // XI_WIN&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can check if the end point of the lines are outside of each face (are on extended faces) and remove them if you do not need normals to extended faces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For demonstration purpose, the minimum distance lines which are not normal to faces are created as construction sketch lines (dashed lines) and the opacity of the selected body is set to 0.60.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an snapshot of the output from the add-in:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42.jpg" style="width: 659px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/918172iC7CB5EA3FB88773F/image-size/large?v=v2&amp;amp;px=999" role="button" title="42.jpg" alt="42.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could you try this add-in with your model and let me know the result?&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 21:06:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309265#M8902</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-05-12T21:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309271#M8903</link>
      <description>&lt;P&gt;The attached file is the file that contains the body and the sketch point that I tested the add-in using them in my previous reply.&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 21:09:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309271#M8903</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-05-12T21:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309299#M8904</link>
      <description>&lt;P&gt;Here is another output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43.jpg" style="width: 593px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/918175iDAA3A9C573A146DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="43.jpg" alt="43.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 21:26:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309299#M8904</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-05-12T21:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309537#M8905</link>
      <description>&lt;P&gt;Hi nnikbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks for your effort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the following Syntax Errors at&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for (Ptr&amp;lt;BRepFace&amp;gt; face : body-&amp;gt;faces())&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TestNormalToFace.cpp&lt;BR /&gt;1&amp;gt;TestNormalToFace.cpp(69): error C2143: syntax error : missing ',' before ':'&lt;BR /&gt;1&amp;gt;TestNormalToFace.cpp(70): error C2143: syntax error : missing ';' before '{'&lt;BR /&gt;1&amp;gt;TestNormalToFace.cpp(76): warning C4482: nonstandard extension used: enum 'adsk::fusion::FeatureOperations' used in qualified name&lt;BR /&gt;1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Visual Studio Came with Fusion 360.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thurai&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 23:58:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309537#M8905</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-12T23:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309557#M8906</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6402734"&gt;@tperam&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you download the add-in zip file attached to one of my previous replies? Do you get any error in compiling it?&lt;/P&gt;&lt;P&gt;Have you used the following using statements in your code?&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;using namespace adsk::core;
using namespace adsk::fusion;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 00:15:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10309557#M8906</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-05-13T00:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10311141#M8907</link>
      <description>&lt;P&gt;Hi nnikbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I unzipped the files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using namespace adsk::core;
using namespace adsk::fusion;&lt;/PRE&gt;&lt;P&gt;statements in the source code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am changing the code as a work around.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Thurai&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 16:39:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10311141#M8907</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-13T16:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using API, how to Determine the Normal Vector from a given point in a solid to a face</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10311362#M8908</link>
      <description>&lt;P&gt;Hi nnikbin,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;It worked Okay for all the 7 faces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot nnilbin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thurai&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 18:22:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/using-api-how-to-determine-the-normal-vector-from-a-given-point/m-p/10311362#M8908</guid>
      <dc:creator>tperam</dc:creator>
      <dc:date>2021-05-13T18:22:03Z</dc:date>
    </item>
  </channel>
</rss>

