4
$\begingroup$

I want to ask if there is any geometry node for getting the circumference of the corners or "outer edges" of a mesh.

I'm very new to geometry nodes and have been trying to make cake where the icing's scale adapts to how big the circumference is. My current set up is icing scale = (face area/2)

However, this doesn't work since the area gets smaller when I create an inset (for a new cake layer), making the icings scale too much. So I think that the value for the circumference would be more suitable. cake icing example

Do I have the right idea? Thank you in advance!

$\endgroup$
5
  • $\begingroup$ I assume that the parts are made of cylinders created in Geometry Nodes. In that case, you would have the radius. Then the circumference would be 2*π*r. $\endgroup$ Jun 14 at 7:44
  • $\begingroup$ @quellenform oh the part (cake base) isn't made with geometry nodes unfortunately. I was trying to make the icing adaptable to a mesh so I can create different shapes of cake. by modifying the mesh. $\endgroup$ Jun 14 at 11:03
  • $\begingroup$ Check out this answer. The problem might reduce to how to select the right edges. $\endgroup$ Jun 14 at 11:58
  • $\begingroup$ @RobinBetts Thank you! I'll try to study this. I didn't know that it was possible to make the weight as an input! $\endgroup$ Jun 15 at 6:28
  • $\begingroup$ @softsurface I've added an answer aimed more directly at cakes. $\endgroup$ Jun 15 at 9:42

3 Answers 3

2
$\begingroup$

enter image description here

Geometry Nodes:

enter image description here

What this does is:

First, it captures the normal of the mesh as an anonymous attribute, that way we have access to the original normals after the Delete Geometry node.

Then it deletes all edges with an angle equal or close to $0$ and converts the resulting geometry into a curve.

Now we have access to the length of the edge loop that a point is currently in and the original normals. These values is what we use to determine the rotation and scale of an instance. The scale is the spline length divided by the product of $2\pi$ with Base Radius.

Base Radius is an input that can be use to control the base scale of the instances:

enter image description here

Since edges with an angle close to $0$ are deleted for the calculation, additiional loops will be ignored:

enter image description here


Note: This method assumes that your mesh is circular or close to circular, if it isn't, results may be weird.

$\endgroup$
2
  • $\begingroup$ Nice icing! And yep, that's the way to do it! $\endgroup$ Jun 15 at 6:59
  • $\begingroup$ Woah, yes! This is the answer! I'll be trying it out in awhile but I understood your logic, and it's pretty spot on. Getting the angle is genius. Thank you so much for this, it's a great help! $\endgroup$ Jun 15 at 10:02
3
$\begingroup$

Please forgive me, my icing looks terrible.

...but it tastes good, I think, because the solution could look like this:

enter image description here

Here I use an existing mesh (cylinder).

I have created a vertex group for the upper edge and the lower edge.

I pass these vertex groups directly to the geometry nodes via the Group Inputs.

There I split the mesh based on the vertex groups with the node Separate Geometry, and convert the remaining edges with Mesh to Curve into curves.

I then divide these curves with the node Curve to Points into single points, for which I also get the corresponding rotation. As you can see, I also provided the number of subdivisions as Group Input with the attribute Count.

This rotation is again individually adjusted with Rotate Euler (do this as you need it), and with Instance on Points the icing is instantiated at the respective points.

Enjoy your meal!


And if you still want to know the circumference of the upper or lower part (assuming that the mesh is really a circle here), you can calculate it like this: $2 \times r \times \pi$

enter image description here

$\endgroup$
5
  • $\begingroup$ Thank you so much for your answer! But if it's reliant on the vertex groups, would that mean that I have to keep making a vertex group for each "cake tier" ?(ex. I create an inset and extrude that inset to make another cake layer/tier like in the post's picture). I was hoping to find a procedural way where the icing will scale down on the new "cake layer/tier" but the scale will stay the same in the original base "layer"/"tier". Sorry, I hope that I'm making sense! :( $\endgroup$ Jun 15 at 6:24
  • $\begingroup$ @softsurface Yes, in this case. This method is based on you creating the vertex groups yourself. I wasn't quite clear on how you set this up and didn't solve it optimally. But Hulifier has the right answer for you! $\endgroup$ Jun 15 at 6:57
  • 1
    $\begingroup$ That's alright, thank you so much! I learned something new from you and I think this would be very very useful in future assets (I actually think that it would be suitable for this one other thing I'm working on). Your nodes are also way cleaner. Many thanks for the help, I really appreciate it! $\endgroup$ Jun 15 at 9:58
  • $\begingroup$ @softsurface Glad you were able to take something for yourself anyway! And, Haha, I just find it very funny that you find my nodes "way cleaner" ;-) ...I'm discussing this difficult topic with a few others right now, who probably due to the fact that they have little to do with young people personally, see things quite differently than you and me: blender.stackexchange.com/questions/266334/… $\endgroup$ Jun 15 at 10:04
  • $\begingroup$ woah, that's a lot of nodes! But I meant it when I said yours are way cleaner than mine! Hahaha you managed to do it with 7 - 15 nodes, while it took me around more than 20 hahaha. Still gotta get used to it like Substance Designer nodes, though I think structuring nodes are similar for both softwares. A lot like to make use of the "dot" that helps clean lines, groups, and finding more optimized nodes. My professor also liked to structure nodes by groups and that go "upward" so it's also easy to see the process of creating a material :o $\endgroup$ Jun 15 at 10:14
2
$\begingroup$

It does sound as if you'll be wanting to handle non-circular cakes. You could let Curve to Points > 'Length' do the maths for you. Select the edges of your cake-mesh you want piped, assign their vertices to a vertex group, and use the group, along with your 'piping' object, as inputs to this GN modifier:

enter image description here

Which might be a more convenient workflow for a variety of cakes, including circular ones.

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Oh yeah, and the next answer will be something with colorfully distributed smarties, some fireworks and a dancing figure at the top :D $\endgroup$ Jun 15 at 9:48
  • $\begingroup$ Thank you so much this is wonderful! I actually did try using curves as well, but I still have to learn more about this since I just started a day ago. But this will definitely come in handy in the future! Thank you for the help :) $\endgroup$ Jun 15 at 9:56
  • $\begingroup$ Gotta sell it, @quellenform, gotta sell it. Besides. just letting my fem-flag fly. :D $\endgroup$ Jun 15 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.