-2

Im trying to convert STEP file to glTF format in .net core.Any solution for to read and convert STEP files in glTF format.

Nikhileshwar
  • 1,666
  • 1
  • 11
  • 26

1 Answers1

2

Well, I have not heard about any open-source STEP reader written in C#, but if wrapping of C++ library is also considered, then it can be done with help of Open CASCADE Technology (OCCT, under LGPL), which provides STEP reader and glTF writer (within current development branch).

In this case, you will have to write a little bit code in C++/CLI to:

  • Read STEP file into XCAF document using STEPCAFControl_Reader tool.

  • Compute triangulation using BRepMesh_IncrementalMesh for all shapes within the document with necessary quality.

  • Convert XCAF document (with computed triangulation) into glTF 2.0 file using RWGltf_CafWriter tool.

  • Expose some function / class to be accessible from C# level (using C++/CLI or PInvoke() approach) and manage related DLLs distribution tasks.

OCCT comes with a C# sample using C++/CLI wrapping approach, but if conversion is all you need, then the sample might look too complex.

gkv311
  • 2,612
  • 1
  • 10
  • 11