forked from mcneel/MOVED-rhinoscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawCrossedLinesOnFaces.rvb
33 lines (25 loc) · 1.02 KB
/
DrawCrossedLinesOnFaces.rvb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' DrawCrossedLinesOnFaces.rvb -- September 2007
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Sub DrawCrossedLinesOnFaces()
Dim strMesh, arrIndices, intIndex
Dim arrFaces, arrVertices, arrFace
strMesh = Rhino.GetObject("Select mesh", 32)
If IsNull(strMesh) Then Exit Sub
arrIndices = Rhino.GetMeshFaces(strMesh, "Select faces to draw on")
If IsNull(arrIndices) Then Exit Sub
arrFaces = Rhino.MeshFaceVertices(strMesh)
arrVertices = Rhino.MeshVertices(strMesh)
For Each intIndex In arrIndices
arrFace = arrFaces(intIndex)
' Test for quad face
If arrFace(2) <> arrFace(3) Then
Call Rhino.AddLine(arrVertices(arrFace(0)), arrVertices(arrFace(2)))
Call Rhino.AddLine(arrVertices(arrFace(1)), arrVertices(arrFace(3)))
End If
Next
End Sub