Making points within different rectangles

Hello everyone,

I am trying to create points within rectangles of different sizes. The size of the rectangle should dictate the amount of points, usually between 1-6, and the points should be in a grid within the rectangle.

I have tried to start out with a grid, but I am a beginner so I am not sure how to code the points to vary in amount when the rectangles vary in size. See first attached photo of my first attempt.

A second reference photo is attached that describes what I am trying to achieve, where the yellow circles is what I am trying to automatically generate based on the room (I will draw a rectangle within each room).

Any help is much appreciated,
Magnus

Can you drop, at least, Rhino file?

3rd thread and you still haven’t uploaded any code?

Making points within rectangles.3dm (89.7 KB)
Grasshopper test script.gh (8.3 KB)

Sorry, here are the files

It is a bit nasty solution but I wanted to keep your grid idea.


Grasshopper test script MOD.gh (5.5 KB)

You have an independent control for U and V density.

A few tips:

  1. If we are talking office spaces (and/or contemporary housing in towers and the likes) then a false ceiling is a must (not to mention a raised floor). These use - in most of cases - a 600*600 mm grid.
  2. A false ceiling contains HVAC, FF and/or other mec systems as well.
  3. So … (a) create a grid (or better a Mesh) in your net BrepFace (meaning using the outer loop (minus ext walls) plus the possible inner loops(ditto)). (b) using the Mesh FF conn and the inner partitions (as curves) place your lights taking into account some basic rules (like given free “neighbor” Mesh Faces zones etc etc) (c) put more module lights if required in selected rooms,
  4. That said inner partitions in most of cases follow the ceiling grid and are made via dry wall systems (like Knauf W xxx etc)…
1 Like

Holy, you are amazing. Thank you so much, this is exactly what I was looking for. Learning a lot from playing around with the script as well.

(Next time I post I will do it properly, nice learning curve first time)

Good luck. You can always ask for more here, just be prepared.

Cool! I do have one question to the script, if you have the time.

In this example attached, you have two identical rectangles but different orientation, is there a way to define the longest side as the orientation, so that you would get the same result for both?

This is an absolute nonsense in terms of logic and solution elegance but it works:


It would require new approach but, sadly, I don’t have much time.
Grasshopper test script MOD2.gh (17.9 KB)

Yeah works great, thank you!