# Random Points on Surface?

Hi All Im trying to generate random points on surface but still no luck, here’s what i have at the moment.

Any help Thanks.

1 Like

like this ?

Andrew

6 Likes

nice can you show the full graph please? Thanks.

The only thing below his graph is the surface that connects to the Geometry.DoesIntersect. That should be everything you need. The Math.RandomList into the U,V parameters are what makes the random points. The Geometry.DoesIntersect makes sure that those points are actually on the surface and is used to filter the points. The ‘in’ output of the List.FilterByBoolMask is what you want, it is the list of all of the random points on the surface.

1 Like

Thanks

1 Like

@kennyb6 is correct

You just feed in a surface- so the output from your ‘Surface.ByPatch’ node should work

1 Like

@interactiverendering the important thing to note here is that the math.random list returns values from 0 to 1, but in your original example you were returning examples from 1 to X, stepping X times (you were using the same value for X and N).

In Dynamo terms, parameters are a percentage along the element type in question. So for a curve:
The point at parameter 0 is the start point.
The point at parameter 1 is the end point.
The point at parameter 0.5 is the midpoint.
The point at parameter 0.75 is the 3/4 point.
The point at parameter 0.X is the X/100 point.

This also scales:
The point at parameter 2 is the length of the curve off the end of the curve.
The point at parameter 3 is twice the length of the curve off the curve.
The point at parameter X is X% along the length of the curve.

Surfaces work the same way, but with two parameters for their primary axis aligned to their untrimmed shape. This is why you need the geometry.does intersect node - otherwise your points may fall outside the surface as the surface itself doesn’t extend the full extent of the 0-1 value at any given u or v axis.

Hopefully this will keep things clear for your next time out.

2 Likes