Jump to content

Subdivision - transfer edge groups


JJ FX

Recommended Posts

Hi,

You can update your edge groups automatically using VEX (Detail Wrangle), but you will pay performance penalty for very high res geometry that has very large edge groups:

string edgegroups [ ] = split ( chs("edgegroups"), " " );
foreach ( string edgegroup; edgegroups )
{
    int pts [ ] = expandedgegroup ( 1, edgegroup );
    int count = len ( pts );
    for ( int i = 0; i < count; i += 2 )
    {
        int pt0 = pts [ i ];
        int pt1 = pts [ i + 1 ];
        
        int pts0 [ ] = neighbours ( 0, pt0 );
        int pts1 [ ] = neighbours ( 0, pt1 );
        
        int sharedpt = -1;
        foreach ( int pt; pts0 )
        {
            if ( find ( pts1, pt ) >= 0 )
            {
                sharedpt = pt;
                break;
            }
        }
        
        if ( sharedpt != -1 )
        {
            setedgegroup ( 0, edgegroup, pt0, sharedpt, 1 );
            setedgegroup ( 0, edgegroup, pt1, sharedpt, 1 );
        }
    }
}

 

Edge group expression:

`edgegrouplist(-1)`

 

image.thumb.png.0a0066ce5c2cb03ad786aabbb51e367b.png

image.thumb.png.5a6deec5624c87110bac730bc40fd1ce.png

 

If you need multiple levels of subdivision, you need to encapsulate the Subdivide and Attribute Wrangle inside a For Each Loop network, as the edges have to be updated at each subdivision.

Alternatively you can change the VEX code to walk the edges instead, then it would handle any edge group regardless of the subdivision levels difference between 2 geometries.

  • Like 2
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...