algorithmic modeling for Rhino
double hoheK = (bZ / 2) * (Math.Tan(9 * (Math.PI / 180)) );
DataTree<Point3d> Tmo = new DataTree<Point3d>();
Point3d[,] mO = new Point3d[aZX, aZY];
for(int i = 0;i < aZX;i++){
for(int j = 0;j < aZY;j++){
GH_Path pthMO = new GH_Path(j);
if(j == 0){
Point3d MO = new Point3d((bZ / 2) + (bZ * i), (hohe - hoheK), 0);
mO[i, j] = MO;
}
else if(j % 2 != 0){
Point3d MO1 = new Point3d((bZ * i), (hohe * (j + 1) - (hoheK * (j + 1))), 0);
mO[i, j] = MO1;
}
else{
Point3d MO2 = new Point3d((bZ / 2) + (bZ * i), (hohe - hoheK) * (j + 1 ), 0);
mO[i, j] = MO2;
}
Tmo.Add(mO[i, j], pthMO);
}
}
Tmo.Path(0).CullElement();
_MO = Tmo;
Trees are dictionaries of paths and lists. When you say you want to cull the last item in a given path, does that mean removing the last index in a path, or does it mean removing the last item in the list that is associated with the path?
input: {0;0;4;2} (A, B, C, D)
output 1 {0;0;4;2} (A, B, C, D)
output 2 {0;0;4;2} (A, B, C, D)
--
David Rutten
david@mcneel.com
Thanks for your reply!
I have a tree with variable amount of paths (in the code j). in each path is a variable long list of points(in the code i).
i solved my problem with TreeThatIWant.Branch(PathIWant).RemoveAt(ElementiWant);
is this the right way to do it or is there a better way?
thanks
Lukas
That's an excellent way.
--
David Rutten
david@mcneel.com
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
© 2024 Created by Scott Davidson. Powered by