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
Fri, 06/14/2024 - 10:23
Hi Dimitrii,
I have tried same approach.
But aVrlmProvider giving me error : pointer to incomplete class type is not allowed.
Also
in aVrmlReader apart from SetDocument, id didn't find any other methods.
Thank you in Advance.
Fri, 06/14/2024 - 10:33
It is compiling issue. Please add #include lines of any classes that you are using or trying to use including as a non-direct casting. As for a document, you need to create (initialize) one before using.
If problem still here, please share logs and code samples :)
Best regards, Dmitrii.
Mon, 06/17/2024 - 07:12
Sorry. It was my mistake. Code is working fine.
But I am not able to load the model.
I have tried to open model in CAD Assistance also. But that application also fails to open model. (See attached model)
Error is : VrmlData_VrmlFormatError
Thank you Dmitrii.
Sun, 06/16/2024 - 20:22
Let me chack the issue. I will return to you during a week. We resolve an issue with VRML #1 in 7.8 I hope it will help with first file. But for now, could you please share the version of OCC, that are you using.
In bug case i will create an issue in bug tracker and share the link. The priority in case of small fix will be increased.
Best regards, Dmitrii.
Mon, 06/17/2024 - 07:12
Currently I am using version 7.7
Mon, 06/17/2024 - 20:03
Hello, the issue in insupported type.
Issue: 0033745: VRLM Import - Unsupported type MaterialBinding - MantisBT (opencascade.org) for wrl file. As for a vrml file it is read correct with no issue:
VRML Reader is very sensetive, indeed need to find a way to process and skip unsupported types. Issue created, there are no planning for that issue for now.
As for a
Best regards, Dmitrii.