Jump to content

how to judge polygon each primitive is open or closed


Recommended Posts

GA_FOR_ALL_PRIMITIVES(gdp, prim)

{

 

    if(prim->getTypeId() == GA_PRIMPOLY)

    {

        cout<<"is polygon"<<endl;

    }

}

 

 

i also want to filter closed primitive polygon 

how to do this ,i find GEO_Face has operation -GEO_Face::isclosed();

can i use it ?
Link to comment
Share on other sites

Posted Today, 02:54 AM

A prim that reports GA_PRIMPOLY as its type is a GEO_PrimPoly object, which you can safely cast to a GEO_Face (or GEO_PrimPoly). Then you can call faceprim->isClosed().

 

how to do this?

can you show me the code? thanks

Link to comment
Share on other sites


GA_FOR_ALL_PRIMITIVES(gdp, prim)

{

    if(prim->getTypeId() == GA_PRIMPOLY)

    {

const GEO_Face *faceprim = static_cast<const GEO_Face *>(prim);

if(faceprim->isClosed())

        cout<<"is closed polygon"<<endl;

else

        cout<<"is open polygon"<<endl;

    }

}

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