<?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: any way to draw closed spline only with PointsArray in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431747#M14831</link>
    <description>&lt;P&gt;thanks so much,Alexander. you always come out and give me greate help when needed. your code solved my problem perfectly.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2012 06:56:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-04-26T06:56:17Z</dc:date>
    <item>
      <title>any way to draw closed spline only with PointsArray</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431587#M14828</link>
      <description>&lt;P&gt;HI, everyone,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have an array of 2d or 3d Points, and I want to draw a closed spline who passes the input points exactly.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I found one of the AcdbSpline constructor,&lt;BR /&gt;&lt;BR /&gt;AcDbSpline(&lt;BR /&gt;int degree,&lt;BR /&gt;Adesk::Boolean rational,&lt;BR /&gt;Adesk::Boolean closed,// this should be true&lt;BR /&gt;Adesk::Boolean periodic,&lt;BR /&gt;const AcGePoint3dArray&amp;amp; controlPoints,//&lt;FONT color="#FF0000"&gt; I only have this.&lt;/FONT&gt;&lt;BR /&gt;const AcGeDoubleArray&amp;amp; knots,// I don't have this.&lt;BR /&gt;const AcGeDoubleArray&amp;amp; weights,// neither this&lt;BR /&gt;double controlPtTol = 0.0,&lt;BR /&gt;double knotTol = 0.0);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Like the Spline commond in CAD, is there any way to draw a closed spline, I give the Points, and cad gives all the default params.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 02:55:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431587#M14828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-26T02:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: any way to draw closed spline only with PointsArray</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431651#M14829</link>
      <description>&lt;P&gt;It sounds like you want to create a fit spline, which uses a different constructor.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 05:00:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431651#M14829</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2012-04-26T05:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: any way to draw closed spline only with PointsArray</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431665#M14830</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@cnngtdly wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I found one of the AcdbSpline constructor,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Like the Spline commond in CAD, is there any way to draw a closed spline, I give the Points, and cad gives all the default params.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There are other AcDbSpline constructor's. For example:&lt;/P&gt;
&lt;PRE&gt;AcDbSpline(const AcGePoint3dArray&amp;amp; points, int order = 4, double fitTolerance = 0.0); &lt;/PRE&gt;
&lt;P&gt;If you have to do spline closed:&lt;/P&gt;
&lt;PRE&gt;static Acad::ErrorStatus MakeSplineClosed(AcDbSpline *pSpline)
{
  Acad::ErrorStatus es = Acad::eOk, esOpen = Acad::eOk;
  AcGePoint3dArray fitPoints;
  int degree;
  double fitTolerance;
  Adesk::Boolean tangentsExist;
  Adesk::Boolean tangentStartDef;
  Adesk::Boolean tangentEndDef;
  AcGeVector3d startTangent;
  AcGeVector3d endTangent;
  Adesk::Boolean rational;
  Adesk::Boolean closed;
  Adesk::Boolean periodic;
  AcGePoint3dArray controlPoints;
  AcGeDoubleArray knots;
  AcGeDoubleArray weights;
  double controlPtTol;
  double knotTol;
  AcGeNurbCurve3d *curv = NULL;
  if (pSpline-&amp;gt;hasFitData()) {
    AcGeTol tol;
    if ((es = pSpline-&amp;gt;getFitData(fitPoints,degree,fitTolerance,tangentsExist,startTangent,endTangent)) == Acad::eOk) {
      tangentStartDef = tangentsExist &amp;amp;&amp;amp; (startTangent != AcGeVector3d::kIdentity);
      tangentEndDef   = tangentsExist &amp;amp;&amp;amp; (endTangent   != AcGeVector3d::kIdentity);
      AcGeTol fitTol; fitTol.setEqualPoint(fitTolerance);
      curv = new AcGeNurbCurve3d(fitPoints, startTangent, endTangent, tangentStartDef, tangentEndDef, fitTol);
      curv-&amp;gt;makeClosed();
      curv-&amp;gt;getFitData(fitPoints, fitTol, tangentsExist, startTangent, endTangent);
      if ((esOpen = pSpline-&amp;gt;upgradeOpen()) == Acad::eOk || (esOpen == Acad::eWasOpenForWrite)) {
        es = pSpline-&amp;gt;setFitData(fitPoints, degree, fitTol. equalPoint(), startTangent, endTangent);
        if (esOpen != Acad::eWasOpenForWrite) pSpline-&amp;gt;downgradeOpen();
      }
      delete curv;
    }
  } else {
    if ((es = pSpline-&amp;gt;getNurbsData(degree, rational, closed, periodic, controlPoints, knots, weights, controlPtTol, knotTol)) == Acad::eOk) {
      if ((esOpen = pSpline-&amp;gt;upgradeOpen()) == Acad::eOk || (esOpen == Acad::eWasOpenForWrite)) {
        es = pSpline-&amp;gt;setNurbsData(degree, rational, Adesk::kTrue, periodic, controlPoints, knots, weights, controlPtTol, knotTol);
        if (esOpen != Acad::eWasOpenForWrite) pSpline-&amp;gt;downgradeOpen();
      }
    }
  }
  return es;
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;P.S.: This code was written 6 years ago and need to check it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 05:21:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431665#M14830</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-04-26T05:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: any way to draw closed spline only with PointsArray</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431747#M14831</link>
      <description>&lt;P&gt;thanks so much,Alexander. you always come out and give me greate help when needed. your code solved my problem perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 06:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3431747#M14831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-26T06:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: any way to draw closed spline only with PointsArray</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3528676#M14832</link>
      <description>&lt;P&gt;Dear Rivilis!&lt;/P&gt;&lt;P&gt;compare to autocad spline close with ur program code close command is not that much equal to autocad close command here the start and end tangents are same value that why the spline get wrong output.If u got correct code plz post ASAP.&lt;SPAN style="line-height: 13.333333969116211px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2012 07:16:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/any-way-to-draw-closed-spline-only-with-pointsarray/m-p/3528676#M14832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-06T07:16:16Z</dc:date>
    </item>
  </channel>
</rss>

