Jump to content

What primhedge function does ?


Recommended Posts


I want to ask one quick question. What primhedge function does, according to help file it is returning the number of an arbitrary half-edge that contained in prim.

If anyone know about this function and know what is the use of this function please expain me.


Link to comment
Share on other sites

hi Sourabh,
what exactly didnt you understand? what exactly do you want to do?
that maybe helps to understand what you are after.

EDIT: maybe also read about other functions like vertexhedge or hedge_prim, they are very well described and documented. 
hope this helps


Edited by fuat
Link to comment
Share on other sites

You can use it to write neighbours() function analog for primitives:

// Primitive wrangle.


int prim_edge = primhedge(0, @primnum);
for (int i = 0; i < primvertexcount(0, @primnum); i++)
    for (int j = 0; j < hedge_equivcount(0, prim_edge); j++)
        int edge = hedge_nextequiv(0, prim_edge);
        int prim = hedge_prim(0, edge);
        if (prim != @primnum)
            append(i[]@neighbours, prim);
        prim_edge = edge;
    prim_edge = hedge_next(0, prim_edge);

The code based on the example from @petz.

We don't use half edge functions much, because all kinds of higher-level geometry functions like that are implemented in VEX already. Otherwise they would be everywhere. I prefer to think of them like a building blocks for functions like neighbour, primpoints, pointvertices, etc. Almost never used any of them, and searching through $HH/vex/ shows a little use too.

Edited by f1480187
  • 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.

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