Imports Snap, Snap.Create
Public Class MyProgram
Public Shared Sub Main()
Dim p00, p01, p02, p03, p10, p11, p12, p13, p20, p21, p22, p23 As Position
p00 = { 0, 0, 0 } : p01 = { 0, 3, 1 } : p02 = { 0, 6, 1 } : p03 = { 0, 9, 0 }
p10 = { 3, 0, 1 } : p11 = { 3, 3, 2 } : p12 = { 3, 6, 2 } : p13 = { 3, 9, 1 }
p20 = { 6, 0, 0 } : p21 = { 6, 3, 1 } : p22 = { 6, 6, 2 } : p23 = { 6, 9, 0 }
Dim thruPoints As Position(,) = {{p00, p01, p02, p03}, {p10, p11, p12, p13}, {p20, p21, p22, p23} }
' Create Bezier patch through points
Dim bsurface As NX.Bsurface = BezierPatchThroughPoints(thruPoints)
' Get face geometry
Dim faceBsurface As NX.Face.Bsurface = bsurface.Face
Dim geom As Geom.Surface.Bsurface = faceBsurface.Geometry
' Write out the geometry properties of the face
InfoWindow.WriteLine("The poles of the b-surface are ")
InfoWindow.WriteLine(geom.Poles)
InfoWindow.WriteLine("The weights of the b-surface are ")
InfoWindow.WriteLine(geom.Weights)
InfoWindow.WriteLine("The knotsU of the b-surface are ")
InfoWindow.WriteLine(geom.KnotsU)
InfoWindow.WriteLine("The knotsV of the b-surface are ")
InfoWindow.WriteLine(geom.KnotsV)
InfoWindow.WriteLine("The degreeU of the b-surface is " & geom.DegreeU)
InfoWindow.WriteLine("The degreeV of the b-surface is " & geom.DegreeV)
InfoWindow.WriteLine("The orderU of the b-surface is " & geom.OrderU)
InfoWindow.WriteLine("The orderV of the b-surface is " & geom.OrderV)
End Sub
End Class
' Results: The output in the NX Information window is ...
' The poles of the b-surface face are
' ( 0 , 0 , 0 ) ( 0 , 2.84096812404742 , 1.53524529396854 )( 0 , 6.36409902996395 , 1.43659706844564 )( 0 , 9 , 0 )
' ( 2.9604972293626 , 0 , 2.00008668895851 )( 2.9604972293626 , 2.84096812404742 , 4.30746296165522 )( 2.9604972293626 , 6.36409902996395 , 1.88480459229175 )( 2.9604972293626 , 9 , 2.00008668895851 )
' ( 6 , 0 , 0 ) ( 6 , 2.84096812404742 , 0.0111836746879276 )( 6 , 6.36409902996395 , 4.49975544243664 )( 6 , 9 , 0 )
' The weights of the b-surface face are
' 1 1 1 1
' 1 1 1 1
' 1 1 1 1
' The knotsU of the b-surface face is
' 0 0 0 1 1 1
' The knotsV of the b-surface face is
' 0 0 0 0 1 1 1 1
' The degreeU of the b-surface face is 2
' The degreeV of the b-surface face is 3
' The orderU of the b-surface face is 3
' The orderV of the b-surface face is 4