Fri, 04/13/2012 - 19:06
Hi,
I can write and read a TopoDS_Shape to a file no problem. But I want to get a string representation ultimately to my C# parent app, here I will save to disk along with application specific data.
So I try to pass a stream of some sort to BRepTools::Dump (also tried BRepTools::Read) but no matter what I try it either crashing or is empty.
How do I pass to the Standard_OStream& S argument a stream that I can get a std::string out or similar?
My C++ is very basic and I am going round in circles!
Many thanks
Julian
Wed, 04/15/2020 - 05:39
Hi,
I have the same question, is there anyone can help?
Thanks.
Wed, 04/15/2020 - 09:53
Hello, have a look at functions BRepUtils::shapeToString() and BRepUtils::shapeFromString() at https://github.com/fougue/mayo/blob/develop/src/base/brep_utils.cpp
Wed, 04/15/2020 - 10:01
It works, really thank you!
Wed, 04/15/2020 - 12:29
Hi
I have another problem, and I don't know how to solve it.
When I used the TopoDS_Shape BRepUtils::shapeFromString, I tried to get the color of shape:
and I found the colors are all YELLOW, can BRepTools::Write save shape's color?
Best regards.
Wed, 04/15/2020 - 16:41
BRepTools::Read/Write() are functions to serialize a shape with the OpenCascade BRep format which saves only topology.
For color support you will need XCAF, have a look at STEPCAFControl_Reader/Writer or IGESCAFControl_Reader/Writer
Look at XDE in the documentations.
Thu, 04/16/2020 - 03:38
Thank you! I will try.
Best regards.
Wed, 10/14/2020 - 05:38
Hi,
I have the same question now.
Do you find the method to convert XDE format output to std::string?
Thanks