是否有任何开放源代码库可将STEP文件转换为glTF文件格式? [英] Any Open source Libraries to Convert STEP files to glTF file format?
问题描述
我正在尝试将.net内核中的STEP文件转换为glTF格式.任何用于读取和转换glTF格式的STEP文件的解决方案.
Im trying to convert STEP file to glTF format in .net core.Any solution for to read and convert STEP files in glTF format.
推荐答案
好吧,我还没有听说过任何用C#编写的开放源代码STEP阅读器,但是如果还考虑包装C ++库,则可以使用Open CASCADE Technology(OCCT,LGPL旗下)的帮助,该技术提供了STEP读取器和glTF编写器(在当前开发分支内).
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).
在这种情况下,您将不得不在C ++/CLI中编写一些代码来:
In this case, you will have to write a little bit code in C++/CLI to:
-
使用 STEPCAFControl_Reader 工具将STEP文件读入XCAF文档.
Read STEP file into XCAF document using STEPCAFControl_Reader tool.
使用 BRepMesh_IncrementalMesh 计算具有必要质量的文档中所有形状的三角剖分.
Compute triangulation using BRepMesh_IncrementalMesh for all shapes within the document with necessary quality.
使用 RWGltf_CafWriter 工具将XCAF文档(带有计算的三角剖分)转换为glTF 2.0文件.
Convert XCAF document (with computed triangulation) into glTF 2.0 file using RWGltf_CafWriter tool.
公开一些可从C#级别访问的函数/类(使用C ++/CLI或PInvoke()方法)并管理相关的DLL分发任务.
Expose some function / class to be accessible from C# level (using C++/CLI or PInvoke() approach) and manage related DLLs distribution tasks.
OCCT附带了一个使用C ++/CLI包装方法的C#示例,但是如果只需要转换,那么该示例可能看起来太复杂了.
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.
这篇关于是否有任何开放源代码库可将STEP文件转换为glTF文件格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!