I’m relatively new to geometry nodes but I’m learning my way around geometry nodes while creating a fully procedural small town inspired by the buildings in Cartagena. I’d appreciate any help I can get on better ways to do stuff basically! It’s still a WIP and most of the objects are just placeholders as I figure out a good enough geometry node setup to get it working.
For the above case, I’m trying to select only the innermost vertices to use the set position to raise them and create a roof structure. Using the normal and a compare node gets me started but doesn’t give me the desired effect. I’ve tried using the vertex neighbours node but I can’t seem to get the setup working.
Due to my limited english skills I’m not sure to get exactly what you want to do.
I think the idea is to separate the roof from the base, then keep only the outside or the inside of that chunk.
First you should definitively learn about Dot Product operation to isolate some parts of a mesh based on a direction. In short it allows to compare two vectors, if they are aligned the dot product will give you 1, if they are opposite it will give -1, and depending on how similar they are you’ll get a number between -1 a 1.
So, to isolate the roof you do a dot product with normal and a up vector (0,0,1). the result goes into a compare node set to equal, and with the epsilon you define how much curvature you’ll allow.
That will go to a separate geometry.
Finally to get say the outside of the roof, you can use the edge neighborgs node, if a edge has only 1 face then it’s the outside basically.
Hopes that helps to lead you in the right direction.
Thank you, the dot product way of doing it worked way better and it fixed most of my instancing issues on the roof geometry.
However, I was also trying to use the edge neighbours node to isolate the boundary edges and extrude them to create something like curbs around the buildings. For some reason, the extrude doesn’t work so well and seems not to extrude as expected. I’d like to know how you created your curbs for the cyberpunk project you are working on in this case;
Anyone with any idea on how to set up geometry nodes to fill up the spaces in between the buildings( as shown in the video below marked by the annotations) to create maybe some geo that can still be used for instancing other objects?
Great !
For the curbs I used the base of the building to extract a curve, from there I could have done a curve to mesh, but in that case I used a custom curve deform node, that do the equivalent of array + curve deform modifier, to deform an existing mesh.
To fill the gaps between your houses there isn’t a perfect way, but by being a bit creative you can find different methods.
Like creating a grid and removing part of it using proximity. Or use some curves extracted from the houses, you can convert them back and forth to mesh/curves and do some merge by distance / resample…
You can either start with too much geometry and find some ways to delete the unwanted parts, or start with a simple shape and expand / fill it.
Obviously each approach has it’s pro and cons so it’s worth exploring.
Try something around these lines and if that doesn’t work we can start to talk about more involved techniques !
Also something that is useful to have in your toolset is a ‘point inside mesh’ node, they show a way to do it at the end of this tutorial : https://entagma.com/pack-points-inside-objects-with-geometry-nodes/
Then you can add a grid and remove parts that are below the houses.
I managed to fill the gaps somehow by using the bounding box which I then subdivided;( I found it easier as the bounding box will always be as large in terms of surface area as the base geometry is) and then used a raycast node to delete some of the points that were beneath the buildings.
However, I couldn’t get the curve to instance the points correctly, I tried to deselect the corner points of the curves even though I somehow got it working I’m sure there’s a much better way of doing it. Most of the curves were either instancing the curbs towards the interior of the building while others worked as expected. Tried to fix it but I still couldn’t get it to work. I’m probably doing something wrong; any ideas on how to fix it?
And for the orientation issue, it’s hard to give you an answer just like that, but that ring some bells to me
If you build a simple test scene with only the basic elements of the problem I can give it a shot !
Yeah I was talking more about a simpler scene with only the relevant bits ! But that’s fine, at least your file is well organised !
So my instinct tells me that to make things works with instances it might be a lot of trouble. Here is a simpler way by doing a curve to mesh, unless there is a good reason to do otherwise I’ll go with that. curbs.blend (144.5 KB)
So I did set up the curve to mesh way of doing it as you did in the file; it however has a few problems like the curves not having the same orientation making most of the curbs to appear inside the buildings.
There’s a bit of overlap at points with right angles but I guess I’ll just have to avoid right angles to make it work.
Apart from those few errors, I think this is the best way of doing it since instances don’t seem to work. Thank you for your help, I wouldn’t have thought of doing it that way!
Arf too bad Maybe it’s possible to have the curve profile centered on the curve, so it goes in both directions ? It’s the simplest method, but in 90% of the time there is always a solution. The question is how much time you’re willing to spend to make it work
I figured that might come last as the curbs are not a necessary addition and the issue only happens on one of all the buildings that are created. I’ll look for a workaround to fix the issue though.
Also managed to set up some lines with a bit of deco to run between the buildings but it’s a bit glitchy! Tried using the raycast node to select only the points that are closest to each other but for some reason that didn’t work. Does the building’s geometry have to go through a realise instances node for the raycast to work? because I seem not to understand how the raycast works when the geometry being used is in form of mesh islands!
For the raycast it won’t work on instances indeed, but it doesn’t seems that your buildings are instanced anyway ?
It also doesn’t work when the target as no faces obviously.
And the third classic error is when you want to raycast an object onto itself, you need to offset the target geometry a bit or you get some glitching because of the superposed faces.
I’m not sure to understand 100% of what you’re trying to do. Maybe you can create some lines in the middle of the street and try to snap them to both sides using two raycast and the curve tangent as a direction vector.
What I meant to say was geometry created through geo node processing but I guess the answer is still the same right?
I didn’t think of doing it this way, it’s actually much easier! I opted to instance a grid on each of the faces of the buildings and instanced another mesh lines from the grid and realised the instances to use a merge by distance node and I finally converted the mesh to a curve based on the edge length to remove edges that are on the side which no two mesh lines merged or joined. I’m sure there’s definitely a much simpler way of doing it though I just can’t figure one out!
Yes, there is no difference between regular geometry and generated geometry. If you extrude something in edit mode, or in a geo node tree it produces the same thing and you don’t need to realize instances.
This is only useful when you use instances on point so each instances is made real geo.
I think also when you load a collection it’s content is instanced so you need to realize instance on that too. But I don’t think it’s needed in other places.
Oh okay sure, I guess then I wasn’t setting up things right with the raycast node. I’ll give it another try and see what I can come up with to achieve the same result. Thank you!