
Sets a NurbsSurfaceMesh from a complete data description of the mesh. This is only available from scripted operators. Note: If you use it on a object with some clusters and you change the topology the burden of updating the clusters is on the user. For non-scripted operators this property can only be set if the object has been frozen.
NurbsSurfaceMesh.Set( Count, UVControlPoints, [NbUControlPoints], [NbVControlPoints], [UKnots], [NbUKnots], [VKnots], [NbVKnots], [UClosed], [VClosed], [UDegree], [VDegree], [UParam], [VParam], [NurbsFormat] ); |
| Parameter | Type | Description |
|---|---|---|
| Count | Long | Number of NurbsSurface in the mesh. |
| UVControlPoints | 1D Array | The control points are stored in a 1 dimensional array. The array must contain the number of U control points, followed by the number of V control points, followed by the sequence of x,y,z,w values e.g. {NbU, NbV, Xo,Yo,Zo,Wo...X(n-1),Y(n-1),Z(n-1),W(n-1)}. |
| NbUControlPoints | Array of Longs | Specifies the number of U ControlPoints per NurbsCurve. |
| NbVControlPoints | Array of Longs | Specifies the number of V ControlPoints per NurbsCurve. |
| UKnots | Array of Doubles | An array of knot values in U direction. |
| NbUKnots | Array of Longs | Specifies the number of U Knots per NurbsCurve. |
| VKnots | Array of Doubles | An array of knot values in V direction. |
| NbVKnots | Array of Longs | Specifies the number of V Knots per NurbsCurve. |
| UClosed | Array of Boolean values | Specifies whether the nurbs surface is closed in U direction. |
| VClosed | Array of Boolean values | Specifies whether the nurbs surface is closed in V direction. |
| UDegree | Array of Longs | Degree of the nurbs surface in U direction. |
| VDegree | Array of Longs | Degree of the nurbs surface in V direction. |
| UParam | Array of siKnotParameterization values | The parameterization factor of the nurbs surface in U direction. |
| VParam | Array of siKnotParameterization values | The parameterization factor of the nurbs surface in V direction. |
| NurbsFormat | siNurbsFormat | Specifies how the data is formatted.
Default Value: siSINurbs |
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
|