今天看到一个比较好理解的做法,就是多面体细分,然后细分到一定程度做投影点到球,然后做圆
但是代码不太懂,看看有没人了解
Private Sub RunScript(ByVal pts As List(Of On3dPoint), ByRef A As Object)
Dim Isoca As New List (Of onpolyline)
Dim Tri1 As New OnPolyline
Tri1.Append(pts(0))
Tri1.Append(pts(1))
Tri1.Append(pts(2))
Tri1.Append(pts(0))
Isoca.Add(Tri1)
Dim Tri2 As New OnPolyline
Tri2.Append(pts(0))
Tri2.Append(pts(2))
Tri2.Append(pts(3))
Tri2.Append(pts(0))
Isoca.Add(Tri2)
Dim Tri3 As New OnPolyline
Tri3.Append(pts(0))
Tri3.Append(pts(3))
Tri3.Append(pts(4))
Tri3.Append(pts(0))
Isoca.Add(Tri3)
Dim Tri4 As New OnPolyline
Tri4.Append(pts(0))
Tri4.Append(pts(4))
Tri4.Append(pts(5))
Tri4.Append(pts(0))
Isoca.Add(Tri4)
Dim Tri5 As New OnPolyline
Tri5.Append(pts(0))
Tri5.Append(pts(5))
Tri5.Append(pts(1))
Tri5.Append(pts(0))
Isoca.Add(Tri5)
Dim Tri6 As New OnPolyline
Tri6.Append(pts(1))
Tri6.Append(pts(6))
Tri6.Append(pts(2))
Tri6.Append(pts(1))
Isoca.Add(Tri6)
Dim Tri7 As New OnPolyline
Tri7.Append(pts(2))
Tri7.Append(pts(7))
Tri7.Append(pts(3))
Tri7.Append(pts(2))
Isoca.Add(Tri7)
Dim Tri8 As New OnPolyline
Tri8.Append(pts(3))
Tri8.Append(pts(8))
Tri8.Append(pts(4))
Tri8.Append(pts(3))
Isoca.Add(Tri8)
Dim Tri9 As New OnPolyline
Tri9.Append(pts(4))
Tri9.Append(pts(9))
Tri9.Append(pts(5))
Tri9.Append(pts(4))
Isoca.Add(Tri9)
Dim Tri10 As New OnPolyline
Tri10.Append(pts(5))
Tri10.Append(pts(10))
Tri10.Append(pts(1))
Tri10.Append(pts(5))
Isoca.Add(Tri10)
Dim Tri11 As New OnPolyline
Tri11.Append(pts(6))
Tri11.Append(pts(7))
Tri11.Append(pts(2))
Tri11.Append(pts(6))
Isoca.Add(Tri11)
Dim Tri12 As New OnPolyline
Tri12.Append(pts(8))
Tri12.Append(pts(9))
Tri12.Append(pts(4))
Tri12.Append(pts(8))
Isoca.Add(Tri12)
Dim Tri13 As New OnPolyline
Tri13.Append(pts(9))
Tri13.Append(pts(10))
Tri13.Append(pts(5))
Tri13.Append(pts(9))
Isoca.Add(Tri13)
Dim Tri14 As New OnPolyline
Tri14.Append(pts(10))
Tri14.Append(pts(6))
Tri14.Append(pts(1))
Tri14.Append(pts(10))
Isoca.Add(Tri14)
Dim Tri15 As New OnPolyline
Tri15.Append(pts(7))
Tri15.Append(pts(8))
Tri15.Append(pts(3))
Tri15.Append(pts(7))
Isoca.Add(Tri15)
Dim Tri16 As New OnPolyline
Tri16.Append(pts(6))
Tri16.Append(pts(11))
Tri16.Append(pts(7))
Tri16.Append(pts(6))
Isoca.Add(Tri16)
Dim Tri17 As New OnPolyline
Tri17.Append(pts(7))
Tri17.Append(pts(11))
Tri17.Append(pts(8))
Tri17.Append(pts(7))
Isoca.Add(Tri17)
Dim Tri18 As New OnPolyline
Tri18.Append(pts(8))
Tri18.Append(pts(11))
Tri18.Append(pts(9))
Tri18.Append(pts(8))
Isoca.Add(Tri18)
Dim Tri19 As New OnPolyline
Tri19.Append(pts(9))
Tri19.Append(pts(11))
Tri19.Append(pts(10))
Tri19.Append(pts(9))
Isoca.Add(Tri19)
Dim Tri20 As New OnPolyline
Tri20.Append(pts(10))
Tri20.Append(pts(11))
Tri20.Append(pts(6))
Tri20.Append(pts(10))
Isoca.Add(Tri20)
A = Isoca
End Sub |