"perfect" grid in 3 dimensions

Hi,

this is a bit of a follow-up of the discussion here: “perfect” grid with nice boundary
I was playing around with brick patterns for arbitrary shapes and ran into a problem when trying to layout a pattern on a tapered part:


bricks_forum.gh (20.4 KB)

Any idea how to avoid these “horrible” aligning lines? My goal is to have a nicer pattern and accept a little more variance in the spacing of the points / “bricks”. For this simple part its not one can just always use the same number of bricks per row:


But what about a more complicated shape like this?:

meshing_nightmare_forum.3dm (169.0 KB)
Thanks for any help or ideas how to tackle this! :grinning:

1 Like

Hi,

I tried this with my first python script ever :grinning:
the result is mixed:


bricks_forum_2.gh (105.9 KB)

the pattern is not too bad but the code is super buggy;
I’ll see if I can improve it further – in the meantime if anyone has a suggestion regarding the script or a better algorithm – please tell me :grin: :wink:

2 Likes

I made a brick placer time ago…
It was with unconstant brick size (they were scrap pieces) and so even for straight walls some addittional logic was needed
I had some luck in trying with random placement!
From a “pool” of bricks (List of numbers), the function
1- picked up bricks until the distance to cover was reached (adding a “gap” for each brick)
2- check if the overlaps with previous row was ok, if not, jitter the list and try again
3- if after 10 jitters it still fails, put all the bricks of last row to the pool, jitter the pool, and back to pt 1.

It was working incredibly fast, as the cpu can try countless attempts in a fraction of a second.
The results were so good that it surprised me. Making a “conscious” algorithm for placing would have been 100x time expensive…
Note: if the total space to cover was X , the sum of the brick size in the pool needed to be at least 1.3*X or such.

In your case.
Are all the bricks the same size?
Do you want the gaps in the same row to have all the same width?
If both yes, i throw out a “impossible to find a solution” … imho

thanks Riccardo,

very interesting, maybe I also try this

Are all the bricks the same size?

Yes and No. I have a target size and divide the curve by "round( curve length / target size) ". They should be similar within a tolerance

Do you want the gaps in the same row to have all the same width?

I am only interested in the “aesthetic” placement of the points and basically don’t have gaps.That being said the points have to remain planar.

here is an improved version of the script: I cleaned up the code as best as I can, but there are still some bugs; if someone with more experience would have a look I would greatly appreciate it :bowing_man:

bricks_forum_3.gh (84.0 KB)

Edit: found some more bugs:
bricks_forum_4.gh (61.4 KB)

Hello Konrad, it is a nice problem but what is the transition logic? Because I understand that the number of separation is not the same in each row
image
image

Hi Laurent,

I try to explain the script:

I iterate over all layers sequentially, starting in with the first layer

  1. ( first layer: divide layer curve in N segments)
  2. pull points from lower layer to current layer
  3. check distances: if the distances in the current layer between each point are within the limit specified by up&lowLimit create line segment (polyline) between the points. Due to the pulling of the points from the lower layer the distances between the points can vary.
  4. refinement: if there are any gaps between the line segments , create new polylines with more evenly spaced points between.
  5. proceed to next layer and repeat 1. to 4.

hope this helps.

Thanks for the explanation, I am not sure I will give a try with your method.
But I tested directed reaction diffusion on your shape.



Not yet sure if you could use the numbers to place grids …

Merging the 2 grids, it is quad remesh !!

5 Likes

Hi there, since the problem came up in a recent thread here is my latest attempt:


Grid_3D.gh (108.9 KB)

You’ll need anemone & impala to run it

Many thanks to my friend @DanielK1 who collaborated with me on this and did a lot of the scripting of this definition!