@Amir_Habibi wrote:
Hi , what is the best way to loop a set of random double for creating a list of point inside a bounding box ?
I’ve showed the way for creating one single pointRandom random = new Random(); Point3d pt = new Point3d(0, 0, 0); //creating boundingbox around ur mesh for random point generation BoundingBox bb = mesh.GetBoundingBox(true); //finding the corners Point3d[] corners = bb.GetCorners(); //get the random pt pt.X = corners[0].X + (corners[1].X - corners[0].X) * random.NextDouble(); pt.Y = corners[0].Y + (corners[3].Y - corners[0].Y) * random.NextDouble(); pt.Z = corners[0].Z + (corners[4].Z - corners[0].Z) * random.NextDouble(); A = pt;
Posts: 3
Participants: 2