Create face from spline curves

Technical discussions
Post Reply
IvanGr
Posts: 4
Joined: Sun Aug 04, 2013 10:49 pm

Create face from spline curves

Post by IvanGr »

Hi,

This is what I am trying to do: I load set of points which describes closed curves. I create a IBSplineCurve_DG and pass the points to the IBSplineCurve_DG.InitFromPoints().

Code: Select all

IPointArray_DG points;
curve.InitFromPoints(points,3,8,Continuity_DG.eCont_G2,0.00001);
curve.SetPeriodic();
Here is the first question. Is it necessary that the last point is identical to the first point so that dgk really makes a closed curve?

I intend to create edges and wires from the bspline curves. Will it work?

The more important question for me: I want co create a face (and later a solid) from these curves, the first step is to create a face which are limited by two of such closed curves.
How can I create a face from two given closed bspline curves?

Best regards

Ivan

Prashant Kande
Posts: 62
Joined: Mon Apr 04, 2016 4:55 am

Re: Create face from spline curves

Post by Prashant Kande »

Hi IvanGr

InitFromPoints() is intended for redundant sets of points to approximate. Unfortunately it does not work for creating a periodic smooth curve. Your code with or without the duplicated end would produce closed, but not smooth curve.

Use Interpolate*() or Init*() instead. They are designed for defining a curve with non-redundant sets of points or poles:

Code: Select all

	void Interpolate4()
        {
            IPointArray_DG iArrPnt = (IPointArray_DG)m_gen.Create("PointArray_DG");

            iArrPnt.SetCount(3);
            PointDg pt = new PointDg();
            pt[0] = 0; pt[1] = 0; pt[2] = 0; iArrPnt.SetPoint(0, pt);
            pt[0] = 1; pt[1] = 2; pt[2] = 0; iArrPnt.SetPoint(1, pt);
            pt[0] = 2; pt[1] = 1; pt[2] = 0; iArrPnt.SetPoint(2, pt);

            IBSplineCurve_DG iCurveBS = (IBSplineCurve_DG)m_gen.Create("BSplineCurve_DG");

            iCurveBS.Interpolate(iArrPnt, true, 1e-3);
            iCurveBS.SetPeriodic(true);

            DisplayCurve(iCurveBS);
        }
This will be in InterfaceTests.IBSplineCurve() in the next update.

If you really need a smoothing closed curve, please get in touch. We welcome anybody to express interest here also. We might add it soon.

Regards

Prashant Kande
Posts: 62
Joined: Mon Apr 04, 2016 4:55 am

Re: Create face from spline curves

Post by Prashant Kande »

As per your second question, please take a look at IWireArrayToSurfaceBuilder_DG and how it is used in Surfaces sample.
Regards

IvanGr
Posts: 4
Joined: Sun Aug 04, 2013 10:49 pm

Re: Create face from spline curves

Post by IvanGr »

Thanks heaps, Prashant.
Better late than never :)

Post Reply