Adding support for stl models to github_blob engine

I’ve modified the onebox github_blob engine to display the stl model file using github’s render url.

https://github.com/discourse/onebox/pull/401

This is my first attempt at modifying onebox. Feedback is welcome.

I’m testing with “https://github.com/nophead/Mendel90/blob/master/dibond/stls/x_motor_bracket.stl” but that repo is full of stl files that you can test with.

1 Like

Looks like the automated tests that are failing for onebox are failing since the version bump.

https://github.com/discourse/onebox/commit/6ab57eca8cf3d9ee8f7675bf5bd125403c00269b

@zogstrip @maja Can someone take a look at travis-ci and tell me why the tests are failing?
https://travis-ci.org/discourse/onebox/jobs/515606903

Gemfile.lock wasn’t updated with a new version after version bump, it should work now: https://github.com/discourse/onebox/commit/d0f99c5e66ac3c3732805c75498d92c4d410811d

3 Likes

Thanks. Since my pull request is still showing a travis-ci failure, should I close it and recreate it?

Thank you! I was just wishing for this today because I wanted to display as a model:

https://github.com/johnsonm/lathe-tool-models/blob/master/square-tool.stl

…and a visual model would be more compelling than the textual content! :relaxed:

The current version does nothing to set the size of the iframe window so the rendered model is fairly small.

I initially thought that was ok since clicking on the link will take you to a page with a larger version of the rendered model but now I’m wondering if the embedded display should be a little larger.

Looking at the youtube plugin, it uses 480x360 which seems like a good size.


It makes me wonder if I should set the default size to 480x360 or leave it as it is.

4 Likes

As someone who creates models and intends to use this feature, I think that the 480x360 is a more meaningful aspect ratio for interactive content like this.

I closed the PR and created a new one.

https://github.com/discourse/onebox/pull/402

3 Likes