Geometry nodes questions

I have a a quick offtopic question if anyone could help, iv been googling this for a wile but i just cant figure this out so i just wondered if someone could help quickly(dont know if i what i want is actually possible)


I have this spawner group node setup, i have it set to place a brick per face.
I was setting this up with a vertex group so i could have two of these spawner group nodes one that spawns the full blocks and one that spawns the half blocks using the vertex group to tell which face should spawn what.

What i want to know is can i have this spawn the full block and fit/squish it to fit the half block space


here is how i had it, first spawner spawns in the ‘layout’ which just picks a mesh from a collection(the brick pattern), which allows me to have different patterns picked randomly. The the second spawner spawns the full blocks the the third spawns the half blocks. I want to cut out the third spawner and half block mesh to get this to use one mesh and refit it to the parameter of the face its spawning on.
I realize i need to get the length of the the x and y (and z and an option that i dont need in this case)
so that the brick can be scaled accordingly this is the bit i just simply cant figure out.

Second question is i built this array node, following a tutorial
image
I can show a better picture or upload the blend so you can see better


But i want to add a feature to the array to make every other count rotate 90(or a given value)
So i can turn the one on the right to be like the one of the left

Hey !

I tried to follow your first problem but didn’t understand it very well (I’m not english native)
Can you show visually what you’re trying to achieve, maybe by modeling by hand the result you’re after ?

For the second, yes it’s possible, you can start to find where that rotation could append, I suppose the blocs are instanced at some point and you can use a rotate instance to make them turn.
Now to make each piece turn by 90° there are a bunch of choices,
Here is one :

the accumulate field node increment a value, in that case , every instance is rotated by increments of 25°

Hay here is the blend, figure that might be best so you can just see what im doing
Bricks.blend (4.0 MB)

If you go into the the spawner node, i was attempting something with scale that has the switch
But i didnt figure anything out yet. You will see i use two spawners one to first spawn the ‘layout’ which is a collection of planes, the idea is i can make many layouts for different patterns for all sorts of things easily. I have many ideas for doing things this way vs a more mathematical way.

As for the array, if you look at the array node i basically want to add in the feature to set a rotation and every other array rotates to this amount. I also want to add the other axis for the array not just the z

Hopefuly seeing the blend will give you a better idea, im looking to make these modular node so i can plug them together in different ways for each project/task im plane to use them all for

I should be clear i want to rotate ever other instance, so i rotate the first instance then not the second then rotate the third and so on


So the first question is i want to get the full block to fit to the half block space so i dont need to use a separate mesh, Im after a universal thing to use for many assets and layout setups. This would include an optional relative scale, so the instance scale to fit but dosnt stretch out of shape. I would need both for different uses

Like this so the block scale down to fit the half block space but retains its relative dimensions

This is the result im after for this example


But the idea is this is meant to be used more universally and not for this specific example so something to bare in mind

A new third question, is there a way to get the instances spawned to spawn ontop of the face. Atm the spawn in the middle, so i want to get the blocks(the instances to spawn) to figure out the height half it and use it as a z offset. Im guessing i need a bounding box and some math(This question i just thought to mention but not attempted to do yet)
Edit:


My quick attempt, it moves it up but not quite right. i want it to set on the faces and to be automatic to any mesh being used as an instance

Edit2: I do realize your example for the rotation will work for me as if all instances rotate 90 then it will still recreate the brick pattern, although i am still curious if it could be limited to every other instance but atleast i can do what i need with what you put so thankyou for that :smiley:

If you need to do something for even or odd indices you can use modulo 2 (math node), this will give you 0 for even numbers and 1 for odd numbers, then you can do what you want with it

Hey !

So I looked at the blend, is what you want to do something along these lines : You have a grid and instance some other objects in a way that they all fit the grid ?
Like from that :

Getting that :

And once that’s done do a vertical array ?

If that’s the case, you need two things, 1/ the dimension of the planes, and 2/ the dimension of the cylinder.

1 Like

Yer so for my spawner node group i want to add the feature to have the instances stretch to fit like your example or scale
So here the two options


On left the option to fit to the face but keep its uniform scale or like on the right where in this example it scales the x axis to squish the shape to fit the face. On my spawner node i would add a intiger with 3 options like what i have with the array node where i have Off/Stretch/scale modes to switch to.
So depending on what im spawning where i can toggle whether it can stretch or just scale to fit or just place with no adjustments so im covered for more situations

I figured i can get bounding box of the instance being spawned but i dont know what i can do with fitting to faces


Not sure how to use modulo never used it before, this is obviously not it

Here’s a simple explanation:

Modulo returns the remainder after division. When you divide an even number by two, you are left with no remainder. When you divide an odd number by two, you are left with a remainder of one. Therefore, modulo({0,1,2,3,4,5,...}, 2) = {0,1,0,1,0,1,...}

If you take the modulo of the index and 2, and plug it into the selection, it should select and rotate every other domain.

I hope this explanation makes sense. Good luck!

1 Like

umm yer i dont grasp this stuff that easily im afraid

Im a literal thinker so unless things are said very literal to me i dont really know what is being said
Im also a visual learner so i really need a visual thing to digest or i struggle to know what is being said

School was a nighmare as not everything is visual

I sympathize. I’m also a very literal, visual, learner, but I don’t think there’s a more literal explanation of modulo than this direct visual example:

If it helps at all,
modulo({0,1,2,3,4,5,...}, 3) = {0,0,1,0,0,1,...}


I did this but all it did was remove every over instance

Is this remotely what you guys are saying?

No, that pretty much happens to everyone all the time in the 3D world. Once you come to grasp things intuitively, you tend to find the technical terminology to be the most logical and straightforward way to explain things.

…but if you’re not in the know, then it’s all just a bunch of gibberish.

3D in general is filled with lots of things that are easy to understand once you understand it, but if you don’t understand it yet, then all it does is makes you feel dumb. Take UVs for example. They’re simple, logical, and easy to predict, but they’re hard as hell to explain in such a way that your average bystander can understand them.

3 Likes

Wait.
Shouldn’t it be modulo({0,1,2,3,4,5,...}, 3) = {0,1,2,0,1,2,...} ?

4 Likes

Yer i know its just not me

Partly my issue is my brain dosnt really retain coding based things easily as i just simply have no real interest in it. To me its a means to an end, im making these nodes to aid me with 3d modeling as thats what i truly care about. Im trying to build up these nodes to do what i need so i can move on and just use them, i will forget how these are coded that is inevitable. Its why im trying to get them to do add as many universal features/options as i can now to cover me using them over time.

Unlike coders and others i get no actual joy from solving problems or issues, i hate puzzle games lol
Too many people tell me to go learn that its easy and fun, for me its neither. Im just gritting my teeth so i can get what i need done so i can move the hell on lol

I might retain some of this for a wile but within a few months it will be gone, coming from 30 years of experience on this. But when it comes to things im interested in i cant forget so like photoshop i know inside and out because 2d art is a major passion so my brain absorbs that crap.

Fighting your brain is hard!!

The best way to explain the modulo, at least in terms with what we’re trying to do here, is that it’s an on/off switch where having a remainder after dividing two numbers means it’s on.

3 Likes

Yer that sounds more accurate to what im after
I want the rotation value to work every other instance the array is spawning

Approach your problem in a piecemeal manner. Like what are you trying to do?

You want to rotate every other instance.

Okay, so how should you approach that?

You first have to find a way to select the appropriate instances.

So, starting off, you’ll want to learn how to select points in geometry nodes…

Okay, now that you roughly understand how to select, how do you rotate?

You go to google, search geometry nodes rotate individual instances, and then stumble your way to finding out about about the Rotate Instances node.

Then, you take what you’ve learned, and combine them together…

Think of Geonodes as automating a process that you’d do by hand, replicating the steps you’d take with individual nodes and the magic of annoying ass math.

3 Likes

Yeppp, my bad. Good catch :slight_smile:

1 Like