OpenSCAD in the browser (already)

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenSCAD in the browser (already)

Taylor Alexander
Not sure when this happened (according to a note on the page it may have been nearly a year ago), but I stumbled across this today:

It was ported to javascript using this tool:

Which apparently has very good performance (apparently C++ to javascript isn't as unreasonable as I thought, according to this article).

I was surprised to search my email and see that no one has mentioned this. The site looks like a nice answer to thingiverse too. Since I've heard the topic of running OpenSCAD on other platforms (windows 8 tablets came up recently), we may want to see what could be done with this.

Thoughts?

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Alan Cox
On Tue, 14 May 2013 20:53:22 -0700
Taylor Alexander <[hidden email]> wrote:

> Not sure when this happened (according to a note on the page it may have
> been nearly a year ago), but I stumbled across this today:
> http://www.fabfabbers.com/openscad/
>
> It was ported to javascript using this tool:
> https://github.com/kripken/emscripten/wiki
>
> Which apparently has very good performance (apparently C++ to javascript
> isn't as unreasonable as I thought, according to this
> <http://mozakai.blogspot.com/2013/05/the-elusive-universal-web-bytecode.html>
> article).

It's a common technique because javascript is such a broken mess.

However it's not stunningly useful because emscripten is limited by the
lack of threading and proper language constructs in js so can't do proper
file I/O etc.

Alan
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Peter Uithoven
Usually you can work around that limitation. It's much easier for example to have a public library that you can open online and share your improvements on.
Also some systems hook up to systems like Dropbox. I would strongly favor opensource alternatives like Owncloud, but the idea is the same.  

Peter 

On Wed, May 15, 2013 at 11:10 AM, Alan Cox <[hidden email]> wrote:
On Tue, 14 May 2013 20:53:22 -0700
Taylor Alexander <[hidden email]> wrote:

> Not sure when this happened (according to a note on the page it may have
> been nearly a year ago), but I stumbled across this today:
> http://www.fabfabbers.com/openscad/
>
> It was ported to javascript using this tool:
> https://github.com/kripken/emscripten/wiki
>
> Which apparently has very good performance (apparently C++ to javascript
> isn't as unreasonable as I thought, according to this
> <http://mozakai.blogspot.com/2013/05/the-elusive-universal-web-bytecode.html>
> article).

It's a common technique because javascript is such a broken mess.

However it's not stunningly useful because emscripten is limited by the
lack of threading and proper language constructs in js so can't do proper
file I/O etc.

Alan
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

marcosscriven
In reply to this post by Taylor Alexander
Hi Taylor

I released FabFabbers about four weeks ago now. My chief aim was the GitHub integration, but the OpenSCAD stuff seems to have garnered more attention.

I'm curious as to how you found it, and also what you saw that made you think it might be a year old?

I'm also always grateful for feedback, good or bad. As I'm working on this alone it would be useful to know what features you'd like to see?

Marcos
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

marcosscriven
In reply to this post by Peter Uithoven
Hi Peter

Regarding your preference for 'opensource' alternatives, I just wanted to check you know you can sync models with GitHub (and if you add a hook, it will stay in sink too)?

That way you completely own your model and where you put it - something like FabFabbers is then just a convenient view on it - and a place for people to customise it if it's OpenSCAD.

Marcos
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Peter Uithoven
Hi Marcos, 
Sounds nice, sounds even better than Thingiverse's costomizer. I'll check it out and I'll put it on Fablab Amersfoort's website. 

But being able to self host it, and thus be independent is also important, and Github is of cource neither opensource or self hosted. That's why I mentioned OwnCloud. 

Best regards, 
Peter Uithoven 


On Wed, May 15, 2013 at 8:01 PM, marcosscriven <[hidden email]> wrote:
Hi Peter

Regarding your preference for 'opensource' alternatives, I just wanted to
check you know you can sync models with GitHub (and if you add a hook, it
will stay in sink too)?

That way you completely own your model and where you put it - something like
FabFabbers is then just a convenient view on it - and a place for people to
customise it if it's OpenSCAD.

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4416.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Jesse Guardiani
Self hosted github? Check out gitlab. All the kids are doing it.

On May 15, 2013, at 4:27 PM, Peter Uithoven <[hidden email]> wrote:

Hi Marcos, 
Sounds nice, sounds even better than Thingiverse's costomizer. I'll check it out and I'll put it on Fablab Amersfoort's website. 

But being able to self host it, and thus be independent is also important, and Github is of cource neither opensource or self hosted. That's why I mentioned OwnCloud. 

Best regards, 
Peter Uithoven 


On Wed, May 15, 2013 at 8:01 PM, marcosscriven <[hidden email]> wrote:
Hi Peter

Regarding your preference for 'opensource' alternatives, I just wanted to
check you know you can sync models with GitHub (and if you add a hook, it
will stay in sink too)?

That way you completely own your model and where you put it - something like
FabFabbers is then just a convenient view on it - and a place for people to
customise it if it's OpenSCAD.

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4416.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

donbright
In reply to this post by marcosscriven
Marcos

Did you have to make many changes to the openscad source code?
Maybe we could try to integrate those changes into the tree?
I could see a special script under 'scripts' that could, maybe, build directly to a .html file?

-DB

On Wed, May 15, 2013 at 12:59 PM, marcosscriven <[hidden email]> wrote:
Hi Taylor

I released FabFabbers about four weeks ago now. My chief aim was the GitHub
integration, but the OpenSCAD stuff seems to have garnered more attention.

I'm curious as to how you found it, and also what you saw that made you
think it might be a year old?

I'm also always grateful for feedback, good or bad. As I'm working on this
alone it would be useful to know what features you'd like to see?

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4415.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

marcosscriven
Hi Don

I've chatted with Marius about this - planning to put back the chnages I made.

But to answer your question it was not trivial. The biggest issues were:

1) Getting GMP, MPFR, Boost, and CGAL all cross-compiled
2) Refactoring many of the OpenSCAD classes to remove anything GUI or Qt specific
3) Implementing an image-based CSG algorithm from scratch in WebGL (equilvalent to OpenCSG)

I'm just thinking now how best to get this in.

Marcos
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Taylor Alexander
Wait, can OpenSCAD not be operated from a command line without a GUI? I guess I always figured the code would be designed so you could drop in a file and get an STL out if you wanted without having to open a GUI instance.

If it wasn't, those changes to remove the GUI components would be a great step towards cleaning up the libraries so that kind of thing would work, and I imagine that would have many uses.


On Wed, May 15, 2013 at 11:19 PM, marcosscriven <[hidden email]> wrote:
Hi Don

I've chatted with Marius about this - planning to put back the chnages I
made.

But to answer your question it was not trivial. The biggest issues were:

1) Getting GMP, MPFR, Boost, and CGAL all cross-compiled
2) Refactoring many of the OpenSCAD classes to remove anything GUI or Qt
specific
3) Implementing an image-based CSG algorithm from scratch in WebGL
(equilvalent to OpenCSG)

I'm just thinking now how best to get this in.

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4425.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

marcosscriven
Hi Taylor

Yes there is a console mode - but it's the same binary (ie with all the GUI/Qt code in there)

For instance, here's the main entry point class: https://github.com/openscad/openscad/blob/master/src/openscad.cc

The main method of which simply starts with:

bool useGUI = getenv("DISPLAY") != 0;

So I had to remove all that - otherwise I'd have to cross compile all the GUI/Qt/OpenGL stuff, and that would have taken even longer in Emscripten, all with no actual benefit.

As another example, I had to refactor things like this:

https://github.com/openscad/openscad/blob/master/src/polyset.cc

As something like the PolySet is needed as a container object, but depends also on OpenGL code.

There is a project here to convert whole Qt applications as is: http://qt.gitorious.org/~ssj/qt/emscripten-qt

However, I don't think it looks too good having a sort of window-in-a-window approach, inside the browser.

Marcos
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Taylor Alexander
In reply to this post by Taylor Alexander
And Marcos,
I found it on the emscripten github page, listed under projects that use it. I thought your site might be a year old because I misread something on the firefox nightly page you link to in the "beta warning" text you have on your openscad page (I thought it was stale text referring to a release last august, but I'm dumb).

But the site looks great! I have nearly completely stopped using my printer lately or doing any hobby projects really, but I do want to use something other than Thingiverse. Any chance you could build a thingiverse importer? Actually, if you could migrate my projects from thingiverse to github and then link that on your site I'd be stoked.


On Thu, May 16, 2013 at 3:35 AM, Taylor Alexander <[hidden email]> wrote:
Wait, can OpenSCAD not be operated from a command line without a GUI? I guess I always figured the code would be designed so you could drop in a file and get an STL out if you wanted without having to open a GUI instance.

If it wasn't, those changes to remove the GUI components would be a great step towards cleaning up the libraries so that kind of thing would work, and I imagine that would have many uses.


On Wed, May 15, 2013 at 11:19 PM, marcosscriven <[hidden email]> wrote:
Hi Don

I've chatted with Marius about this - planning to put back the chnages I
made.

But to answer your question it was not trivial. The biggest issues were:

1) Getting GMP, MPFR, Boost, and CGAL all cross-compiled
2) Refactoring many of the OpenSCAD classes to remove anything GUI or Qt
specific
3) Implementing an image-based CSG algorithm from scratch in WebGL
(equilvalent to OpenCSG)

I'm just thinking now how best to get this in.

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4425.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

Taylor Alexander
Ohhhh makes sense. Yeah just dropping a QT project into an importer is definitely NOT the way to do this right. I really hope you can get your changes pushed back to the main tree, it sounds like great work!


On Thu, May 16, 2013 at 3:44 AM, Taylor Alexander <[hidden email]> wrote:
And Marcos,
I found it on the emscripten github page, listed under projects that use it. I thought your site might be a year old because I misread something on the firefox nightly page you link to in the "beta warning" text you have on your openscad page (I thought it was stale text referring to a release last august, but I'm dumb).

But the site looks great! I have nearly completely stopped using my printer lately or doing any hobby projects really, but I do want to use something other than Thingiverse. Any chance you could build a thingiverse importer? Actually, if you could migrate my projects from thingiverse to github and then link that on your site I'd be stoked.


On Thu, May 16, 2013 at 3:35 AM, Taylor Alexander <[hidden email]> wrote:
Wait, can OpenSCAD not be operated from a command line without a GUI? I guess I always figured the code would be designed so you could drop in a file and get an STL out if you wanted without having to open a GUI instance.

If it wasn't, those changes to remove the GUI components would be a great step towards cleaning up the libraries so that kind of thing would work, and I imagine that would have many uses.


On Wed, May 15, 2013 at 11:19 PM, marcosscriven <[hidden email]> wrote:
Hi Don

I've chatted with Marius about this - planning to put back the chnages I
made.

But to answer your question it was not trivial. The biggest issues were:

1) Getting GMP, MPFR, Boost, and CGAL all cross-compiled
2) Refactoring many of the OpenSCAD classes to remove anything GUI or Qt
specific
3) Implementing an image-based CSG algorithm from scratch in WebGL
(equilvalent to OpenCSG)

I'm just thinking now how best to get this in.

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4425.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD in the browser (already)

donbright
In reply to this post by marcosscriven
That is amazing. . .  wow.


On Thu, May 16, 2013 at 1:19 AM, marcosscriven <[hidden email]> wrote:
Hi Don

I've chatted with Marius about this - planning to put back the chnages I
made.

But to answer your question it was not trivial. The biggest issues were:

1) Getting GMP, MPFR, Boost, and CGAL all cross-compiled
2) Refactoring many of the OpenSCAD classes to remove anything GUI or Qt
specific
3) Implementing an image-based CSG algorithm from scratch in WebGL
(equilvalent to OpenCSG)

I'm just thinking now how best to get this in.

Marcos



--
View this message in context: http://forum.openscad.org/OpenSCAD-in-the-browser-already-tp4408p4425.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566