Jump to content

Adjacent primitives in HDK


Recommended Posts

Thanks Petz! I found buildRingZeroPoints() in the documentation but I'm having a hard time to understand how GEO_HedeInterface works. I was able to find all neighbour points around my current point but I'm not sure how I can import the edges between those points. Any hint would be helpful.

Link to comment
Share on other sites

2 hours ago, resonanz said:

Thanks Petz! I found buildRingZeroPoints() in the documentation but I'm having a hard time to understand how GEO_HedeInterface works. I was able to find all neighbour points around my current point but I'm not sure how I can import the edges between those points. Any hint would be helpful.

 

untested but should work:

// get 1-ring around points
UT_ValArray<GA_OffsetArray> neighbourArray;
gdp->buildRingZeroPoints(neighbourArray, NULL);
// build HedgeInterface
GEO_HedgeInterface hedgeInterface(gdp);
// get neighbours of point 0
GA_OffsetArray neighbours = neighbourArray[0];
// init prims
GEO_Primitive 	*prim1, *prim2;

// iterate over neighbouring points
for(int i = 0; i < neighbours.size(); i++)
{
	// get half-edges between point 0 and neighbour
	GEO_Hedge hedge = hedgeInterface.findHedgeWithEndpoints(0, neighbours[i]);
	GEO_Hedge hedgeNext = hedgeInterface.nextEquivalentHedge(hedge);
	// get prims
	prim1 = hedgeInterface.hedgePrimitive(hedge);
	prim2 = hedgeInterface.hedgePrimitive(hedgeNext);
}

// clean up
if(hedgeInterface.haveHedgeTopology())
	hedgeInterface.destroyHedgeTopologyLinks();

hth.

petz

Edited by petz
  • Like 4
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...