Jump to content
jlrvfx

Copy geo to connecting edges of a mesh.

Recommended Posts

I would like to copy two sets of primitives to a grid. One set of primitives I want to copy to each point on a grid. The second set I would like to copy to the edges that join the points together. Ideally, these connections would scale with the length of the connections.

Carving the grid will result in two copies of the tube in the interior where there were originally two shared edges:

ShareX_vzEpmZQ0mY.png.46382f730c252d4736e1900886bb5ab2.pnghoudini_KWbXOyOvI7.thumb.png.2d14275ab47b10953e7b28e28d1838ea.png

 

If I clean the result of the carve to remove the duplicates it causes issues with the orientation. Assuming it is averaging the normals:

houdini_5XZJwOdig6.png.345158db5a8f0c393945f0e2da4635e9.pnghoudini_JFtMqw1OcY.png.5fb6852bf35b962748125e4ab527d9ad.png

The result I am looking for is like this:

image.png.adbb25c6b3080fcf6111aebcc2fcc069.png

I feel like there must be a simple way to do this that I am overlooking.

gridCopy.hiplc

 

ShareX_vzEpmZQ0mY.png

Edited by jlrvfx

Share this post


Link to post
Share on other sites

Thanks, both. I have used a pipe in the above example to simplify things, but in the end, I would like it to take geo metry modeled elsewhere and be able to place that between the connections so hoping to avoid sweeping. So trying to achieve something like this with the red geo copied to the points and the green bridging the connections. I think zeynes version with the foreach loop might be the key to this so looking into making that work now.  

 

houdini_Zclb3OKhRE.thumb.png.ca034e7e40b08abd352086738f5b7478.png

Share this post


Link to post
Share on other sites

Hi James,

you can copy and scale meshes on converted lines by adding points to their center.

float radius = chf('radius');

int pt_prim = primpoint(0, i@primnum, 0);
vector pos_pt = point(0, 'P', pt_prim);
vector nml_pt = point(0, 'N', pt_prim);
vector dir = normalize(pos_pt - v@P);

float scale = f@restlength - radius;

int pt_add = addpoint(0, v@P);
setpointattrib(0, 'up', pt_add, nml_pt, 'set');
setpointattrib(0, 'N', pt_add, dir, 'set');
setpointattrib(0, 'pscale', pt_add, scale, 'set');

removeprim(0, i@primnum, 1);

 

copy_to_lines.jpg

copy_to_lines.hiplc

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 12/18/2021 at 6:03 PM, konstantin magnus said:

Hi James,

you can copy and scale meshes on converted lines by adding points to their center.


float radius = chf('radius');

int pt_prim = primpoint(0, i@primnum, 0);
vector pos_pt = point(0, 'P', pt_prim);
vector nml_pt = point(0, 'N', pt_prim);
vector dir = normalize(pos_pt - v@P);

float scale = f@restlength - radius;

int pt_add = addpoint(0, v@P);
setpointattrib(0, 'up', pt_add, nml_pt, 'set');
setpointattrib(0, 'N', pt_add, dir, 'set');
setpointattrib(0, 'pscale', pt_add, scale, 'set');

removeprim(0, i@primnum, 1);

 

copy_to_lines.jpg

copy_to_lines.hiplc



This is so cool! Is there a way to use this method to make the object (the lobster) connecting around a mesh like the bodies around the bust in this example @konstantin magnus ?

IMG_0274.jpg

Share this post


Link to post
Share on other sites

Hi @Thoi,

you could try to either stick soft bodies to the other mesh surface using Vellum or possibly project curves that deform the squabs using KineFX or a combination of both.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×