Search - User list
Full Version: Distance between points and stamping
Root » Technical Discussion » Distance between points and stamping
lawindh
Hello,

I'd like to copy a mesh to a point based on length or distance between points. In the attached image, I'd like to copy a longer mesh to points with a greater distance apart, and a shorter mesh to points with a shorter distance. For this training I'm trying to make a very basic house generator using some generic “long” and “Short” wall meshes which I am stamping to the points. I'm trying to detect where to put a long wall and where to put a short one.

I'm guessing I need to find the distance between all points (0-1, 1-2, etc) then say if distance is x do this, if distance is >x do that. Not sure how to go about it. I'd like to do it in VEX because I'm hoping to learn.

I have seen several posts about finding the distance between 2 points and I was able to do that successfully. In this case I need to find the distance between all the points and store that into a variable. I'm an artist trying to learn some vex, so please bear that in mind.

Thank you!
lawindh
Some more context. Using some tutorials and experimentation of my own, I ended up with this generator that seeds some random shapes using a grid.

I'm then using copy stamp to place random meshes on each point. This is working fine. However, I'd like to expand it's function to also detect when the walls are short or long. So, I used a DissolveFlatEdges to remove the non corner points.

Next I need to figure out how to determine how long the edge is so I can tell houdini which type of mesh (Long or short) to copy to the correct points.
RonanCroyal
A good start
lawindh
RonanCroyal Thanks! I didn't know about some of these nodes, I'll do some research on how they're working. Also, it appears that your file is doing what I'm looking for.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB