Dim lDegree(2), bClosed(2), eParameterization(2), aControlPoints, aKnots(2), aNbKnots(2), aNbControlVertex(2), lCount
set oRoot = Application.activeproject.activescene.root
set oGrid1 = oRoot.AddGeometry("Grid", "NurbsSurface")
oGrid1.Kinematics.Global.Parameters("posx").value = oG
set oGrid2 = oRoot.AddGeometry("Grid", "NurbsSurface")
oGrid2.Kinematics.Global.Parameters("posx").value = oGrid1.Kinematics.Global.Parameters("posx").value - 4.0
SelectObj oGrid2
AddToSelection oGrid1
SIAssembleNurbsMesh , 0.150, False, False, True
SelectObj "surfmsh"
set oAssembledSurface = selection(0)
'We must freeze the object so that Set call succeeds
FreezeObj oAssembledSurface
oAssembledSurface.ActivePrimitive.Geometry.Get _
siSINurbs, _
lCount, _
aControlVertex, aNbControlVertex(siUDirection), aNbControlVertex(siVDirection), _
aKnots(siUDirection), aNbKnots(siUDirection), aKnots(siVDirection) , aNbKnots(siVDirection), _
bClosed(siUDirection),bClosed(siVDirection), _
lDegree(siUDirection),lDegree(siVDirection), _
eParameterization(siUDirection),eParameterization(siVDirection)
'Making a tunnel
l_total = 0
for k = 0 to lCount - 1
for i = 0 to aNbControlVertex(siVDirection)(k) - 1
for j = 0 to aNbControlVertex(siUDirection)(k) - 1
aControlVertex(1,i, j + l_total) = aControlVertex(1,i,j + l_total) + (aNbControlVertex(siVDirection)(k)/2 - abs( aNbControlVertex(siVDirection)(k)/2 - i))
next
next
l_total = l_total + aNbControlVertex(siUDirection)(k)
next
oAssembledSurface.ActivePrimitive.Geometry.Set _
lCount, _
aControlVertex, aNbControlVertex(siUDirection), aNbControlVertex(siVDirection), _
aKnots(siUDirection), aNbKnots(siUDirection), aKnots(siVDirection) , aNbKnots(siVDirection), _
bClosed(siUDirection),bClosed(siVDirection), _
lDegree(siUDirection),lDegree(siVDirection), _
eParameterization(siUDirection),eParameterization(siVDirection), _
siSINurbs |