Given a face primitive, best way to find edge-adjacent faces.

   3256   1   1
User Avatar
Member
1 posts
Joined:
Offline
HDK question:

Given a face primitive (GA_Primitive, say), what is the simplest way to find the faces which share an edge with that face?

Ideally it would be nice to have an HDK equivalent to the VEX primhedge() function. It looks like all the other VEX halfedge functions have GEO_HedgeInterface equivalents (e.g., hedge_prim() in VEX and GEO_HedgeInterface::hedgePrimitive() in the HDK), but I can't see an equivalent to primhedge(). Is it in there, but I just keep missing it?

I know there is GU_Detail::buildRingZeroPrimitives, but it appears to return all faces which share a point with the face in question, which is not what I need.

Any help greatly appreciated!

Kevin
User Avatar
Member
1743 posts
Joined: March 2012
Offline
If you can get the half-edges (vertex offsets) around an edge, you can call detail.vertexPrimitive(vtxoff) to get the primitive of each half-edge (vertex). That's available even if you're not using the half-edge interface, since the regular topology attributes provide a way to go from vertex-to-point (vertexPoint function), point-to-vertex (pointVertex function), vertex-to-next-vertex (vertexToNextVertex function, around a point in no particular order), vertex-to-prev-vertex (vertexToPrevVertex function, just needed internally for removing vertices), and vertex-to-primitive (vertexPrimitive function). Hopefully that's what you were looking for.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
  • Quick Links