|
3m
楼主 |
发表于 2010-3-28 19:07:47
|
只看该作者
我的关键性代码
If isnothing(pt) Then Exit Sub
Dim Svector As New On3dPoint(0, 0, 1)
Dim props2 As Integer = 0
Dim arcs As New List(Of OnArc)
Call Start(pt, svector, props0, props1, props2, gen, max1, min1, max2, min2, arcs)
a = arcs
Public Sub start(ByVal pt As On3dPoint, ByVal dir As on3dvector, ByVal props0 As Integer, ByVal props1 As Integer, ByVal props2 As Integer, ByVal gen As Integer, ByVal max1 As Double, ByVal min1 As Double, ByVal max2 As Double, ByVal min2 As Double, ByRef arcs As list(Of onarc))
If props2 >gen Then Exit Sub
'randomize
For i As int32=1 To (rnd() * props1 + props0)
Dim randpt As New on3dpoint
randpt = randompoint(pt, max1, min1, max2, min2, dir)
Dim wing As New OnArc
wing = addarc(pt, randpt, dir)
If isnothing(wing) Then Exit Sub
Dim direction As New on3dvector
direction = wing.TangentAt(wing.Domain(1))
arcs.add(wing)
Call Start(randpt, direction, props0, props1, props2 + 1, gen, max1, min1, max2, min2, arcs)
Next
End Sub |
|