Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedded STL viewer #83

Open
kigerpunk opened this issue Aug 28, 2015 · 7 comments
Open

embedded STL viewer #83

kigerpunk opened this issue Aug 28, 2015 · 7 comments

Comments

@kigerpunk
Copy link

GitHub uses one, though I can’t find the source. Would it be difficult to add one?

@kigerpunk
Copy link
Author

I found one here. That might make it a bit more viable.

@feross
Copy link
Member

feross commented Aug 28, 2015

@ke7ofi Neat idea!

Right now, the code that handles embedding different types of media lives in the webtorrent package at lib/append-to.js. I think that putting STL support there might drastically increase the size of the currently small webtorrent js bundle.

But adding it to instant.io is a great idea! I couldn't see any source code for ViewSTL at your link and we don't want to just iframe a third party service. That's not secure or private, and they don't even support SSL so there would be mixed content errors. We need something that's open source that we can include.

@feross
Copy link
Member

feross commented Aug 28, 2015

@maxogden has an old package that might work, or make a good starting point: https://www.npmjs.com/package/stl-obj-viewer

@max-mapper
Copy link

demo http://maxogden.github.io/stl-obj-viewer/

On Fri, Aug 28, 2015 at 11:25 AM, Feross Aboukhadijeh <
[email protected]> wrote:

@maxogden https://github.com/maxogden has an old package that might
work, or make a good starting point:
https://www.npmjs.com/package/stl-obj-viewer


Reply to this email directly or view it on GitHub
https://github.com/feross/instant.io/issues/83#issuecomment-135853756.

@kigerpunk
Copy link
Author

@feross Is there any way of telling append-to.js to “pipe” it to some other program, or does it have to be fairly integrated? This seems like a case where the Unix approach would be better in the long term as you add more filetypes.

@feross
Copy link
Member

feross commented Aug 30, 2015

@maxogden nice!

@feross
Copy link
Member

feross commented Aug 30, 2015

@ke7ofi Yes, there's already an API to pipe files to arbitrary destinations. See file.createReadStream(), which returns a node.js readable stream which you can pipe to any writable stream, or process by listening to 'data' events.

For the most common case of appending video, audio, or images to the DOM, I think it's nice to have built-in support for now. But we should eventually publish it as a separate npm package and maybe remove support from core to keep it lean and simple...

And there should be a way to extend what file formats file.appendTo() supports so that each WebTorrent user can support whatever formats make sense for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants