Box on edge of curve

Hey everyone!

I am new to grasshopper and struggling with some functions.
For a project I need to be able to create a box at the bottom of a region (here the curve). I made a script and it can do what I want but it doesn’t do it “automatically”.


So in short what it needs to be: A box created:

  1. on the lowest part of the curve
  2. over the whole length of the lowest part
  3. If the curve is changed the box needs to also fit on this new curve
    box on edge of curve.gh (8.8 KB)
    Thanks in advance!


box on edge of curve _ vr.gh (20.6 KB)


box on edge_2025Jan19a.gh (8.6 KB)

1 Like

Thank you both for your responses!
Now I only have the problem that when the curve is like this it only forms a box on one side.


Is there a way to make sure it also forms a box at the bottom of the other side?
box on edge_2025Jan19a.gh (11.3 KB)


CURVE BOX.gh (8.2 KB)

Edit: Or just deconstruct those midpoints and sort by Z-value instead of using the surface.

It should be noted that you have changed the shape of the rotated curve and the code posted yesterday works fine if you don’t.

Must it also handle curves like this? :man_facepalming: Not clever… :roll_eyes:

1 Like

Thank you very much!

That’s just a restatement of Joe’s script. Which in turn is a restatement of mine. We essentially have the same script posted here three times. :laughing:

You talk about it like it’s an impossibility:


box on edge of curve _ vr2.gh (20.8 KB)

1 Like

Don’t kid yourself, my code was not copied from yours.

Of course it’s not impossible!! The “What about _____” gotcha game is so boring, played by those who didn’t consider all the possibilities when they initially defined the problem and whose imagination exceeds their GH abilities.

What about this shape? :rofl:

I don’t mean to imply that you copied me. We came to the same result independently. That happens.

Well, clearly then you’d have to sweep a rectangle surface instead of using a Dimension Box


For the sake of it:


box on edge of curve _ vr3.gh (23.8 KB)

Looks like a funny car. :laughing: