<?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: Remove loops from SketchFittedSpline in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025201#M6346</link>
    <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hi Mr Moritz.Bischof1,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consider the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Identify a profile you want to 'preserve'&lt;/LI&gt;&lt;LI&gt;Iterate through the spline's fit points.&lt;/LI&gt;&lt;LI&gt;Check if a given fit point falls within profile or not (perhaps algorithm here does need the explanation)&lt;/LI&gt;&lt;LI&gt;Dependent upon the objective include in the calculation profile's edge or implement some tolerances&lt;/LI&gt;&lt;LI&gt;Mark the spline fittedPoints which fall outside the profile (or outside tolerance)&lt;/LI&gt;&lt;LI&gt;Draw a new spline including all fit points from the previous one, but marked&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 00:35:18 GMT</pubDate>
    <dc:creator>MichaelT_123</dc:creator>
    <dc:date>2022-03-24T00:35:18Z</dc:date>
    <item>
      <title>Remove loops from SketchFittedSpline</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025086#M6345</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moritzbischof1_1-1648074336228.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1039959i9E5697C0253BA32F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moritzbischof1_1-1648074336228.png" alt="moritzbischof1_1-1648074336228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A script im working on generates points and draws a SketchFittedSpline through them. In the image above, you can see a part of the SketchFittedSpline, and the blue area it encloses. However, there is also this loop (which i circled in green) which i would like to get rid of.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried a lot of approaches, like manually calculating intersections using the Bently-Ottmann algorithm, but that went nowhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would highly appreciate some guidance where to start! I was hoping that some features of the API would make this somewhat easy so that I could avoid having to calculate everything manually.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 22:56:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025086#M6345</guid>
      <dc:creator>moritz.bischof1</dc:creator>
      <dc:date>2022-03-23T22:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Remove loops from SketchFittedSpline</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025201#M6346</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hi Mr Moritz.Bischof1,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consider the following:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Identify a profile you want to 'preserve'&lt;/LI&gt;&lt;LI&gt;Iterate through the spline's fit points.&lt;/LI&gt;&lt;LI&gt;Check if a given fit point falls within profile or not (perhaps algorithm here does need the explanation)&lt;/LI&gt;&lt;LI&gt;Dependent upon the objective include in the calculation profile's edge or implement some tolerances&lt;/LI&gt;&lt;LI&gt;Mark the spline fittedPoints which fall outside the profile (or outside tolerance)&lt;/LI&gt;&lt;LI&gt;Draw a new spline including all fit points from the previous one, but marked&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 00:35:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025201#M6346</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2022-03-24T00:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove loops from SketchFittedSpline</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025327#M6347</link>
      <description>&lt;P&gt;Hey Michael,&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the reply.&lt;/P&gt;&lt;P&gt;While you did not directly answer the question, you motivated me to dig a bit deeper in the API docs, and I found a solution which works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. create a temporary sketch&lt;/P&gt;&lt;P&gt;2. create my shape in the temporary sketch using lines&lt;/P&gt;&lt;P&gt;3. get the profile from the temporary sketch im interested in:&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="python"&gt;biggest = None
for p in tmp_sketch.profiles:
    if biggest is None or p.areaProperties().area &amp;gt; biggest.areaProperties().area:
        biggest = p&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;4. copy all points from the profile&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="python"&gt; # copy points from profile into new list
 resulting_profile_curves = biggest.profileLoops.item(0).profileCurves
 new_point_list = adsk.core.ObjectCollection.create()
 for curve in resulting_profile_curves:
     line: Line3D = curve.geometry
     new_point_list.add(line.endPoint.copy())&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;5. create the final SketchFittedSpline in the "original" sketch&lt;/P&gt;&lt;P&gt;6. delete temporary sketch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Definetely got more familiar with the API trying to figure this out ^^&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 02:09:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/remove-loops-from-sketchfittedspline/m-p/11025327#M6347</guid>
      <dc:creator>moritz.bischof1</dc:creator>
      <dc:date>2022-03-24T02:09:12Z</dc:date>
    </item>
  </channel>
</rss>

