Measure distance between point and surface

Hi,

Here I am reaching for better Rhino users again :smile:

I have been stuck on what i thought would be an easy problem for a few days. As can be seen on the picture, my goal is to measure the distance between the points on the layer n and the surface n+1 iteratively until i reach my last surface.

What I know already is the number of points per layer and I also get all my surfaces from a tween, so my idea was to “draw” a vector that would have for origin the point and the direction comes from the normal of the point with respect to surface n and basically extend the vector until it reaches n+1 and measure the distance.

Is there a way to do that for all my points using GH tools?

Thanks a lot, I feel like a gh file would be useless as this is a reasoning issue but please let me know if it’s needed>

Moved to Grasshopper category

The simple version is to use a grasshopper component “Surface Closest Point”, which automatically find the closest point on a usrface to a given point and outputs the distance. However, I’m not really sure what you mean by ‘n’ and ‘n+1’ in terms of layers? Can you post a file or more screen shots giving us 3d context? I know that you will need to get the data tree set up right to get the correct distance, but I have no idea how you have these separated or what you are measuring to.

Hi, thanks for your time.

This is another les crowded scxreenshot, layer n here would be the bottom one and n+1 the one right above.

You want the distance between EVERY point on a layer and the layer above? To what end? Are there even the same number of points on each layer? You’ve also uploaded no code so not sure how you’re expecting anyone to help.

Hi,

Yes I want to understand which logic need to be applied to achieve this result of measuring the distance between the points of one layer and either the layer above or below.
There is a constant number of points per layer yes, I will upload the code with this message.
I didn’t upload it initially because more than a readymade solution I wanted to understand the logic that needs to be applied.

Thanks, Tino.
QUEST_LAYERHEIGHT.gh (29.6 KB)

Since your points are divided into equal length branches and aligned, you could measure the distance between corresponding points like this.

QUEST_LAYERHEIGHT_re01.gh (30.5 KB)

-Kevin

Hi, thanks for your reply.

This is exactly what I have been doing but I want to move to more complex geometries on which points arent aligned anymore. Unless there is a way to align points when I divide curve I have to find another way to measure the distance. Thanks

If you post a file with the “more complex geometries”, perhaps someone can help.

-Kevin

Please find attached, thanks a lot.
QUEST_LAYERHEIGHT.gh (149.2 KB)

The direction of the curves in the last file is not uniform.

If you unify the curve directions, you can use the same technique as before.

Lines to illustrate point alignment:

The lowest surface in the Brep | Brep intersection does not fully intersect your source geometry so the curve is cut off at one end (lower left part of the image above).

I don’t know what your ultimate goal is for this, so this may not suit your needs.

QUEST_LAYERHEIGHT2_re01.gh (148.0 KB)

-Kevin