NurbsSurfaceMesh.Get2 operator

説明

NURBS サーフェイスメッシュの完全なデータ記述を戻します。データは 1D 配列で戻されます。順序はNurbsSurfaceMesh.Getメソッドの出力引数と同じです。

注:このメソッドは、JScriptやPerlScriptなどの引数の参照渡しをサポートしないスクリプト言語で使用する必要があります。出力引数の取得の詳細については、About Output Argument Arraysを参照してください。

スクリプト 構文

oArray = NurbsSurfaceMesh.Get2( [NurbsFormat] );

戻り値

VariantArray。順序は、Count、NbUControlPoints、NbVControlPoints、UKnots、NbUKnots、VKnots、NbVKnots、UClosed、VClosed、UDegree、VDegree、UParam、VParamです。

パラメータ

パラメータ タイプ 詳細
NurbsFormat siNurbsFormat NURBs のデータ形式を指定します。

デフォルト値:siSINurbs

JScript の例

// This example shows how to retrieve the output arguments returned by NurbsCurveList.Get2
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oGrid = oRoot.AddGeometry( "Grid", "NurbsSurface" );
oGrid.subdivu = 1;
oGrid.subdivv = 1;
Duplicate( "grid", null, 2, 1, 1, 0, 0, 1, 0, 1 );
AddToSelection( "grid,grid1", null, 1 );
SIAssembleNurbsMesh( null, 0.150, 0, 0, 1 );
SelectObj( "surfmsh" );
// convert VB array to JScript array
var vbArgs = new VBArray(Selection(0).ActivePrimitive.Geometry.Get2( siSINurbs ));
// get the number of surfaces
numSurfs = vbArgs.getItem(0);
LogMessage("number of surfaces: " + numSurfs);
// get the number of control points in U per surface
var uncpts = vbArgs.getItem(2);
uSize = uncpts.ubound(1)-uncpts.lbound(1)+1;
for (i = 0; i < uSize; i++) 
{
        LogMessage("number of control points in U for surface " + i + ": " + uncpts.getItem(i) );
}
// get the number of control points in V per surface
var vncpts = vbArgs.getItem(3)
vSize = vncpts.ubound(1)-vncpts.lbound(1)+1;
for (i = 0; i < vSize; i++) 
{
        LogMessage("number of control points in V for surface " + i + ": " + vncpts.getItem(i) );
}
// get the control point array
var cpts = vbArgs.getItem(1);
// dump all control points
for ( k=0, offset=0; k<numSurfs; offset += uncpts.getItem(k), k++ )
{
        for ( i=0; i<vncpts.getItem(k); i++ ) // V
        {
                for ( j=0; j<uncpts.getItem(k); j++ ) // U
                {
                        idx = j+offset;
                        LogMessage("surf" + k + ": cpts[0]" + "[" + i + "]" + "[" + idx + "]: " + cpts.getItem(0,i,idx));
                        LogMessage("surf" + k + ": cpts[1]" + "[" + i + "]" + "[" + idx + "]: " + cpts.getItem(1,i,idx));
                        LogMessage("surf" + k + ": cpts[2]" + "[" + i + "]" + "[" + idx + "]: " + cpts.getItem(2,i,idx));
                        LogMessage("surf" + k + ": cpts[3]" + "[" + i + "]" + "[" + idx + "]: " + cpts.getItem(3,i,idx));
                }
        }
}

関連項目

NurbsSurfaceMesh.Get