Im trying to replicate the look of a Lidar point cloud in rhino python and have (sorta) succeeded by drawing a line from a point enclosed within a solid and running an intersection command to get a point on the surface. The problem is that I have to draw a line that is much larger than the enclosing surface and trim it back. Is there a way to draw a line UNTIL it hits a surface?
@rowhite
Note that rhinoscriptsyntax.ProjectPointToSurface returns a list of points.
If the list contains more than 1 point you will have to test which is closest to ‘you’.
def pointclose(point, point_list):
ds_min =min([point.DistanceTo(i) for i in point_list])
for i in point_list:
ds = point.DistanceTo(i)
if ds == ds_min:
return i