Parametric design
About Rhino & Grasshopper and PARAM-O.

Param-O: elements in a grid

PV1972
Contributor

Hi!

Just got into Param-O this week, and it looks promising.

I'm trying to create an object with Param-O, where an "invisible" grid with z values is created and smaller elements are put into every point of grid.

So far I have this, see the image.

  • Gray, transparent object is there only for help. It is a Mesh with 4 corner points (rectangular, object's A and B values). Each corner has its unique z value. Mesh shows the total coverage of object area and it's top surface shows the surface I'm referring later. Diagonal line is not important, it's created by Mesh element automatically.
  • At the lower and upper edge of mesh you can see small green spheres, following the z values. They are okay. Amount of spheres is selectable, and it's working.
  • My goal is to get lines-of-spheres to appear in between, as well. Like the hand-drawn green dots along the red dotted line in the middle. Amount of those lines can be selected. Z values of lines' start and end points should be automatically calculated, according to the heights of the corner points.
  • Together those lines should create kind of a grid, where spheres are generated on top of a "surface".
  • In the image, green spheres are generated using Param-O's Point Input "Line Points" => "Deconstruct Point" => "Move" => Sphere's input "Transformation". 
    Good thing of "Line Points" is that it has z value.
  • And yellow spheres then? They are generated using Point Input "Grid Points". I think that's the way, despite the fact that it doesn't have z value. Here the spheres are located like they should, but they are missing z values. (Now I see that furthermost spheres are not located in the edge of area, at the points A,0 / 0,B / A,B. I know the reason, it can bee modified.)

So, is there a way to get those yellow spheres up to the surface? Maybe a combination of Grid Points and Line Points? Method of Line Points alone could work, but there can be tens of lines, maybe even 100 or so. Therefore it's out of question.
Thanks!

PV1972_0-1726912523899.png

 

Operating system used: Windows 11

3 REPLIES 3
cuba
Expert

Yes, it is possible to do this in param-o with only the grid + basic math. (but it is easier to do in gdl)

 

Grid.png

Here the formula to calculate the z-coordinate (h) of every x,y coördintate

h = ((h11 * (x2 - x) * (y2 - y)) + (h21 * x * (y2 - y)) + (h12 * (x2 - x) * y) + (h22 * x * y)) / (x2 * y2)

 

  • h11: height at (0,0)(0, 0) (bottom-left corner)
  • h21: height at (x2,0)(x2, 0) (bottom-right corner)
  • h12: height at (0,y2)(0, y2) (top-left corner)
  • h22: height at (x2,y2)(x2, y2) (top-right corner)
  • x: x-coordinate of the point for which you want to calculate the height
  • y: y-coordinate of the point for which you want to calculate the height
  • x2, y2: coordinates of the top-right corner. = dimension 1 & 2 

 

 

 

Scherm­afbeelding 2024-09-30 om 17.59.23.png

 -- updated version--

Apple M1 Max 32 GB Ventura
AC27

Hi!

That is great, thanks!

I already started making it with gdl, and propably will finish it with it. But I will definately check out that solution of yours. I'm new to Param-o, and it looks nice alternative in some cases. Your solution will teach some more.

Thanks again!

Your welcome!  This was a fun challenge, at first I didn't think it was possible in param-o.

There was another error in the param-o file which I have corrected and updated. Please use this latest version 

Apple M1 Max 32 GB Ventura
AC27

Setup info provided by author