<?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: Hermite to Bezier (or NURBS) in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/6789868#M76602</link>
    <description>&lt;P&gt;If you still searching a way to do this, check the RevitAPI 2017 they introduced a new method in NurbSpline converting Hermite spline to NurbSpline or Curve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Hermite to Nurbs" href="http://www.revitapidocs.com/2017/cfb90f78-dc27-a305-031d-5e4ffac8a9ce.htm" target="_blank"&gt;http://www.revitapidocs.com/2017/cfb90f78-dc27-a305-031d-5e4ffac8a9ce.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jan 2017 18:33:08 GMT</pubDate>
    <dc:creator>rakotoarisoa_m</dc:creator>
    <dc:date>2017-01-07T18:33:08Z</dc:date>
    <item>
      <title>Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5067728#M76597</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance to anyone with advice or resources on the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find a way to convert a hemite spline to a bezier spline.&lt;/P&gt;&lt;P&gt;Take a flexible pipe (or duct) as an example.&lt;/P&gt;&lt;P&gt;I've had limited luck with google, one reference suggested the start and end tangent divided by 3 would give the bezier control points.&lt;/P&gt;&lt;P&gt;It seems Autodesk must have conversion routines in the core as DWG export provides a nurbs curve.&lt;/P&gt;&lt;P&gt;If I measure the control points from the exported curve, it's 451mm from the end point (which I can't seem to relate to a foot unit vector, certainly not by a factor of 3).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/103588iC110165408BF8552/image-size/original?v=mpbl-1&amp;amp;px=-1" align="center" title="140602 hermite spline to bezier.png" alt="140602 hermite spline to bezier.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 04:30:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5067728#M76597</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2014-06-02T04:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5068022#M76598</link>
      <description>&lt;P&gt;Dear Jon,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe my Google is better than yours &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These look like pretty useful candidates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;&lt;A href="http://cubic.org/docs/hermite.htm" target="_blank"&gt;http://cubic.org/docs/hermite.htm&lt;/A&gt; -- Hermite Curve Interpolation&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://cubic.org/docs/bezier.htm" target="_blank"&gt;http://cubic.org/docs/bezier.htm&lt;/A&gt; -- DeCasteljau Algorithm to calculate Bezier curves&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://math.stackexchange.com/questions/355431/relation-between-hermite-interpolation-and-bezier-curve" target="_blank"&gt;http://math.stackexchange.com/questions/355431/relation-between-hermite-interpolation-and-bezier-curve&lt;/A&gt; -- Bezier --&amp;gt; Hermite&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.graphicsgroups.com/5-graphics-algorithms/c6fe2b9d557394ab.htm" target="_blank"&gt;http://www.graphicsgroups.com/5-graphics-algorithms/c6fe2b9d557394ab.htm&lt;/A&gt; -- convert a hermite spline into a bezier and back&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 09:29:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5068022#M76598</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2014-06-02T09:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5096206#M76599</link>
      <description>&lt;P&gt;Thanks Jeremy for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your links are similar to ones I'd found. &amp;nbsp;I've spent some time testing this (setting up a grasshopper script) and confirm that a hermite spline is equivalent to a bezier spline if you divide the hermite tangent vectors by 3 (and add/subtract from the end points). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'd like some clarification of the behaviour Revit provides. &amp;nbsp;If I create a flexible pipe (code below), then revit doesn't give me what I specify (by my calculations). &amp;nbsp;I set tangents with vectors 0,0,3 and 3,0,0 and it seems you get vectors that are 0,0,3.1623 and&amp;nbsp;3.1623,0,0. &amp;nbsp;Why does Revit change this value? &amp;nbsp;Note if I change the code to unit vectors, the pipe shape (and tangent lengths) don't change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you query the created pipe (as I'd like to export these objects) using revit lookup, Revit reports normalized tangent vectors (which would be generate a very different spline) on the location curve. &amp;nbsp;How can I accurately extract the hermite tangent vector magnitudes? &amp;nbsp;Should I just assume this constant value that I observed above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've attached a spreadsheet calculating the coordinate at a parameter of 0.5 to demonstrate the tangent length discrepency (which matches revit interpolated point at mid parameter).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="140615 flexible pipe spline.png" alt="140615 flexible pipe spline.png" border="0" align="center" src="https://forums.autodesk.com/t5/image/serverpage/image-id/106264i3A832F9D870E2C03/image-size/original?v=mpbl-1&amp;amp;px=-1" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.IO;&lt;BR /&gt;using System.Reflection;&lt;BR /&gt;using Autodesk.Revit.DB;&lt;BR /&gt;using Autodesk.Revit.UI;&lt;BR /&gt;using Autodesk.Revit.Attributes;&lt;BR /&gt;using Autodesk.Revit.ApplicationServices;&lt;BR /&gt;using Autodesk.Revit.DB.Structure;&lt;BR /&gt;using Autodesk.Revit.DB.Mechanical;&lt;BR /&gt;using Autodesk.Revit.DB.Plumbing;&lt;/P&gt;&lt;P&gt;namespace GGYM&lt;BR /&gt;{&lt;BR /&gt;[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]&lt;BR /&gt;public class ImportIFCGeomGym : IExternalCommand&lt;BR /&gt;{&lt;BR /&gt;public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Document document = commandData.Application.ActiveUIDocument.Document;&lt;BR /&gt;Transaction trn = new Transaction(document, "ggTest");&lt;BR /&gt;trn.Start();&lt;BR /&gt;FilteredElementCollector collector = new FilteredElementCollector(document).OfClass(typeof(FlexPipeType));&lt;BR /&gt;ElementId pipeTypeId = collector.FirstElementId();&lt;/P&gt;&lt;P&gt;// find a pipe system type&lt;BR /&gt;FilteredElementCollector sysCollector = new FilteredElementCollector(document);&lt;BR /&gt;sysCollector.OfClass(typeof(PipingSystemType));&lt;BR /&gt;ElementId pipeSysTypeId = sysCollector.FirstElementId();&lt;/P&gt;&lt;P&gt;Level l = null;&lt;BR /&gt;FilteredElementCollector fec = new FilteredElementCollector(document).OfClass(typeof(Level));&lt;BR /&gt;foreach(Level lvl in fec)&lt;BR /&gt;{&lt;BR /&gt;l = lvl;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;FlexPipe pipe = null;&lt;BR /&gt;if (pipeTypeId != ElementId.InvalidElementId &amp;amp;&amp;amp; pipeSysTypeId != ElementId.InvalidElementId)&lt;BR /&gt;{&lt;BR /&gt;List&amp;lt;XYZ&amp;gt; points = new List&amp;lt;XYZ&amp;gt;();&lt;BR /&gt;points.Add(new XYZ(0, 0, 0));&lt;BR /&gt;points.Add(new XYZ(3, 0, 1));&lt;/P&gt;&lt;P&gt;pipe = FlexPipe.Create(document, pipeSysTypeId, pipeTypeId, l.Id,new XYZ(0,0,3),new XYZ(3,0,0), points);&lt;BR /&gt;}&lt;BR /&gt;trn.Commit();&lt;BR /&gt;return Result.Succeeded;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jun 2014 14:02:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5096206#M76599</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2014-06-15T14:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5098548#M76600</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Got a couple of questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) When you use tangents with other magnitudes (say 4 instead of 3) do you see Revit doing floating point changes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) What about when you use unit vectors, is it still approximate?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) I am not familiar with Hermite splines so have to ask, why is the magnitude of the tangent important?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Gopinath&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2014 22:58:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5098548#M76600</guid>
      <dc:creator>gopinath.taget</dc:creator>
      <dc:date>2014-06-16T22:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5104162#M76601</link>
      <description>&lt;P&gt;Hi Gopinath,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added 4 lines to the code (pasted below) to set a similar pipe with a tangent of 1 (instead of 3). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. &amp;nbsp;No noticeable floating point change to the inplane coordinate. &amp;nbsp;Image below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. &amp;nbsp;Aproximate to what? &amp;nbsp;I posted the spreadsheet showing the variation in shape. &amp;nbsp;A change in tangent magnitude should significantly affect the shape of the spline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. &amp;nbsp;I'm not so familiar with hermite splines either (hence the google references above). &amp;nbsp;It's a curious choice given every other software seems to have opted for nurbs. &amp;nbsp;I'd like to accurately and reliably create and extract geometry with Revit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I look forward to hearing further expanation about the way Revit provides API access to this geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="140619 tangent comparsion.png" alt="140619 tangent comparsion.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/107134i2D8B285439780ADD/image-size/original?v=mpbl-1&amp;amp;px=-1" align="center" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.IO;&lt;BR /&gt;using System.Reflection;&lt;BR /&gt;using Autodesk.Revit.DB;&lt;BR /&gt;using Autodesk.Revit.UI;&lt;BR /&gt;using Autodesk.Revit.Attributes;&lt;BR /&gt;using Autodesk.Revit.ApplicationServices;&lt;BR /&gt;using Autodesk.Revit.DB.Structure;&lt;BR /&gt;using Autodesk.Revit.DB.Mechanical;&lt;BR /&gt;using Autodesk.Revit.DB.Plumbing;&lt;/P&gt;&lt;P&gt;namespace GGYM&lt;BR /&gt;{&lt;BR /&gt;[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]&lt;BR /&gt;public class ImportIFCGeomGym : IExternalCommand&lt;BR /&gt;{&lt;BR /&gt;public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Document document = commandData.Application.ActiveUIDocument.Document;&lt;BR /&gt;Transaction trn = new Transaction(document, "ggTest");&lt;BR /&gt;trn.Start();&lt;BR /&gt;FilteredElementCollector collector = new FilteredElementCollector(document).OfClass(typeof(FlexPipeType));&lt;BR /&gt;ElementId pipeTypeId = collector.FirstElementId();&lt;/P&gt;&lt;P&gt;// find a pipe system type&lt;BR /&gt;FilteredElementCollector sysCollector = new FilteredElementCollector(document);&lt;BR /&gt;sysCollector.OfClass(typeof(PipingSystemType));&lt;BR /&gt;ElementId pipeSysTypeId = sysCollector.FirstElementId();&lt;/P&gt;&lt;P&gt;Level l = null;&lt;BR /&gt;FilteredElementCollector fec = new FilteredElementCollector(document).OfClass(typeof(Level));&lt;BR /&gt;foreach(Level lvl in fec)&lt;BR /&gt;{&lt;BR /&gt;l = lvl;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;FlexPipe pipe = null;&lt;BR /&gt;if (pipeTypeId != ElementId.InvalidElementId &amp;amp;&amp;amp; pipeSysTypeId != ElementId.InvalidElementId)&lt;BR /&gt;{&lt;BR /&gt;List&amp;lt;XYZ&amp;gt; points = new List&amp;lt;XYZ&amp;gt;();&lt;BR /&gt;points.Add(new XYZ(0, 0, 0));&lt;BR /&gt;points.Add(new XYZ(3, 0, 1));&lt;/P&gt;&lt;P&gt;pipe = FlexPipe.Create(document, pipeSysTypeId, pipeTypeId, l.Id,new XYZ(0,0,1),new XYZ(1,0,0), points);&lt;BR /&gt;points.Clear();&lt;BR /&gt;points.Add(new XYZ(0, 1, 0));&lt;BR /&gt;points.Add(new XYZ(3, 1, 1));&lt;BR /&gt;pipe = FlexPipe.Create(document, pipeSysTypeId, pipeTypeId, l.Id,new XYZ(0,0,3),new XYZ(3,0,0), points);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;trn.Commit();&lt;BR /&gt;return Result.Succeeded;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 06:22:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/5104162#M76601</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2014-06-19T06:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/6789868#M76602</link>
      <description>&lt;P&gt;If you still searching a way to do this, check the RevitAPI 2017 they introduced a new method in NurbSpline converting Hermite spline to NurbSpline or Curve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Hermite to Nurbs" href="http://www.revitapidocs.com/2017/cfb90f78-dc27-a305-031d-5e4ffac8a9ce.htm" target="_blank"&gt;http://www.revitapidocs.com/2017/cfb90f78-dc27-a305-031d-5e4ffac8a9ce.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 18:33:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/6789868#M76602</guid>
      <dc:creator>rakotoarisoa_m</dc:creator>
      <dc:date>2017-01-07T18:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hermite to Bezier (or NURBS)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/6789942#M76603</link>
      <description>&lt;P&gt;Wow, cool! Thank you for pointing out! Also&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="truncate"&gt;CreateCurve Method (HermiteSpline);&lt;/H4&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="summary"&gt;Creates a new geometric Curve object by converting the given HermiteSpline. The created curve may be a NURBSpline or a simpler curve such as line or arc.&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&lt;A href="http://www.revitapidocs.com/2017/c0191746-fdd6-4f24-cfb7-29a6a88bc05b.htm" target="_blank"&gt;http://www.revitapidocs.com/2017/c0191746-fdd6-4f24-cfb7-29a6a88bc05b.htm&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="summary"&gt;Cheers,&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="summary"&gt;Jeremy&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 19:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hermite-to-bezier-or-nurbs/m-p/6789942#M76603</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-01-07T19:47:46Z</dc:date>
    </item>
  </channel>
</rss>

