计算一个曲面物件和另一个曲面物件的相交。Note, this function works on untrimmed surfaces.
Rhino.SurfaceSurfaceIntersection (strSurfaceA, strSurfaceB [, dblTolerance [, blnCreate]])
strSurfaceA |
Required.字符串。The identifier of the first surface object. |
strSurfaceB |
Required.字符串。The identifier of the second surface object. |
dblTolerance |
可选参数。Number.The absolute tolerance in drawing units.If omitted, the document's current absolute tolerance is used. |
blnCreate |
可选参数。Boolean.Create the intersection curves and points.If omitted, intersection geometry will not be created. |
Array |
If blnCreate is not specified or is equal to False, an array numbers identifying the intersection event type if successful.The array will contain one or more of the following intersection event types:
|
||||||||||||
Array |
If blnCreate is specified and is equal to True, a two-dimensional array of intersection information if successful.The array will contain one or more of the following elements:
|
||||||||||||
Null |
如果执行不成功或出错,返回空值。 |
Sub SSX()
Const rhObjectSurface = 8
Dim strSurfaceA, strSurfaceB, arrSSX
strSurfaceA = Rhino.GetObject("Select first surface", rhObjectSurface)
If IsNull(strSurfaceA) Or Rhino.IsSurface(strSurfaceA) = False Then Exit Sub
strSurfaceB = Rhino.GetObject("Select second surface", rhObjectSurface)
If IsNull(strSurfaceB) Or Rhino.IsSurface(strSurfaceB) = False Then Exit Sub
arrSSX = Rhino.SurfaceSurfaceIntersection(strSurfaceA, strSurfaceB,, True)
If Not IsArray(arrSSX) Then
Rhino.Print "Surfaces do not intersect."
Exit Sub
End If
For i = 0 to UBound(arrSSX)
Select Case arrSSX(i,0)
Case 1 Rhino.Print "Transverse surface-surface intersection curve."
Case 2 Rhino.Print "Tangent surface-surface intersection curve."
Case 3 Rhino.Print "Overlap surface-surface intersection curve."
Case 4 Rhino.Print "Transverse surface-surface intersection point."
Case 5 Rhino.Print "Tangent surface-surface intersection point."
End Select
Rhino.SelectObject arrSSX(i,1)
Next
End Sub