最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is the preferred method for loading STL files in Three.js - Stack Overflow

programmeradmin2浏览0评论

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).

** 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. **

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 .js/blob/master/javascripts/thingiloader.js which I'd like to avoid because of the license, and .js/blob/master/utils/stl_geometry.js which seems not fully integrated.

Am I missing something?

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).

** 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. **

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./tbuser/thingiview.js/blob/master/javascripts/thingiloader.js which I'd like to avoid because of the license, and https://github./tbuser/three.js/blob/master/utils/stl_geometry.js which seems not fully integrated.

Am I missing something?

Share Improve this question edited Sep 10, 2018 at 9:35 Mike Kinghan 61.5k15 gold badges168 silver badges200 bronze badges asked Jun 16, 2012 at 2:18 user1460044user1460044 3691 gold badge3 silver badges6 bronze badges 1
  • There's an STLGeometry available online, although it needs some tweaking. – Drew Noakes Commented Dec 7, 2017 at 9:14
Add a ment  | 

1 Answer 1

Reset to default 9

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 mits involving the STLLoader.

发布评论

评论列表(0)

  1. 暂无评论