Mon, 04/17/2023 - 14:55
Hello everyone,
I import stl file with method RWStl::ReadFile because I have a large size STL so old fashion way takes (I mean StlAPI_Reader) too much time. And after import stl file want to convert to STEP file. But I couldn't convert that . In writer.Transfer section status returns fail. For any idea I will be appreciated.
TCollection_AsciiString theFileName = Utilities::ToAsciiString(inp); auto aTris = RWStl::ReadFile(theFileName.ToCString(), 0.1); auto face = TopoDS_Face(); auto aBuilder = BRep_Builder(); aBuilder.MakeFace(face, aTris); STEPControl_Writer writer; IFSelect_ReturnStatus status = writer.Transfer(face, STEPControl_ManifoldSolidBrep); const TCollection_AsciiString asciiExportPath = Utilities::ToAsciiString(exportPath); status = writer.Write(asciiExportPath.ToCString()); return true;
Mon, 04/17/2023 - 15:17
Hello,
Can you share OCCT version, that you use?
Support of STEP tessalating was released in 7.7.0.
Best regards, Dmitrii.
Mon, 04/17/2023 - 15:21
I use 7.6.0 but of course can update the version if there is a solution in 7.7.0
Mon, 04/17/2023 - 16:25
I just updated the OCCT to 7.7.0. What should I do next?
Mon, 04/17/2023 - 16:46
Setting up schema to 242:
Interface_Static::SetCVal("write.step.schema","AP242DIS");
And then just export.
Best regards, Dmitrii.
Mon, 04/17/2023 - 16:49
Sorry, addionally you need to accept only tess entities:
STEPControl_Controller::Init();
Interface_Static::SetCVal("write.step.schema","AP242DIS");
Interface_Static::SetCVal("write.step.tessellated", "On");
Best regards, Dmitrii.
Mon, 04/17/2023 - 17:23
I don't understand how to use these lines in my code? Can you explain more please?
Mon, 04/17/2023 - 17:46
Just copy-past before writing. Please read STEP Translator - Open CASCADE Technology Documentation