Jump to content

Geometry Object conforming to another Geometry surface


virgile

Recommended Posts

Hi @virgile,

you could blend positions based on their distance towards the surface:

 orig_conform.png.1552f389642debf988b55aec93647f01.pngsrf_conform.png.99b2469c80a46255ae8cc9d217b7512f.png

In a point wrangle with first input mesh, second input sphere:

float d_min = chf('min_distance');
float d_max = chf('max_distance');

int prim;
vector uvw;
float d = xyzdist(1, v@P, prim, uvw);
vector pos = primuv(1, 'P', prim, uvw);

float mask = smooth(d_min, d_max, d);
v@P = lerp(pos, v@P, mask);

 

conform_to_surface.hipnc

  • Thanks 1
Link to comment
Share on other sites

Here is another approach using an average direction to project the geometry onto the surface.

conform_object.hipnc

 

@edit: btw it is quite complicated to find the direction to the surface automatically . It seems to be much better, to use a direction given by the source object (z-axis for example), which also gets transformed, if the object gets transformed. Using eigenvectors for orienation alignment is also an option.

 

 

conform_objectA.hipnc

Edited by Aizatulin
  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
On 10/29/2022 at 9:41 AM, Aizatulin said:

Here is another approach using an average direction to project the geometry onto the surface.

conform_object.hipnc

 

@edit: btw it is quite complicated to find the direction to the surface automatically . It seems to be much better, to use a direction given by the source object (z-axis for example), which also gets transformed, if the object gets transformed. Using eigenvectors for orienation alignment is also an option.

 

 

conform_objectA.hipnc

Thank you @Aizatulinthis worked really well! But how can I tile it so that the sphere is populated with objects that all conform? I tried increasing the number in the "scatter1" node which does populate with more objects but they don't conform to the sphere anymore...

Link to comment
Share on other sites

@Thoi sure :-)

 

this version only applies on a single object, but if you want to apply it one multiple objects you can either apply it multiple times or use a foreach node with (loop over pieces with ids).

btw: you don't need scatter at all, it is just a good method to generate points on a surface, where you can apply the copy to points node.

Here some example how to do that

conform_object_apply_multiple_times.hipnc

conform_object_ForEach.hipnc

Edited by Aizatulin
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

33 minutes ago, Aizatulin said:

@Thoi sure :-)

 

this version only applies on a single object, but if you want to apply it one multiple objects you can either apply it multiple times or use a foreach node with (loop over pieces with ids).

btw: you don't need scatter at all, it is just a good method to generate points on a surface, where you can apply the copy to points node.

Here some example how to do that

conform_object_apply_multiple_times.hipnc

conform_object_ForEach.hipnc

This is exactly what I needed! Thank you so so much!!

  • Like 1
Link to comment
Share on other sites

I am trying to utilize this on more complex shapes, it works great in some more uniform areas but gets corrupted with more complex areas.

Is there any way to combat these artifacts? I tried PolyDoctor and Clean but does not seem to remove the broken parts of the conformed model...

Screenshot.jpg

Screenshot 2.jpg

Edited by Thoi
Link to comment
Share on other sites

If you're just doing vines across a body, you might want to use the ray node to project the underlying curves onto the body, then generate the mesh along those conformed curves. This approach might preserve the volume of the mesh a little better as well.

Edited by Atom
  • Like 1
Link to comment
Share on other sites

@Thoi,

If your source geometry has overlapping parts, it will not work, because the ray function will not find an intersection point. But using different directions for each point (from xyzdist()) may work in some cases, but sometimes it creates a totally

mess (even if you smooth the directions).

For example if the diameter of your source geometry is much bigger than the diameter of the target geometry (local parts) it is not possible, to map the source directly onto the target using (nearly) straight directions. Even if you are trying to bend the source around the target, there are limitations.

 

Edited by Aizatulin
  • Like 1
Link to comment
Share on other sites

15 hours ago, Thoi said:

I am trying to utilize this on more complex shapes, it works great in some more uniform areas but gets corrupted with more complex areas.

Is there any way to combat these artifacts? I tried PolyDoctor and Clean but does not seem to remove the broken parts of the conformed model...

Screenshot.jpg

Screenshot 2.jpg

 

With this kind of FX, I would recommend creating the curves over the surface directly and then mesh them after, rather than trying to deform arbitrary mesh onto the body geometry.

  • Like 1
Link to comment
Share on other sites

Thank you for all the great replies! I have been experimenting with different projections and ray workflows but none that works really well procedurally and tile able for conforming meshes. Maybe I am better off using MatchMaker in ZBrush to art direct conformed multiple meshes on the model in the end 

Edited by Thoi
Link to comment
Share on other sites

11 hours ago, Aizatulin said:

ok sure :-),

but it would be alos interesting to see, how MatchMaker is solving the problem of overlapping parts. It would be nice if you can show the results here.

Sure! In ZBrush you can use MatchMaker to conform a new object (sub tool) over the previous conformed object, without corruption (see example). You will still get the same mess if you try to matchmake over a edge not in camera though. But in the end it seems more art directable. 

However I am still learning Houdini so will keep on trying out methods! I think the tips here and hip you have provided looks way better then MatchMaker with a single mesh. Maybe a solution could be some kind of node that would clean up the meshes that does intersect or gets corrupted. 

screen.jpg

  • Like 1
Link to comment
Share on other sites

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...