在Three.js中加载STL文件的首选方法是什么 [英] What is the preferred method for loading STL files in Three.js

查看:547
本文介绍了在Three.js中加载STL文件的首选方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,旨在用作机械设计和模拟工作流程的一部分,我们希望能够使用Three.js来加载和可视化Solidworks中设计的部件,导出为STL(文本或二进制)。

I'm writing an application that is designed to be used as part of a mechanical design and simulation workflow, and we'd like to be able to use Three.js to load and visualize parts designed in Solidworks, which can be exported as STL (text or binary).

**我完全认识到可以使用像Meshlab这样的东西转换为OBJ或其他格式,但这似乎是一个阻碍工作流程的不必要的额外步骤。 **

** I fully recognize that one can use something like Meshlab to convert to OBJ or some other format, but this seems like an unnecessary additional step that encumbers the workflow. **

似乎Three.js有很好的Collada,OBJ,UTF-8,VTK和JSON加载解决方案,但是没有干净的STL支持示例。我看到过去曾经使用过的东西,比如
https://github.com/tbuser/thingiview.js/blob/master/javascripts/thingiloader.js
由于许可证我想避免,

https:// github。 com / tbuser / three.js / blob / master / utils / stl_geometry.js
似乎没有完全整合。

It seems Three.js has good loading solutions for Collada, OBJ, UTF-8, VTK, and JSON, but there is no clean STL support example. I saw some things floating around that have been used in the past, such as https://github.com/tbuser/thingiview.js/blob/master/javascripts/thingiloader.js which I'd like to avoid because of the license, and https://github.com/tbuser/three.js/blob/master/utils/stl_geometry.js which seems not fully integrated.

我错过了什么?

推荐答案

有一个 STLLoader 如何使用的示例 。这些已添加到 2012年8月中的Three.js,这个问题最初发布后仅仅一个月左右。从那以后,有几个提交涉及STLLoader。

There is an STLLoader and an example of how to use it. These were added to Three.js in August of 2012, a mere month or so after this question was originally posted. Since then, there have been several commits involving the STLLoader.

这篇关于在Three.js中加载STL文件的首选方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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