3D File Viewer?


#1

I’m wondering if it would be possible to write a package that could support viewing common 3D file types, such as STL, STEP, IGES, DXF, etc. Since Atom can show images, I figure there is already a graphics engine available for the editor area.

Is this an idea that is even worth pursuing? Can the Atom base support such a package? Does anyone know of any similar packages already in development?

Thanks,
Eric


#2

I think the first step to go in that direction is to see if something like that exist in the browser.

I’ve found this repo for stl files

Including a demo

I think it would be possible to package something like that for atom.
Interestingly github have their own browser based stl viewer


#3

Thanks for the info! If I am not mistaken, the editor area uses a WebView, but does that mean it has WebGL capabilities? I imagine the parser alone for this type of plugin would be a huge undertaking, as each file type will have it’s own format. The renderer shouldn’t be too bad if something like three.js is an option though, right?


#4

Just checked and three.js prefers webgl but have a couple of fallback if that’s not available.
It seems the minimap package use a canvas to draw, so we know that is working.

If you want to continue that way you could just have a simple threejs project in a pane/dock.
Then use a more complex model (maybe the cat) to see if it’s reasonably fast.
Then decide if you want to continue that way and what feature you want.

To be honest I’m not familiar with 3d models, or why it would be useful in a text editor. I imagine small change like editing a svg maybe.


#5

Atom is built with the part of Chromium that displays things on the web and parses JavaScript, so it should be capable of anything that the parallel version of Chrome can do. Some tasks are more difficult, but Atom gives packages huge leeway to mess with things, including the ability to write custom openers for files that aren’t treated as text files.


#6

@emroch: Would this be helpful?
https://www.freecadweb.org/