The algorithme that I am trying to get to work, looks like this.

Find the intersection between a box and a Borders of a surface, and discretiza the intersection

But the U,V parameter after preforming a BooleanIntersection and a ExplodePolysurfaces is still linked to the original surface, so a discretization is conducted on the original surface not the intersection(Se the algorithm below or

before.3dm (22.8 KB)

after.3dm (491.6 KB)

Observe how the intercection between the surface and the box are there but eh points are from the original surface

```
import rhinoscriptsyntax as rs
import random
rs.EnableRedraw(False)
surface = rs.GetObject("Pick a surfacs")
box = rs.GetObject("Pick a box")
tmp = rs.BooleanIntersection(surface, box, False)
exp = rs.ExplodePolysurfaces(tmp)
for e in exp:
u0, u1 = rs.SurfaceDomain(e, 0)
v0, v1 = rs.SurfaceDomain(e, 1)
up = random.uniform(u0, u1)
vp = random.uniform(v0, v1)
if rs.IsPointOnSurface(surface, rs.SurfaceEvaluate(e, [up, vp], 1)[0]):
uDt = (u1 - u0)/float(50)
vDt = (v1 - v0)/float(50)
for u in range(0, 50):
for v in range(0, 50):
rs.AddPoint(rs.EvaluateSurface(e, u*uDt+u0, v*vDt+v0))
else:
rs.DeleteObject(e)
rs.EnableRedraw(False)
rs.Redraw()
```