I have a list of unaranged curves and I want to be able to organize them in a that lists them by intersection. How do you use the Geometry.DoesIntersect in a codeblock?
Here is my code. Why isn’t it working?
It’s actually occupied.DoesIntersect(current). You can always right click on a node and select Node to Code to translate that node (or selection of nodes) to a code block.
The description that appears on hovering over a node also usually gives an idea of the number of arguments required within parenthesis. Not always obvious, but quickly gives a fair idea.
In the case of Geometry.Intersect, only one.
From the picture above, I have organized the curves so that it’s easier for me to create a closed polycurve for each building pad from the picture. Is there a way? Here’s my code now so far:
def CreatePolyCurve(BP:var)
{
Lots = {};
Lot = {};
cnt = List.Count(BP);
return = [Imperative]
{
while (cnt > 0)
{
occupied = BP[0];
Lot = List.AddItemToEnd(BP[0], Lot);
BP = List.RemoveItemAtIndex(BP, 0);
cnt = cnt - 1;
i = 0;
while (i < cnt)
{
current = BP[i];
condition = occupied.DoesIntersect(current);
if (condition == true)
{
Lot = List.AddItemToEnd(current, Lot);
BP = List.RemoveItemAtIndex(BP, i);
cnt = cnt - 1;
i = 0;
}
else
{
i = i + 1;
}
}
}
return = Lot;
}