亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? delaunay.bas

?? delaunay三角剖分實(shí)現(xiàn)離散點(diǎn)生成三角網(wǎng)格算法
?? BAS
字號(hào):
Attribute VB_Name = "Module1"
'Credit to Paul Bourke (pbourke@swin.edu.au) for the original Fortran 77 Program :))
'Conversion by EluZioN (EluZioN@casesladder.com)
'You can use this code however you like providing the above credits remain in tact

Option Explicit

'Points (Vertices)
Public Type dVertex
    x As Long
    y As Long
    z As Long
End Type

'Created Triangles, vv# are the vertex pointers
Public Type dTriangle
    vv0 As Long
    vv1 As Long
    vv2 As Long
End Type

'Set these as applicable
Public Const MaxVertices = 500
Public Const MaxTriangles = 1000

'Our points
Public Vertex(MaxVertices) As dVertex

'Our Created Triangles
Public Triangle(MaxTriangles) As dTriangle

Private Function InCircle(xp As Long, yp As Long, x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, ByRef xc, ByRef yc, ByRef r) As Boolean
'Return TRUE if the point (xp,yp) lies inside the circumcircle
'made up by points (x1,y1) (x2,y2) (x3,y3)
'The circumcircle centre is returned in (xc,yc) and the radius r
'NOTE: A point on the edge is inside the circumcircle
     
Dim eps As Double
Dim m1 As Double
Dim m2 As Double
Dim mx1 As Double
Dim mx2 As Double
Dim my1 As Double
Dim my2 As Double
Dim dx As Double
Dim dy As Double
Dim rsqr As Double
Dim drsqr As Double

eps = 0.000001

InCircle = False
      
If Abs(y1 - y2) < eps And Abs(y2 - y3) < eps Then
    MsgBox "INCIRCUM - F - Points are coincident !!"
    Exit Function
End If

If Abs(y2 - y1) < eps Then
    m2 = -(x3 - x2) / (y3 - y2)
    mx2 = (x2 + x3) / 2
    my2 = (y2 + y3) / 2
    xc = (x2 + x1) / 2
    yc = m2 * (xc - mx2) + my2
ElseIf Abs(y3 - y2) < eps Then
    m1 = -(x2 - x1) / (y2 - y1)
    mx1 = (x1 + x2) / 2
    my1 = (y1 + y2) / 2
    xc = (x3 + x2) / 2
    yc = m1 * (xc - mx1) + my1
Else
    m1 = -(x2 - x1) / (y2 - y1)
    m2 = -(x3 - x2) / (y3 - y2)
    mx1 = (x1 + x2) / 2
    mx2 = (x2 + x3) / 2
    my1 = (y1 + y2) / 2
    my2 = (y2 + y3) / 2
    xc = (m1 * mx1 - m2 * mx2 + my2 - my1) / (m1 - m2)
    yc = m1 * (xc - mx1) + my1
End If
      
dx = x2 - xc
dy = y2 - yc
rsqr = dx * dx + dy * dy
r = Sqr(rsqr)
dx = xp - xc
dy = yp - yc
drsqr = dx * dx + dy * dy

If drsqr <= rsqr Then InCircle = True
        
End Function
Private Function WhichSide(xp As Long, yp As Long, x1 As Long, y1 As Long, x2 As Long, y2 As Long) As Integer
'Determines which side of a line the point (xp,yp) lies.
'The line goes from (x1,y1) to (x2,y2)
'Returns -1 for a point to the left
'         0 for a point on the line
'        +1 for a point to the right
 
Dim equation As Double

equation = ((yp - y1) * (x2 - x1)) - ((y2 - y1) * (xp - x1))

If equation > 0 Then
    WhichSide = -1
ElseIf equation = 0 Then
    WhichSide = 0
Else
    WhichSide = 1
End If

End Function

Public Function Triangulate(nvert As Integer) As Integer
'Takes as input NVERT vertices in arrays Vertex()
'Returned is a list of NTRI triangular faces in the array
'Triangle(). These triangles are arranged in clockwise order.

Dim Complete(MaxTriangles) As Boolean
Dim Edges(2, MaxTriangles * 3) As Long
Dim Nedge As Long

'For Super Triangle
Dim xmin As Long
Dim xmax As Long
Dim ymin As Long
Dim ymax As Long
Dim xmid As Long
Dim ymid As Long
Dim dx As Double
Dim dy As Double
Dim dmax As Double

'General Variables
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim ntri As Integer
Dim xc As Double
Dim yc As Double
Dim r As Double
Dim inc As Boolean

'Find the maximum and minimum vertex bounds.
'This is to allow calculation of the bounding triangle
xmin = Vertex(1).x
ymin = Vertex(1).y
xmax = xmin
ymax = ymin
For i = 2 To nvert
    If Vertex(i).x < xmin Then xmin = Vertex(i).x
    If Vertex(i).x > xmax Then xmax = Vertex(i).x
    If Vertex(i).y < ymin Then ymin = Vertex(i).y
    If Vertex(i).y > ymax Then ymax = Vertex(i).y
Next i
dx = xmax - xmin
dy = ymax - ymin
If dx > dy Then
    dmax = dx
Else
    dmax = dy
End If
xmid = (xmax + xmin) / 2
ymid = (ymax + ymin) / 2

'Set up the supertriangle
'This is a triangle which encompasses all the sample points.
'The supertriangle coordinates are added to the end of the
'vertex list. The supertriangle is the first triangle in
'the triangle list.

Vertex(nvert + 1).x = xmid - 2 * dmax
Vertex(nvert + 1).y = ymid - dmax
Vertex(nvert + 2).x = xmid
Vertex(nvert + 2).y = ymid + 2 * dmax
Vertex(nvert + 3).x = xmid + 2 * dmax
Vertex(nvert + 3).y = ymid - dmax
Triangle(1).vv0 = nvert + 1
Triangle(1).vv1 = nvert + 2
Triangle(1).vv2 = nvert + 3
Complete(1) = False
ntri = 1

'Include each point one at a time into the existing mesh
For i = 1 To nvert
    Nedge = 0
    'Set up the edge buffer.
    'If the point (Vertex(i).x,Vertex(i).y) lies inside the circumcircle then the
    'three edges of that triangle are added to the edge buffer.
    j = 0
    Do
        j = j + 1
        If Complete(j) <> True Then
            inc = InCircle(Vertex(i).x, Vertex(i).y, Vertex(Triangle(j).vv0).x, Vertex(Triangle(j).vv0).y, Vertex(Triangle(j).vv1).x, Vertex(Triangle(j).vv1).y, Vertex(Triangle(j).vv2).x, Vertex(Triangle(j).vv2).y, xc, yc, r)
            'Include this if points are sorted by X
            'If (xc + r) < Vertex(i).x Then
                'complete(j) = True
            'Else
            If inc Then
                Edges(1, Nedge + 1) = Triangle(j).vv0
                Edges(2, Nedge + 1) = Triangle(j).vv1
                Edges(1, Nedge + 2) = Triangle(j).vv1
                Edges(2, Nedge + 2) = Triangle(j).vv2
                Edges(1, Nedge + 3) = Triangle(j).vv2
                Edges(2, Nedge + 3) = Triangle(j).vv0
                Nedge = Nedge + 3
                Triangle(j).vv0 = Triangle(ntri).vv0
                Triangle(j).vv1 = Triangle(ntri).vv1
                Triangle(j).vv2 = Triangle(ntri).vv2
                Complete(j) = Complete(ntri)
                j = j - 1
                ntri = ntri - 1
            End If
            'End If
        End If
    Loop While j < ntri

    'Tag multiple edges
    'Note: if all triangles are specified anticlockwise then all
    'interior edges are opposite pointing in direction.
    For j = 1 To Nedge - 1
        If Not Edges(1, j) = 0 And Not Edges(2, j) = 0 Then
            For k = j + 1 To Nedge
                If Not Edges(1, k) = 0 And Not Edges(2, k) = 0 Then
                    If Edges(1, j) = Edges(2, k) Then
                        If Edges(2, j) = Edges(1, k) Then
                            Edges(1, j) = 0
                            Edges(2, j) = 0
                            Edges(1, k) = 0
                            Edges(2, k) = 0
                         End If
                     End If
               End If
             Next k
        End If
    Next j
    
    'Form new triangles for the current point
    'Skipping over any tagged edges.
    'All edges are arranged in clockwise order.
    For j = 1 To Nedge
            If Not Edges(1, j) = 0 And Not Edges(2, j) = 0 Then
                ntri = ntri + 1
                Triangle(ntri).vv0 = Edges(1, j)
                Triangle(ntri).vv1 = Edges(2, j)
                Triangle(ntri).vv2 = i
                Complete(ntri) = False
            End If
    Next j
Next i

'Remove triangles with supertriangle vertices
'These are triangles which have a vertex number greater than NVERT
i = 0
Do
    i = i + 1
    If Triangle(i).vv0 > nvert Or Triangle(i).vv1 > nvert Or Triangle(i).vv2 > nvert Then
        Triangle(i).vv0 = Triangle(ntri).vv0
        Triangle(i).vv1 = Triangle(ntri).vv1
        Triangle(i).vv2 = Triangle(ntri).vv2
        i = i - 1
        ntri = ntri - 1
    End If
Loop While i < ntri

Triangulate = ntri
End Function

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品成a人在线观看| 亚洲国产精品久久人人爱蜜臀| 亚洲三级电影网站| 麻豆专区一区二区三区四区五区| 成人福利电影精品一区二区在线观看| 欧美精品日韩精品| 亚洲免费视频中文字幕| 国产福利一区二区三区在线视频| 欧美怡红院视频| 最新日韩在线视频| 成人午夜激情视频| 欧美精品一区二区三区高清aⅴ| 香蕉影视欧美成人| 日本黄色一区二区| 亚洲欧洲美洲综合色网| 国产乱子伦一区二区三区国色天香| 欧美日韩aaaaaa| 亚洲国产你懂的| 一本久久综合亚洲鲁鲁五月天 | 国产精品综合二区| 91精品婷婷国产综合久久性色| 亚洲男女毛片无遮挡| 99精品久久99久久久久| 亚洲欧美精品午睡沙发| 成人h动漫精品一区二区| 国产精品污污网站在线观看| 国产盗摄视频一区二区三区| 久久色视频免费观看| 国产一区二区在线影院| 精品久久人人做人人爰| 精品一区二区三区视频 | 99r精品视频| 国产精品久久久久久久久免费桃花 | 在线视频欧美精品| 一区二区日韩av| 欧美亚洲高清一区二区三区不卡| 亚洲免费在线看| 欧美婷婷六月丁香综合色| 亚洲国产日韩一区二区| 欧美一区二区三区日韩视频| 蜜桃精品在线观看| 精品福利在线导航| 成人手机在线视频| 亚洲免费资源在线播放| 欧美色图12p| 毛片基地黄久久久久久天堂| 久久精品视频一区二区| 99久久久精品| 亚洲成人www| 日韩欧美一二三| 成人激情动漫在线观看| 亚洲国产日韩在线一区模特| 884aa四虎影成人精品一区| 麻豆传媒一区二区三区| 国产精品私房写真福利视频| 色播五月激情综合网| 轻轻草成人在线| 国产精品久久久久久久蜜臀| 在线看不卡av| 黑人精品欧美一区二区蜜桃| 欧美国产精品一区二区三区| 欧美综合视频在线观看| 久久99精品久久久久婷婷| 中文字幕二三区不卡| 欧美视频一区二区| 国产成人av影院| 亚洲午夜免费电影| 久久久久久9999| 在线视频国产一区| 国产精品99久久久久久久女警| 亚洲人成网站在线| 久久综合精品国产一区二区三区 | 91亚洲资源网| 久久国产精品区| 亚洲综合一区二区三区| 久久久精品欧美丰满| 欧美日韩激情一区二区三区| 国产福利视频一区二区三区| 午夜精品一区二区三区免费视频| 国产欧美一区二区精品仙草咪| 欧美日韩精品一区二区三区四区| 丁香婷婷综合五月| 琪琪一区二区三区| 亚洲激情六月丁香| 中文一区二区完整视频在线观看| 欧美丰满嫩嫩电影| 色噜噜狠狠色综合欧洲selulu| 国产乱码精品一区二区三区av| 视频一区二区欧美| 亚洲欧美日韩国产成人精品影院 | 亚洲欧美一区二区视频| 欧美成人精品1314www| 欧美亚洲综合久久| 色天天综合色天天久久| 丁香六月综合激情| 国产剧情一区二区三区| 久久精品国产亚洲高清剧情介绍| 亚洲综合色成人| 亚洲色图欧美激情| 中文字幕中文在线不卡住| 亚洲电影第三页| 亚洲欧洲日韩综合一区二区| 久久久777精品电影网影网 | 欧美怡红院视频| 成人国产精品视频| 成人精品国产福利| 国产精品一区二区在线看| 久久丁香综合五月国产三级网站| 亚洲午夜精品网| 亚洲成人av免费| 亚洲v日本v欧美v久久精品| 亚洲国产精品久久艾草纯爱| 亚洲一区二区综合| 午夜精品福利一区二区蜜股av | 国产日韩视频一区二区三区| 日韩久久久精品| 欧美精品一区二区三| 精品日韩成人av| 久久久久久亚洲综合| 久久久.com| 亚洲四区在线观看| 一区二区三区丝袜| 亚洲成人www| 久久精品国产免费| 狠狠久久亚洲欧美| 成人一道本在线| 91在线云播放| 在线电影院国产精品| 日韩一区二区电影在线| 夜夜精品浪潮av一区二区三区| 国产精品的网站| 亚洲综合免费观看高清完整版在线 | 91原创在线视频| 欧美亚洲动漫制服丝袜| 欧美一区二区三级| 久久久久久麻豆| 亚洲男女毛片无遮挡| 亚洲成在线观看| 狠狠色丁香婷婷综合| 不卡一区二区中文字幕| 欧美在线视频全部完| 日韩美女一区二区三区四区| 中文字幕 久热精品 视频在线| 亚洲欧美另类小说视频| 免费三级欧美电影| 成人app在线| 欧美一区二区成人6969| 国产日韩欧美不卡在线| 亚洲久草在线视频| 蜜桃视频免费观看一区| k8久久久一区二区三区| 3d动漫精品啪啪一区二区竹菊| 久久久久亚洲蜜桃| 亚洲五码中文字幕| 成人免费看片app下载| 欧美日韩国产精品成人| 国产日韩欧美精品一区| 偷拍一区二区三区四区| 成人国产精品视频| 亚洲精品精品亚洲| 极品少妇一区二区三区精品视频| 91亚洲午夜精品久久久久久| 精品日韩欧美一区二区| 亚洲一区二区三区爽爽爽爽爽 | 亚洲一区二三区| 国产成人免费av在线| 欧美日韩精品综合在线| 中文字幕视频一区二区三区久| 免费观看在线综合| 91福利视频久久久久| 国产日韩视频一区二区三区| 免费不卡在线视频| 在线一区二区三区四区五区 | 99久久精品情趣| www国产精品av| 视频精品一区二区| 在线观看不卡一区| 亚洲天天做日日做天天谢日日欢| 看片网站欧美日韩| 欧美精品乱人伦久久久久久| 亚洲精品视频在线观看网站| 成人网在线播放| 国产三区在线成人av| 国产在线视频精品一区| 欧美一卡二卡三卡| 日韩有码一区二区三区| 欧美日韩另类一区| 亚洲一二三区不卡| 欧美综合天天夜夜久久| 一区二区三区在线影院| 99免费精品在线| 中文字幕日韩一区二区| 成人免费高清在线| 欧美高清在线一区| 不卡一区中文字幕| 综合中文字幕亚洲| 91女人视频在线观看| 亚洲在线一区二区三区| 欧美在线免费视屏| 午夜亚洲国产au精品一区二区|