# How could I select a line on the side of the geometry node?

Hello, I’m working on creating an instance only for the outline on the top of the object.
At first, I thought I could solve it by using overlapping parts in the normal axis, but I don’t think I can solve it in a one-dimensional way. Is there a good way?

Hello and welcome to blenderartists !

You can get rid of vertical lines like this :

Not sure it’s exactly what you want…

Getting outlines , as in drawing the outline in 2D is quite complicated, I’m not sure geometry nodes can handle that…

Good luck !

1 Like

I’ve also tried using the edge verts nodes, but I never thought I’d use so many vectors!
The problem hasn’t been solved, but I think I’ve found a new perspective. Thank you!

1 Like

I created the selection area that I wanted! I’m proud.
Next, I’ll have to study the rotation value of Edge from tomorrow…

1 Like

Cool ! well done !

Getting that rotation could be a bit tricky !
you can take both vertices of an edge (edge vertices node ) , you subtract vert 1 by vert 2 (vect math node)
that will give you a vector. you then normalize it ( vect math node) so it’s size is equal to 1 .

A vector has a direction ! So with that vector you get one axis ( the axis the edge is pointing to) , you can use that in the align euler to vector node, that will give you a rotation that you can plug in the instance on point node.
That should give you something better !

But you only get one axis over 3, how to get the two others if needed ?
Then you should look into Cross product (vect math node) . That allows, given two vector (axis) to get a third.

But because now you only have one vector ( the edge axis) you need to input a temporary one, like (0,0,1) , then cross product these two : that give you tree vectors. But one is the temporary one (0,0,1).
You then need to cross product the two “final” vectors to get a third “final” one, that will replace the (0,0,1) used earlier.

With that you can get 3 axis( = vector, = directions) from one vector. Which means these 3 vectors will be perpendicular. You can think of your edge (first vector) and two other edges that are perpendicular to the first. Like a corner of a cube.

And this should allow to align better your instances.

Sorry for this little vomit of vector maths, at least the first step ( before the cross product) should do.
If needed you can look latter into cross product. Someone may have more time to explain it better. It takes me a bit of time to feel at ease with vector maths, but that’s doable with time even for someone like me who really isn’t a math person in the first place.

Good luck !

1 Like

Thank you for your kind explanation.

In fact, I didn’t understand the node that removes the side line above. It’s not easy to understand even if you look at the description of that node in the blender document! I’ll have to understand the vector after seeing what you explained.
Below is not a vector math, but I used curve tangent to align the rotation.

Thank you!

1 Like

Super Cool !

interesting how you managed it !

To remove the side, the other vector operation was the dot product that is also a classic vector math operation.
It compares two vectors and gave out a number that represent how “similar” these vectors are.
A vector as a direction, like the normal of a face which point to a direction.
When two vectors are aligned(same direction) their dot product will be equal to 1.
When they have an opposite direction , their dot prod will be -1.

And depending on how far or close they are aligned , the value will be between -1 and 1.

The first part from edge vertices to normalize, construct a vector from edges. It indicates it which direction the edge is pointing. Then with a dot product we compare it with a vector (0,0,1) that is basically the Z axis of the scene.

Then if these vector are aligned ( the dot equal 1) we delete them.

Hopes that helps a bit, in many cases these little operations can help a lot in GN. You can do cool stuff without it but that can be quite handy.

It’s hard to find good learning material about it, especially for use in CG.
But if you want to go wild with GN , it’s quite worth learning that on the long run !

2 Likes

I looked up Dot product and Cross product mathematically, and it was a very difficult concept for me. But there was a video on YouTube explaining Dot product with a blender, so I understood how it came out by comparing it with your writing! I’ll have to think more about how to apply this in other works…

1 Like

Awesome, well done !

Indeed, you can find a lot of math tutorials related to vectors, but they aren’t that relevant.
Only a few resources talk about the application in 3D and even less in blender.
Maths tutorials will teach you how to calculate a dot product, which we don’t really care, we are more interested in how to use it as a tool to make stuff.

Math, and vector math applied to CG, especially if you have an art background takes a bit of time to get. You need to have a mental representation of what is happening and that takes time.
But on the other hand, there is not much to learn to make a good use of it, and it’s not that complicated.
Generally basics stuff will do, to a math POV this is still quite simple.

The best is to look at it one time, then try again in a few, and eventually you’ll be more comfortable with it. And at some point you’ll have more ideas on where and how this can be useful.
From there you can learn some useful functions from time to time to broaden your knowledge even more.

The other cool thing is that’s all over the place in 3D, you can use that in GN a lot of course, but that’s also useful in procedural texturing, compositing and if at some point you want to look into it , scripting.

I really learn that lately and it took me some time, of course I only have basic knowledge but it makes a great difference when dealing with procedural stuff.

Hope that helps, you seems to be on the right path !

1 Like

I wrote down what I understood because I thought I needed to know at least how the node I was using was going.
I think I understood at least how it goes, is that right?

2 Likes

I think that’s it !
I’m not used to mathematical writing of vectors

Maybe the only thing that seems strange is the normalize. I’m not sure you get it !

A vector is useful for two things, it’s orientation and it’s length.
Sometimes you’re more interested in it’s orientation, that’s were you use cross and dot products.
Sometimes you may use their length. There is a length function in the vectors math node that gives it’s length, it’s quite useful !

When dealing with orientations, you need to normalize the vector, that means making it’s length equal to 1.
When the vector is (0,0,5) it’s easy it’s length is 5, normalizing it gives (0,0,1). But what about a vector like ( 12,156,135) ?

In the compositor, there is a normalize node, that is a bit different : there every values are remapped to 0-1 range.
But with vector math node it’s just about giving the vector a size of 1. And that’s the general behaviour of normalize in programming or houdini.

If you don’t normalize vectors, with cross and dot product you’ll get weird results.

3 Likes

For this type of problem, yes, but this is not generally true… Cross and Dot products can be very useful for all vectors, depending on what you’re doing. It just so happens that a lot of 3D math is about direction and orientation, and in those cases Normalized vectors are very useful.

@siz, to add to what sozap is saying, Normalizing a vector basically means you’re extracting the “direction” (or orientation) of the vector, by making `|AB| = 1` (with only one exception, `Normalize((0,0,0)) = (0,0,0)` which has magnitude 0).
So, when dealing with problems that involve direction or orientation, normalized vectors are the tool of choice, and using those with the Cross and Dot product take on a “meaning” relevant to direction or orientation.

For instance, a Dot product between two non-normalized vectors tells you how much the vectors “project” their components onto each other, whereas a Dot product between two normalized vectors tells you how much they are aligned.
So, same operation, different interpretation.

Apologies for being pedantic, but felt like reminding everyone that context will always matter.

Good luck!

3 Likes