Hello ! I hope it’s the good category for this question.
I’m trying to instance grid on faces of a mesh with geometry nodes and scale the grids so it fill the face perfectly.
I need to get the size of each face to do so and I tried with this combo of nodes :
(the leftmost integer is the index of the face i want to get the size of)
It work if the index of the face I choose is static but it doesnt work if it’s an attribute.
There’s probably something I’m missing
As a reference I’m trying to do something in the vein of this : Buildings and streets with some geometry nodes - #3 by sozap
As of 3.1, there is a face area node which should do the job. Of course, since it calculates the area, in order to get the size, you would have to divide this number by two square root this number, assuming the faces are square.
The face are not necesarilly square but if I can get an edge I could get the other by using the area … @sozap Thank you ! I’ll take a look tomorrow, it’s close to midhnight here
Ah I got it he seems to be eliminating also all vertical edge so the computation works. So it doesn’t work for arbitrary face. I’m wondering if there’s a solution to this …
This was the conclusion (and currently best optimized solution) of that discussion within that mega-thread:
… Xeofrios used interpolation magic to calculate the “up” length and divided the area by that to get the width. Limitation is that it works only on vertically aligned quads.
I get the face corners first and then I assume (rightly apparently) that vertex are packed 4 by 4 in the field, with a bunch of math i can get the index of each corner and then the width and height
I works but It confuses sometimes which edge of the face is in which directiong as per this screen shot :
(it works on the base but the little tower is confused)
You can see in the nodes after corner sizes there are two combines, i just need to figure out a filter that gets which face have the wrong scale orientation but I didn’t find a way yet
It’s working with filtering of triangle faces, non rectangular faces, and get the correct up orientation
I can post the blendfile if people are interested I just need to clean it a bit.
Hello, I am trying to solve a similar problem and would appreciate seeing your blendfile even if it is not perfectly cleaned.
I would like to recreate a feature similar to Zbrush Micropoly/Nanomesh where instance objects on face are bound to the size of the face they are being instanced on