NURBS カーブリストの完全なデータ記述を戻します。データは 1D 配列で戻されます。順序は NurbsCurveList.Get メソッドの出力引数と同じです。
注:このメソッドは、JScriptやPerlScriptなどの引数の参照渡しをサポートしないスクリプト言語で使用する必要があります。出力引数の取得の詳細については、About Output Argument Arrays を参照してください。
Object NurbsCurveList.Get2( siNurbsFormat in_eNurbsFormat ); |
oArray = NurbsCurveList.Get2( [NurbsFormat] ); |
Array。順序は、Count、ControlPoints、NbControlPoints、Knots、NbKnots、Closed、Degree、Parameterization です。
パラメータ | タイプ | 説明 |
---|---|---|
NurbsFormat | siNurbsFormat |
NURBs のデータ形式を指定します。 デフォルト値:siSINurbs |
/* This example shows how to retrieve the output arguments returned by NurbsCurveList.Get2 */ var oRoot = Application.ActiveProject.ActiveScene.Root; var oText = oRoot.AddGeometry( "Text", "NurbsCurve" ); oText.text = "b"; // convert VB array to JScript array var vbArgs = new VBArray(oText.ActivePrimitive.Geometry.Get2( siSINurbs )); var args = vbArgs.toArray(); // Number of curves LogMessage("number of curves: " + args[0] ); // Number of control points per curve var vbArg6 = new VBArray(args[2]); var ncpoints = vbArg6.toArray(); for (i = 0; i < ncpoints.length; i++) { LogMessage("number of control points for curve " + i + ": " + ncpoints[i] ); } // Control points var vbArg1 = new VBArray(args[1]); var cp = vbArg1.toArray(); for ( i=0; i<cp.length; i++ ) { for ( j=0, k=0; k<cp[i]; k++, j+=4 ) { LogMessage("crv" + i + "[" + k + "]: " + cp[j] + ", " + cp[j+1] + ", " + cp[j+2] + ", " + cp[j+3] ); } } // Number of knots per curve var vbArg7 = new VBArray(args[4]); var nknots = vbArg7.toArray(); for (i = 0; i < nknots.length; i++) { LogMessage("number of knots for curve " + i + ": " + nknots[i] ); } // Knots var vbArg2 = new VBArray(args[3]); var knots = vbArg2.toArray(); for ( j=0; j<knots.length; j++) { for (i = 0; i < nknots[j]; i++) { LogMessage("crv" + j + ": " + "knots" + i + ": " + knots[i] ); } } // get nurbs curves closed state var vbArg3 = new VBArray(args[5]); var closes = vbArg3.toArray(); for (i = 0; i < closes.length; i++) { LogMessage("curve" + i + " closed: " + closes[i] ); } // get nurbs degree var vbArg4 = new VBArray(args[6]); var degrees = vbArg4.toArray(); for (i = 0; i < degrees.length; i++) { LogMessage("curve" + i + " degree: " + degrees[i] ); } // get nurbs parameterization var vbArg5 = new VBArray(args[7]); var params = vbArg5.toArray(); for (i = 0; i < params.length; i++) { LogMessage("curve" + i + " parameterization: " + params[i] ); } // Expected result: //INFO : number of curves: 2 //INFO : number of control points for curve 0: 26 //INFO : number of control points for curve 1: 16 //INFO : crv0[0]: 0.8072018004501126, 0, 0, 1 //INFO : crv0[1]: 0.8072018004501126, 0.1785915228807202, 0, 1 //INFO : crv0[2]: 0.8072018004501126, 0.3571830457614404, 0, 1 //INFO : crv0[3]: 1.0946642910727682, -0.06301575393848462, 0, 1 //INFO : crv0[4]: 1.5996811702925732, -0.06301575393848462, 0, 1 //INFO : crv0[5]: 2.1074174793698423, -0.06301575393848462, 0, 1 //INFO : crv0[6]: 2.470062828207052, 0.3369748687171793, 0, 1 //INFO : crv0[7]: 2.8327081770442612, 0.7369654913728433, 0, 1 //INFO : crv0[8]: 2.8327081770442612, 1.4698049512378095, 0, 1 //INFO : crv0[9]: 2.8327081770442612, 1.7785071267816954, 0, 1 //INFO : crv0[10]: 2.7467882595648913, 2.049653038259565, 0, 1 //INFO : crv0[11]: 2.6608683420855214, 2.3207989497374344, 0, 1 //INFO : crv0[12]: 2.509166354088522, 2.5127297449362342, 0, 1 //INFO : crv0[13]: 2.357464366091523, 2.7046605401350336, 0, 1 //INFO : crv0[14]: 2.122538447111778, 2.8106948612153037, 0, 1 //INFO : crv0[15]: 1.887612528132033, 2.916729182295574, 0, 1 //INFO : crv0[16]: 1.624531132783196, 2.916729182295574, 0, 1 //INFO : crv0[17]: 1.1492873218304575, 2.916729182295574, 0, 1 //INFO : crv0[18]: 0.8432108027006752, 2.533992873218305, 0, 1 //INFO : crv0[19]: 0.8432108027006752, 3.23548855963991, 0, 1 //INFO : crv0[20]: 0.8432108027006752, 3.9369842460615154, 0, 1 //INFO : crv0[21]: 0.6016504126031508, 3.9369842460615154, 0, 1 //INFO : crv0[22]: 0.36009002250562644, 3.9369842460615154, 0, 1 //INFO : crv0[23]: 0.36009002250562644, 1.9684921230307577, 0, 1 //INFO : crv0[24]: 0.36009002250562644, 0, 0, 1 //INFO : crv0[25]: 0.5836459114778695, 0, 0, 1 //INFO : crv1[0]: 0.8072018004501126, 0, 0, 1 //INFO : crv1[1]: 0.8072018004501126, 0.1785915228807202, 0, 1 //INFO : crv1[2]: 0.8072018004501126, 0.3571830457614404, 0, 1 //INFO : crv1[3]: 1.0946642910727682, -0.06301575393848462, 0, 1 //INFO : crv1[4]: 1.5996811702925732, -0.06301575393848462, 0, 1 //INFO : crv1[5]: 2.1074174793698423, -0.06301575393848462, 0, 1 //INFO : crv1[6]: 2.470062828207052, 0.3369748687171793, 0, 1 //INFO : crv1[7]: 2.8327081770442612, 0.7369654913728433, 0, 1 //INFO : crv1[8]: 2.8327081770442612, 1.4698049512378095, 0, 1 //INFO : crv1[9]: 2.8327081770442612, 1.7785071267816954, 0, 1 //INFO : crv1[10]: 2.7467882595648913, 2.049653038259565, 0, 1 //INFO : crv1[11]: 2.6608683420855214, 2.3207989497374344, 0, 1 //INFO : crv1[12]: 2.509166354088522, 2.5127297449362342, 0, 1 //INFO : crv1[13]: 2.357464366091523, 2.7046605401350336, 0, 1 //INFO : crv1[14]: 2.122538447111778, 2.8106948612153037, 0, 1 //INFO : crv1[15]: 1.887612528132033, 2.916729182295574, 0, 1 //INFO : number of knots for curve 0: 27 //INFO : number of knots for curve 1: 17 //INFO : crv0: knots0: 0 //INFO : crv0: knots1: 0 //INFO : crv0: knots2: 1 //INFO : crv0: knots3: 1 //INFO : crv0: knots4: 2 //INFO : crv0: knots5: 2 //INFO : crv0: knots6: 3 //INFO : crv0: knots7: 3 //INFO : crv0: knots8: 4 //INFO : crv0: knots9: 4 //INFO : crv0: knots10: 5 //INFO : crv0: knots11: 5 //INFO : crv0: knots12: 6 //INFO : crv0: knots13: 6 //INFO : crv0: knots14: 7 //INFO : crv0: knots15: 7 //INFO : crv0: knots16: 8 //INFO : crv0: knots17: 8 //INFO : crv0: knots18: 9 //INFO : crv0: knots19: 9 //INFO : crv0: knots20: 10 //INFO : crv0: knots21: 10 //INFO : crv0: knots22: 11 //INFO : crv0: knots23: 11 //INFO : crv0: knots24: 12 //INFO : crv0: knots25: 12 //INFO : crv0: knots26: 13 //INFO : crv1: knots0: 0 //INFO : crv1: knots1: 0 //INFO : crv1: knots2: 1 //INFO : crv1: knots3: 1 //INFO : crv1: knots4: 2 //INFO : crv1: knots5: 2 //INFO : crv1: knots6: 3 //INFO : crv1: knots7: 3 //INFO : crv1: knots8: 4 //INFO : crv1: knots9: 4 //INFO : crv1: knots10: 5 //INFO : crv1: knots11: 5 //INFO : crv1: knots12: 6 //INFO : crv1: knots13: 6 //INFO : crv1: knots14: 7 //INFO : crv1: knots15: 7 //INFO : crv1: knots16: 8 //INFO : curve0 closed: true //INFO : curve1 closed: true //INFO : curve0 degree: 2 //INFO : curve1 degree: 2 //INFO : curve0 parameterization: 1 //INFO : curve1 parameterization: 1 |