RWGltf_Writer Edge & Vertex Export

When using RWGltf_Writer, I am able to export glb files that contain one mesh entity per BREP face in my CAD models; however, it seems there is no support for encoding discretized BREP edges in the glb export, nor support for encoding vertices from the CAD models, despite the capability by the file format to do so per the glTF 2.0 specification. Am I missing a step in the meshing of my CAD model or in the usage of RWGltf_Writer that would enable me to export discretized edges and vertices in addition to the faces?

For reference, I am basically doing the following:

std::string input_step_filepath = "path/to/step/file.stp";
STEPCAFControl_Reader reader;
reader.ReadFile(input_step_filepath.c_str());
Handle(TDocStd_Document) imported_document = new TDocStd_Document("BinXCAF");
reader.Transfer(imported_document);
Handle(XCAFDoc_ShapeTool) shape_tool = XCAFDoc_DocumentTool::ShapeTool(imported_document->Main());

TDF_LabelSequence root_labels; 
shape_tool->GetFreeShapes(root_labels); // Assume for simplicity there is only one root label.
auto& root_label = root_labels.First();
TopoDS_Shape root_shape = shape_tool->GetShape(root_label);

IMeshTools_Parameters mesh_parameters;
mesh_parameters.Deflection = 0.01;
mesh_parameters.Angle = 0.5;
mesh_parameters.Relative = Standard_False;
mesh_parameters.InParallel = Standard_True;
mesh_parameters.MinSize = Precision::Confusion();
mesh_parameters.InternalVerticesMode = Standard_True;
mesh_parameters.ControlSurfaceDeflection = Standard_True;
BRepMesh_IncrementalMesh mesh_builder(root_shape, mesh_parameters);

TColStd_IndexedDataMapOfStringString gltf_metadata;
std::string output_filepath = "path/to/output/file.glb";
RWGltf_CafWriter gltf_writer(output_filepath.c_str(), true);
gltf_writer.ChangeCoordinateSystemConverter().SetOutputLengthUnit(0.001);
gltf_writer.ChangeCoordinateSystemConverter().SetInputCoordinateSystem(RWMesh_CoordinateSystem_Zup);
gltf_writer.Perform(imported_document, gltf_metadata, Message_ProgressRange{});
Dmitrii Pasukhin's picture

Hello, you are right. Current version of RW GLTF have no full support of some features available in specification. Curves, animation, points, text are not supported. If it important for your projects, you can share your needs by survive. It helps us to analyse the interest in different functions:)

https://dev.opencascade.org/content/shape-future-occt-your-opinion-matters

Best regards, Dmitrii.

nikoprotic's picture

Hi Dmitrii,

Thanks for confirming. I will submit a survey but I can't afford to wait a long time for this functionality to be implemented. What is the process to PR into the OCCT repository? I'm happy to add this functionality myself.

Dmitrii Pasukhin's picture

Nice to hear. The process for contribution described here: Get involved | Open CASCADE Technology If you have any quastions you are free to ask.

Best regards, Dmitrii.