Jump to content

How to group prims by similar curvature


texturerama

Recommended Posts

Hi, I'm a relatively new user so forgive me if this is a trivial problem


I'm trying to sort my mesh according to regions of similar curvature. 
My aim is to be able to iterate over each region and remesh it smoothly— Ideally, in a way that would preserve boundary points and leave the mesh water-tight.

Below is a link to the work of a Houdini artist whose procedure I'm trying to reproduce on my own meshes. 

Any help or a nudge in the right direction would be much appreciated. I've attached a very simple hip file illustrating what I'm trying to accomplish.

 

Thanks so much!

Measured Remesh.png

Measured Partitioning_test.hiplc

Link to comment
Share on other sites

This is not a trivial problem as soon as you try on a decently complex model.

Have some semi success using standard houdini hacking node, i need more time and see how i could group small cluster area, smooth the border of each , Im not far but in other hand but to be honest i also feel a math Vex approach will be the better .

Ideally we want to reduce the curvature into a classified sparse collection of seen smooth curves which can cut and minimize the surface into a path of simple
developable surface while preserving the main feature of the original shape.
By considering the neighbour points , algorithm like gradient descent will help to minimizing the energy and avoid the square angle.

 

Will love to see more feedback from this please..

 

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

 http://fr.linkedin.com/in/vincentthomas

Link to comment
Share on other sites

Hi,

You can also select edges using the angle between the faces sharing it:

float getAngleBetweenVectors ( vector v0; vector v1 )
{
    vector v0n = normalize ( v0 );
    vector v1n = normalize ( v1 );
    return atan2 ( length ( cross ( v0n, v1n ) ), dot ( v0n, v1n ) );
}

int pts [ ] = neighbours ( 0, @ptnum );
foreach ( int pt; pts )
{
    if ( @ptnum < pt )
        continue;
        
    int prs [ ] = { };
    
    int firsthedge = pointhedge ( 0, @ptnum, pt );
    int count = hedge_equivcount ( 0, firsthedge );
    if ( count == 2 )
    {
        int hedge = firsthedge;
        
        do
        {
            int pr = hedge_prim ( 0, hedge );
            if ( pr != -1 && find ( prs, pr ) < 0 )
                append ( prs, pr );
                
            hedge = hedge_nextequiv ( 0, hedge );
        }
        while ( hedge != firsthedge );
        
        vector n0 = primuv ( 0, "N", prs [ 0 ], 0.5 );
        vector n1 = primuv ( 0, "N", prs [ 1 ], 0.5 );
        
        float angle = getAngleBetweenVectors ( n0, n1 );
        if ( angle >= radians ( ch("minangle") ) )
            setedgegroup ( 0, chs("vex_selectiongroup"), @ptnum, pt, 1 );
    }
}

LiWosxB.png

  • Like 3
Link to comment
Share on other sites

Is it a different implementation that what SideFx group min edge does excepted off course faster?

Still it doesn't solve the main problem as i describe before. Try to organise, cut and clean polish area of a more complex asset like a statue or let say our pig head is where the challenge is :D

I could get this on the Pig head

 

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

 http://fr.linkedin.com/in/vincentthomas

 

 

 

curvature_capture.PNG

curvature_capture2.PNG

Link to comment
Share on other sites

Slightly off topic from this post but may i ask something?

I struggle to pass some attribute i define in a custom VEX Wrangle to drive some value of others SOP node like thicken or whatever.

I could only make it works with Label using something like  ch("../attribwrangle5/Depthval")

How could i export/write the value of an attribute in an extra-label created?

function like printf only write value to console, right?

 

Obviously im missing something here it has to be more simple , :) isn it ?

It s actually drives me crazy... Please tell me how you manage this yourself,

Cheers

 

Link to comment
Share on other sites

Humm... i guess my eyes are and brain are a little too foggy at the end of this week... ?

Here a portion of my setup, on the leaf itself, thicken node... Any idea to pass a custom attribute here my @thicken to the Labs_thicken local variable depth value?

 

Thanks you

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

 http://fr.linkedin.com/in/vincentthomas

image.thumb.png.d1c01bff9678517b54543340c3d8af5a.png

planleaftree_wip_vinc.hipnc

Link to comment
Share on other sites

10 hours ago, vinyvince said:

Humm... i guess my eyes are and brain are a little too foggy at the end of this week... ?

Here a portion of my setup, on the leaf itself, thicken node... Any idea to pass a custom attribute here my @thicken to the Labs_thicken local variable depth value?

 

Thanks you

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

 http://fr.linkedin.com/in/vincentthomas

image.thumb.png.d1c01bff9678517b54543340c3d8af5a.png

planleaftree_wip_vinc.hipnc

mmmm i don't think it does 'local' thickness. It's still just one thickness coz under the hood, the asset extrudes as connected components and not individual components...to use local thickness, it would have to be in Local Control, zscale (or whatever custom attrib)

Soooo....time for DIY: it's not that hard.

vu_PetalThickness.hiplc

Link to comment
Share on other sites

Yes, you right its make sense that it use connected pieces, thanks Vusta.

In fact i don t know why I didn t thought about writting a couple of lines of VEX to extrude these  passing my custom attribute and normal , it's really easy :)

I guess i still haven t broken enough with all these years of software with premade node with content locked

 

Thanks

 

 

 

9 hours ago, Noobini said:

mmmm i don't think it does 'local' thickness. It's still just one thickness coz under the hood, the asset extrudes as connected components and not individual components...to use local thickness, it would have to be in Local Control, zscale (or whatever custom attrib)

Soooo....time for DIY: it's not that hard.

vu_PetalThickness.hiplc

 

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