Wed, 06/07/2023 - 06:29
Hello,
When I imported the vrml model, I obtain a mirror of the model. And you can see that the letters are in the opposite direction. I don't know how to solve this problem. Do you have any good suggestions?
Here's my code to import vrml file:
Handle(TDocStd_Application) m_app;
Handle(TDocStd_Document) m_doc;
Handle(VrmlAPI_CafReader) m_reader;
m_app = new TDocStd_Application();
BinXCAFDrivers::DefineFormat(m_app);
m_app->NewDocument("BinXCAF", m_doc);
m_reader = new VrmlAPI_CafReader;
m_reader->SetDocument(m_doc);
TDF_Label mainLabel = m_doc->Main();
Handle(XCAFDoc_ShapeTool) myShapeTool = XCAFDoc_DocumentTool::ShapeTool(mainLabel);
Message_ProgressRange range;
m_reader->Perform(fileName, range); // vrml filepath
TDF_LabelSequence FreeShape;
myShapeTool->GetFreeShapes(FreeShape);
int Roots = FreeShape.Length();
for (int index = 1; index <= Roots; index++)
{
TDF_Label label = FreeShape.Value(index);
Handle(XCAFPrs_AISObject) displayedShape = new XCAFPrs_AISObject(label);
m_context->Display(displayedShape, false);
}
Please change the file suffix name from .info to .wrl, because we are unable to upload the .wrl file.
Wed, 06/07/2023 - 11:38
Hello, I guess you need to specify direction.
You have 2 ways:
Use DE_Wrapper interface:
Call methods into VrmlAPI_CafReader:
Best regards, Dmitrii
Wed, 06/07/2023 - 12:06
Thank you very much for your suggestion. I have solved my problem perfectly using the VrmlAPI_CafReader method you provided.
Best regards, Vispec