Page 1 of 1

Surface-plane section

Posted: Thu Jun 18, 2020 3:54 am
by Daniel Laajava
Hello everyone
I am starting with this software. I am using Visual Basic with Visual Studio 2019.
What is the correct way to obtain intersection curve of a bspline surface and a plane?
Thank you in advance
Daniel

Re: Surface-plane section

Posted: Fri Jun 19, 2020 1:36 am
by Fausto
There is GetSurfaceIntersectionSpherePlaneTest() in Samples\NET\C#\Tests\ConsoleTester\IUVSurfaceTest.cs
a VB version for splines should look like:

Code: Select all

	Dim iBSSurf As IBSplineSurface_DG = mGenerator.Create("BSplineSurface_DG")
	Dim iSurface As IUVSurface_DG = iBSSurf
	'Define...
        Dim iPlane As IPlane_DG = mGenerator.Create("Plane_DG")
        'Modify...
        Dim iSurface As IUVSurface_DG = iPlane
        Dim iArr As ICurveArray_DG  = iSurface.GetSurfaceIntersection(iSurfacePlane)
        Dim n As Integer = iArr.GetCount()
        Dim iCurv As ICurve_DG  = iArr.GetAt(0)
        'Check on both surfaces
        Dim loc As CurveVsSurfaceLocation_DG = iSurface.GetCurveLocation(iCurv, 1e-4, 13)           
        ' Debug.Assert(loc = CurveVsSurfaceLocation_DG.eCurveVsSurfaceLocationDgOnSurface)
        Dim locPl As CurveVsSurfaceLocation_DG  = iSurfacePlane.GetCurveLocation(iCurv, 1e-4, 13)
        'Debug.Assert(locPl = CurveVsSurfaceLocation_DG.eCurveVsSurfaceLocationDgOnSurface)
Cheers

Re: Surface-plane section

Posted: Mon Jun 22, 2020 5:59 am
by Daniel Laajava
Nice, Fausto
ty