View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033434 | Community | OCCT:Data Exchange | public | 2023-07-26 14:07 | 2023-09-30 01:30 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | ||
Status | new | Resolution | open | ||
Product Version | 7.7.0 | ||||
Target Version | Unscheduled | ||||
Summary | 0033434: Data Exchange - Incorrect converting of model from .stp file to .gltf file | ||||
Description | After converting to a .glb file, one of the parts of the model does not look the same as it was originally. Regression since OCCT 7.7.0. | ||||
Steps To Reproduce | int main(int argc, char* argv[]) { const char* stepFileName = "C:\\Programs\\step2gltf\\test\\Case2_GEAR.step"; const char* gltfFileName = "C:\\Programs\\step2gltf\\gltf\\Case2_GEAR_Official.glb"; // Create XDE document Handle(TDocStd_Document) doc; Handle(XCAFApp_Application) app = XCAFApp_Application::GetApplication(); BinXCAFDrivers::DefineFormat(app); app->NewDocument("BinXCAF", doc); // Parse step file into XDE document STEPCAFControl_Reader reader; IFSelect_ReturnStatus readStat = reader.ReadFile(stepFileName); reader.Transfer(doc); Handle(XCAFDoc_ShapeTool) shapeTool = XCAFDoc_DocumentTool::ShapeTool(doc->Main()); TDF_LabelSequence aRootLabels; shapeTool->GetFreeShapes(aRootLabels); TopoDS_Compound aCompound; BRep_Builder aBuildTool; aBuildTool.MakeCompound(aCompound); for (TDF_LabelSequence::Iterator aRootIter(aRootLabels); aRootIter.More(); aRootIter.Next()) { const TDF_Label& aRootLabel = aRootIter.Value(); TopoDS_Shape aRootShape; if (XCAFDoc_ShapeTool::GetShape(aRootLabel, aRootShape)) { aBuildTool.Add(aCompound, aRootShape); } } // perform meshing Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer(); // holds visualization defaults BRepMesh_IncrementalMesh anAlgo; anAlgo.ChangeParameters().Deflection = 0.1; anAlgo.ChangeParameters().Angle = 20.0 * M_PI / 180.0; // 20 degrees anAlgo.ChangeParameters().InParallel = true; anAlgo.SetShape(aCompound); anAlgo.Perform(); // write or export the document TColStd_IndexedDataMapOfStringString aMetadata; RWGltf_CafWriter aGltfWriter(gltfFileName, true); // STEP reader translates into mm units by default aGltfWriter.ChangeCoordinateSystemConverter().SetInputLengthUnit(0.001); aGltfWriter.ChangeCoordinateSystemConverter().SetInputCoordinateSystem(RWMesh_CoordinateSystem_Zup); Message_ProgressRange optionalIndicator; if (!aGltfWriter.Perform(doc, aMetadata, optionalIndicator)) { // export error } } | ||||
Additional information and documentation updates | https://dev.opencascade.org/content/fail-convert-geomrectangulartrimmedsurface-step-files-gltf-files | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
Case2_GEAR.step (783,957 bytes) Case2_GEAR_Official.glb (1,174,748 bytes) input_model_picture.jpg (360,385 bytes) output_result_picture.jpg (165,381 bytes) step2gltf_official.cpp (2,606 bytes) |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-07-26 14:07 |
|
New Issue | |
2023-07-26 14:07 |
|
Assigned To | => ika |
2023-07-26 14:08 | dpasukhi | Product Version | => 7.7.0 |
2023-07-26 14:10 |
|
Note Added: 0113790 | |
2023-07-26 14:10 |
|
File Added: Case2_GEAR.step | |
2023-07-26 14:10 |
|
File Added: Case2_GEAR_Official.glb | |
2023-07-26 14:10 |
|
File Added: input_model_picture.jpg | |
2023-07-26 14:10 |
|
File Added: output_result_picture.jpg | |
2023-07-26 14:10 |
|
File Added: step2gltf_official.cpp | |
2023-07-26 14:16 | dpasukhi | Steps to Reproduce Updated | |
2023-07-26 14:16 | dpasukhi | Additional Information Updated | |
2023-09-30 01:30 | ika | Assigned To | ika => |