/// <summary> /// Used for filling and refilling spheres. /// The triangle ID is added to the list within each smaller sphere. /// </summary> private static void FillWithTriangles(List<StructureSphere> spheres, DiabolicalModel aModel, MainForm form) { int status = 0; Triangle tri = new Triangle(); bool result = false; BoundingSphere bound; int count = aModel.CountTriangles(); for (int t = 0; t < count; t++) { status++; if (status > 33) { status = 0; form.ShowStatus("Fill with triangle: " + t.ToString()); } aModel.GetTriangle(ref t, ref tri); for (int s = 0; s < spheres.Count; s++) { bound = spheres[s].Sphere; tri.Intersects(ref bound, out result); if (result) { spheres[s].IDs.Add(t); } } } }