algorithmic modeling for Rhino
You can write a script to do it... here's a C# version.
private void RunScript(List<Line> L, ref object A)
{
List<Line> output = new List<Line>();
output.Add(L[0]);
for (int i = 1;i < L.Count;i++){
bool include = true;
for (int j = 0;j < output.Count;j++){
if(
output[j].PointAt(0) == L[i].PointAt(0)
&&
output[j].PointAt(1) == L[i].PointAt(1)
||
output[j].PointAt(0) == L[i].PointAt(1)
&&
output[j].PointAt(1) == L[i].PointAt(0)
){
include = false;
}
}
if(include){
output.Add(L[i]);
}
}
A = output;
}
If you'd prefer to test within a tolerance rather than test for exact equality, you can replace the lines that look like
output[j].PointAt(0) == L[i].PointAt(0)
with
output[j].PointAt(0).DistanceTo(L[i].PointAt(0)) < t
I've attached a version of this script that I tend to use - it also outputs the indices of the items from the original list that remain.
Very good script. I could easily adapt it for overlapping surfaces.
Thank you.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by