Jump to content

Copy geo to connecting edges of a mesh.


jlrvfx

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
Link to comment
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

Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...