Draw Curve Vines Proximity Error

Hi, I’m creating an addon to where I can draw vines onto an object (Building). I have created the vines with Geometry Nodes and can draw them on objects, however the proximity setup doesn’t seem right. On a flat surface it works perfectly, however on corners there are intersections and weird stretching.

An ideas on how to setup the proximity nodes to possibly fix this error? maybe there’s a better way to get the splines that make up the branches to attach to an object.

Vine Draw

This is very tricky and requires the Raycast node…

This is a minimal setup that roughly emulates what you’re doing…


Basically, what is happening is that you need to capture the face index of every instance-originating point’s closest face… later you can get the normal using this index along with the Sample Index node when doing the ray-cast. (you may be able to use Proximity node to get this normal but doubt the results will be good.)

Points that don’t hit the surface get deleted.

This sticks the end-points onto the surface, so in this method you’re basically placing simple lines so you’d need to heavily adjust the method to suit your needs.

Hope that helps.

2 Likes

Thank you so much for taking the time to explain this I really appreciate it.

I thought that this is how it might be done, but had no idea how…I’ve spent all day researching tutorials on raycast in the hope I could find something, tried some stuff and failed hard. How do you work this stuff out?

I’ll give it a try and see if I can adapt it to my setup, I’ll start at the “Set Position” and work my way back.

This part scares me. :cry:

I was going to try follow a tutorial for a Cobweb where the endpoints get attached and thought that might work and it looks like you’ve confirmed that…wish me luck!

Thanks again!

Break stuff up into smaller parts and experiment - prove each part works and then bring it all together… :man_shrugging:

E.g. Here is a simple experimental setup to explore what the ray-cast does:

Good luck!

Makes sense. I guess it’s got a lot to do with understanding the nodes and what they do, there’s also the math to consider.

I tried to adapt it to my setup but failed. I did your setup and tried to add to it, but I need to understand more about the curve lines so I can manipulate it…currently when I draw the spline onto an object straight line shoot off it (as per your setup) I want to be able to have a main trunk so to speak and have a few branches coming off it that are distorted, then I can add the leaves etc.

I’ll try a basic vine with branches and then try add the raycast stuff to it.

Thanks again for your help.

Update.

I managed to make the “Draw Vine” addon based off a tutorial…I took his setup and manipulated it to suit what I needed.
I then used Serpens to make the addon…Here’s the result.

Draw Vines

here’s a more realistic example of how it’s to be used.

6 Likes

can you show me how you create draw button on Serpens,

I can…it just depends on how your going to use it and how well you know serpens…I’m still learning and get a lot of help from the discord.

Essentially, you first add a Bezier curve to the scene with a run script, then append something to it like a geo nodes modifier, then at the end you select the curve and delete vertices and select the draw curve tool, also with a run script. The Reset Fields setup is to do exactly that reset/clear out any previous selections so they don’t appear again when executing the draw. I got the Draw Curve script asking ChatGPT and edited it to work, I know really basic coding.

Serpens Node Setup

Curve Scripts.

I added some new scripts made in ChatGPT to delete the Vine_Leaf when deleting the modifier to start over if needed, otherwise the leaf gets left over and you have to delete it manually. (the vine leaf is part of the geo nodes nodetree with materials)

As well as when converting the geo nodes to a mesh it deletes the Vine_Leaf and renames the converted mesh from BezierCurve to (what ever name you want…just change it in the script)

thank you I use the draw curve script and it works and I will use the other script, again thanks for your response I really appreciate that

Your welcome.

@IvanB can i ask how were you able to create the random branching in geonodes? I can figure out how to do it?

Hey shawnbecker I used this tutorial and customized it to make it look like vines, I can’t remember exactly what I did as it was a while ago, but this is a good start.

The major difference was the noise added to the web to make it look a lot more like vines, then added leaves.

Cobweb generator with geometry nodes Blender (youtube.com)

Me again trying to improve my addon.

Does anyone have a better idea or setup for the spline to attach itself to the surface, rather than passing through it.

When drawing the spline on geometry with other geometry below or behind the face that’s been drawn on, the drawn spline passes through the geometry to attach itself to the closest points…I figure that is the work of the “Geometry Proximity” node.

Here’s the result of that.

Is it possible to have the drawn spline only attach itself to the distributed points based on the normal of the geometry…only attaching itself the correct normal facing side and ignoring points below those faces?..esentially taking the long route, rather than the shortest route.

Here’s my node setup.

It works ok, however there are more vines on the inside of the building rather than on the outside.

I’ve seen some video where mesh to volume is used along with the shortest path node…any ideas how that can be utilized?

Thanks,
Ivan.

1 Like

Note to myself…

I fixed the drawing of the vines penetrating through the geometry…it’s not perfect, but so much better.

Here’s the old Geo Nodes setup for the main drawn vine…this setup is more so for spider web drawing.

I changed it to this…

Here is the result, the vines stay on the drawn face and don’t penetrate the geometry to get to other faces.