- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using C++, how do I convert a spline into a NurbsCurve3D as the following Intersection with a spline does not work?
I believe a spline needs to be converted to a NurbsCurve3D type for Intersection to work. Am I right?
IntersectionPtsObjCollspline = Planenormal->intersectWithCurve(spline);
Part of my code is given below.
Thurai
//////////////////////////////////////////////////
// Create an object collection for the points.
Ptr<ObjectCollection> points = ObjectCollection::create();
if (!points)
return false;
// Define the points the spline with fit through.
points->add(Point3D::create(- 5, -6, -2));
points->add(Point3D::create(0, 0, 0));
points->add(Point3D::create(6, 4, 4));
// Create the spline.
Ptr<SketchCurves> sketchCurves = sketch->sketchCurves();
if(!sketchCurves)
return false;
Ptr<SketchFittedSplines> splines = sketchCurves->sketchFittedSplines();
if (!splines)
return false;
Ptr<SketchFittedSpline> spline = splines->add(points);
if (!spline)
return false;
double h, x, y, z, Pi, Angle;
/* Compute VTOLBody.zValueOfPlaneBulk[Ifr][IzBulk] */
z = 0.0;
h = 2.0;
Ptr<Vector3D> VectorNormal = adsk::core::Vector3D::create(0, 1, 0);
Ptr<Plane> PlaneNormal = adsk::core::Plane::create(adsk::core::Point3D::create(0, 1.0, 0), Vectornormal);
if(!Planenormal)
return false;
Ptr<ObjectCollection> IntersectionPtsObjCollspline = adsk::core::ObjectCollection::create();
if(!IntersectionPtsObjCollspline)
return false;
/* Dummy Initialize */
Ptr<Point3D> splineIntersectPts3D = adsk::core::Point3D::create(0, 0, 0);
IntersectionPtsObjCollspline = Planenormal->intersectWithCurve(spline);
if (!IntersectionPtsObjCollspline) return false;
ui->messageBox(" After intersectWithCurve() ");
splineIntersectPts3D = IntersectionPtsObjCollspline->item(0);
/////////////////////////////////////////////////
Solved! Go to Solution.