Neotinker
(Ralph Schaffner)
2019 年4 月 8 日 22:02
1
I’ve modified the onebox github_blob engine to display the stl model file using github’s render url.
master ← neotinker:master
closed 01:13AM - 15 Apr 19 UTC
Github has code for displaying stl files but the existing onebox engine would tr… eat the file as text.
I modified the github_blob engine to put the "render.githubusercontent.com/view/solid" link in an iframe if the file type ends with stl.
You can test this using "https://github.com/nophead/Mendel90/blob/master/dibond/stls/x_motor_bracket.stl"
I've never written anything in ruby so be gentle. :)
This is my first attempt at modifying onebox. Feedback is welcome.
I’m testing with “Mendel90/dibond/stls/x_motor_bracket.stl at master · nophead/Mendel90 · GitHub ” but that repo is full of stl files that you can test with.
1 个赞
Neotinker
(Ralph Schaffner)
2019 年4 月 8 日 22:10
2
Looks like the automated tests that are failing for onebox are failing since the version bump.
committed 08:56AM - 04 Apr 19 UTC
Neotinker
(Ralph Schaffner)
2019 年4 月 9 日 00:41
3
@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
maja
(Maja)
2019 年4 月 9 日 07:01
4
Gemfile.lock wasn’t updated with a new version after version bump, it should work now: update Gemfile.lock · discourse/onebox@d0f99c5 · GitHub
3 个赞
Neotinker
(Ralph Schaffner)
2019 年4 月 9 日 15:55
5
Thanks. Since my pull request is still showing a travis-ci failure, should I close it and recreate it?
mcdanlj
(Michael K Johnson)
2019 年4 月 11 日 02:55
6
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!
Neotinker
(Ralph Schaffner)
2019 年4 月 12 日 15:19
7
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 个赞
mcdanlj
(Michael K Johnson)
2019 年4 月 13 日 20:37
8
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.
Neotinker
(Ralph Schaffner)
2019 年4 月 16 日 14:44
9
I closed the PR and created a new one.
master ← neotinker:github_blob
merged 05:37AM - 24 Apr 19 UTC
Github has code for displaying stl files but the existing onebox engine would tr… eat the file as text.
I modified the github_blob engine to put the "render.githubusercontent.com/view/solid" link in an iframe if the file type ends with stl.
You can test this using "https://github.com/nophead/Mendel90/blob/master/dibond/stls/x_motor_bracket.stl"
I've never written anything in ruby so be gentle. :)
3 个赞