Page 1 of 1

Create face from spline curves

Posted: Fri May 29, 2020 3:53 am
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

Re: Create face from spline curves

Posted: Mon Jun 01, 2020 12:05 am
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

Re: Create face from spline curves

Posted: Tue Jun 02, 2020 4:41 am
by Prashant Kande
As per your second question, please take a look at IWireArrayToSurfaceBuilder_DG and how it is used in Surfaces sample.
Regards

Re: Create face from spline curves

Posted: Fri Jun 12, 2020 12:08 am
by IvanGr
Thanks heaps, Prashant.
Better late than never :)