任何将 STEP 文件转换为 glTF 文件格式的开源库? [英] Any Open source Libraries to Convert STEP files to glTF file format?

查看:213
本文介绍了任何将 STEP 文件转换为 glTF 文件格式的开源库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 STEP 文件转换为 .net core 中的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆