Is there a way to tessellate differently for each part of the model?

Hello! guys
Currently, I want to use Hoops Exchange to apply different Tessellation to different parts, but I haven’t found anything about this yet and am stuck on how to do it.

I know how to adjust the Tessellation parameter option for the whole model(using hoopsExhchangeLoader as ImportExport example), but I want to apply it differently for each part to optimize the file conversion speed.

Thanks

Hello @dongho.shin,
According to your description, we recommend you try A3DRiRepresentationItemComputeTessellation (link). You need to import the file, parse it and tessellate by Ri. Thank you.

Best Regards,
Man

1 Like

then where can i get A3DRiRepresentationItem? from A3DEntity?

Hello @dongho.shin
There are few posts on the forum discussing how to traverse to PRC, for example this post may help in understanding how to get A3DRiRepresentationItem.
Or you can refer to the default sample PRC2XML for traversal or sample Viewer/MeshViewer. The API A3DRiRepresentationItemComputeTessellation is used in the sample.

Best Regards,
Man

2 Likes

I appreciate it. it works

I want to tessellate each part and export it to glb, then import it in another application and replace the tessellation results.
To concatenate the tessellation results, I need the Id value of each part, so I looked at the docs and found the following API.
A3DEntityGetPrcIdFromWrite(A3DSDKTools.h — HOOPS Exchange Documentation)

But I don’t see any way to initialize the A3DRWParamsPrcWriteHelper of that function.
Do you have any recommendations?

Hello @dongho.shin
A3DRWParamsPrcWriteHelper is reserved for future use. You can set is as NULL if needed.
A3DRWParamsPrcWriteHelper* pPRCWriteHelper = NULL;

Best Regards,
Man

1 Like

thanks to answers lots of questions
Can you write a example code for function A3DEntityGetPrcIdFromWrite?

//in document PrcId require after export prc
A3DStatus commandStatus = A3DAsmModelFileExportToPrcFile(sHoopsExchangeLoader.m_psModelFile, &sPrcExportData, "/Users/donghoshin/Documents/ExchangeTestModel/test.prc", nullptr);
// ...
// in traverse_tree
A3DEntity *pEntity = nullptr;
A3DTreeNodeGetEntity(hnd_node, &pEntity);
A3DEEntityType eType = kA3DTypeUnknown;
A3DEntityGetType(pEntity, &eType);

A3DUTF8Char** prcId = nullptr;
A3DEEntityType parentType = kA3DTypeUnknown;
A3DEntityGetType(pParentEntity, &parentType);
//ParentInput should nullptr when it is Product Occurrence
A3DEntity *pParentInput = parentType == kA3DTypeAsmProductOccurrence ? nullptr : pParentEntity;
A3DStatus prcIdStatus = A3DEntityGetPrcIdFromWrite(pEntity, pParentInput, nullptr, prcId); //ref.https://docs.techsoft3d.com/exchange/latest/api/c/A3DSDKTools_8h.html#_CPPv426A3DEntityGetPrcIdFromWritePK9A3DEntityPK9A3DEntityPK25A3DRWParamsPrcWriteHelperPP11A3DUTF8Char
std::cout << "prcIdStatus: " << prcIdStatus << std::endl; // it returns -1 general error

Hello @dongho.shin,
After confirming with the engineering team, the API A3DEntityGetPrcIdFromWrite is dedicated to HOOPS Communicator.
I suggest you try A3DAsmProductOccurrenceGetIdentifier (link) to get the ID from the product occurrence. You can refer to the sample code in the example Collision.

Best Regards,
Man