Grasshopper

algorithmic modeling for Rhino

EDIT: Disregard. I declared the path outside of the for loop. Putting it inside redeclares it with updated values each time. oops.

Hullo World-

I'm trying intersect two sets of Breps with the paths of the output being treated like an array of their associations. Below is the script I'm executing (2 inputs being lists of OnBreps). All seems to be going well except the path output, which is stuck at (0,0). i and j are incrementing as expected, but the indicies for the path are not updating. I'm assuming some syntactical mishap. Thoughts/references?

'Input brep lists are x and y

'Set Document Tolerance
Dim tol As Double = doc.AbsoluteTolerance()

'Just making sure the inputs are functioning
outSrf1 = x
outsrf2 = y

'Declare our DataTree of OnCurve
Dim intersections As New DataTree(Of OnCurve)
Dim i As Int32 = 0
Dim j As Int32 = 0
Dim path As New EH_Path(i, j)

'I want to output the paths to make sure they are incrementing. They aren't, as is.
Dim arrPaths As New List(Of EH_Path)

'Set up and perform the IntersectBreps
Dim xbrep As New OnBrep
Dim ybrep As New OnBrep


'I dont think I care about this point, so I'll just make a garbage dump variable
Dim ignore As New On3dPointArray

'Here's the For loop that performs the intersections and ISN'T updating the indicies for path(i,j) as I think it should

For Each xbrep In x
For Each ybrep In y
Dim currentCrv(0) As OnCurve
RhUtil.RhinoIntersectBreps(xbrep, ybrep, tol, currentCrv, ignore)

intersections.Add(currentCrv(0), path)
arrPaths.Add(path)
j = j + 1

Next
If (currentCrv(0) Is Nothing) Then Continue For
i = i + 1
j = 0
Next

A = intersections
outPaths = arrPaths


Cheers.

-Luke

Views: 308

Attachments:

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service