Distance between points and stamping

   1928   3   1
User Avatar
Member
18 posts
Joined: Sept. 2019
Offline
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!
Edited by lawindh - Nov. 15, 2019 20:17:58

Attachments:
pointdistance.JPG (98.6 KB)

User Avatar
Member
18 posts
Joined: Sept. 2019
Offline
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.

Attachments:
GenContext.gif (5.4 MB)
dissolveFlatEdges.JPG (60.1 KB)

User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
A good start

Attachments:
untitled.hiplc (126.5 KB)
PrimLength.png (1.0 MB)

User Avatar
Member
18 posts
Joined: Sept. 2019
Offline
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.
Edited by lawindh - Nov. 17, 2019 19:01:19
  • Quick Links