2012-04-04 5 views
0

次のコードを使用してカーブをインクリメンタルに回転しようとしています(エディタは既に必要なライブラリをインポートしています)。私の3Dモデリングプログラムでは、角度が異なる線の代わりに線が重なって表示されます。 私は何が間違っていますか?VB.netまたはC#を使用してインクリメンタルにカーブを回転

C#の上

:VB.netで

private void RunScript(Curve ln, int x, double angle, ref object A) 
{ 
List<Curve> lines = new List<Curve>(); 
Int16 i = default(Int16); 
for(i = 0; i <= x; i++){ 
ln.Rotate(angle * i, Vector3d.ZAxis, ln.PointAtEnd); 
lines.Insert(i, ln); 
} 
A = lines; 

:私はループの中で次のものを回転する前に行を複製する必要が

Private Sub RunScript(ByVal ln As Curve, ByVal x As Integer, ByVal angle As Double,   
ByRef A As Object) 

Dim lns As New List(Of Curve)() 
Dim i As Int16 
For i = 0 To x 
ln.Transform(transform.Rotation(angle * i, vector3d.ZAxis, ln.PointAtEnd)) 
lns.Insert(i, ln) 
Next 
A = lns 

答えて

0

それ以外の場合の痕跡はありません。 VB.netで

private void RunScript(Curve ln, int x, double angle, ref object A) 
{ 
List<Curve> lns = new List<Curve>; 
for (int = 0; i<= x; i++) 
    { 
    Curve copy = ln.DuplicateCurve(); 
    copy.Rotate(angle * i, Vector3d.ZAxis, ln.PointAtEnd); 
    lns.Add(copy); 
    } 
} 
A = lns; 

Private Sub RunScript(By Val ln As Curve, ByVal x As Integer, ByVal angle As Double, By Ref A as Object) 
    Dim lns As New List(Of Curve)() 
    For i As Integer = 0 To x 
    Dim nl As Curve = ln.DuplicateCurve() 
    nl.Transform(transform.Rotation(angle*i, vector3D.ZAxis, ln.PointAtEnd)) 
    lns.Add(nl) 
    Next 
    A = lns 
End Sub 
C#の

関連する問題