WebGL export

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
User avatar
bernd
Posts: 10527
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: WebGL export

Postby bernd » Wed Jan 04, 2017 7:50 pm

Attached an webgl building export I'm dreaming to do with FreeCAD one day. http://www.b75.ch/webgl/biberstein/
User avatar
yorik
Site Admin
Posts: 11978
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: WebGL export

Postby yorik » Thu Jan 05, 2017 12:21 am

intersting... this seems to be produced with ifc++?
User avatar
bernd
Posts: 10527
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: WebGL export

Postby bernd » Thu Jan 05, 2017 5:53 am

yorik wrote:intersting... this seems to be produced with ifc++?
Yes with closed source free Windows version of ifc++

But may be BIM Surfer and BIM Server will do the job too. There has been lots of development in BIM Surfer lately. https://github.com/opensourceBIM/BIMsurfer
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: WebGL export

Postby microartisan » Sun Apr 01, 2018 7:52 pm

I find a bug also :)

https://www.freecadweb.org/tracker/view.php?id=3418

I build a simple box ant export to html , it can not open by browser.

Code: Select all

geom.faces.push( new THREE.Face3(0L, 1L, 2L) );
                geom.faces.push( new THREE.Face3(3L, 1L, 0L) );
                geom.faces.push( new THREE.Face3(4L, 5L, 6L) );
                geom.faces.push( new THREE.Face3(4L, 7L, 5L) );
                geom.faces.push( new THREE.Face3(7L, 4L, 3L) );
                geom.faces.push( new THREE.Face3(3L, 4L, 1L) );
                geom.faces.push( new THREE.Face3(6L, 5L, 0L) );
                geom.faces.push( new THREE.Face3(6L, 0L, 2L) );
                geom.faces.push( new THREE.Face3(0L, 5L, 3L) );
                geom.faces.push( new THREE.Face3(3L, 5L, 7L) );
                geom.faces.push( new THREE.Face3(6L, 2L, 1L) );
                geom.faces.push( new THREE.Face3(6L, 1L, 4L) );
then I change to

Code: Select all

THREE.Face3(3, 5, 7)
it works.
Last edited by microartisan on Mon Apr 02, 2018 5:04 am, edited 1 time in total.
User avatar
Kunda1
Posts: 7679
Joined: Thu Jan 05, 2017 9:03 pm

Re: WebGL export

Postby Kunda1 » Mon Apr 02, 2018 12:33 am

microartisan wrote:
Sun Apr 01, 2018 7:52 pm
I find a bug also :)
Please add the ticket number that you opened in the tracker for this here in the forum and add the link to this thread in the ticket. Thanks
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 7679
Joined: Thu Jan 05, 2017 9:03 pm

Re: WebGL export

Postby Kunda1 » Mon Apr 02, 2018 10:42 am

microartisan wrote:
Sun Apr 01, 2018 7:52 pm
yorik wrote:
@microartisan aka mahaidong (on the tracker) has offered a proposed fix in issue #3418
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
yorik
Site Admin
Posts: 11978
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: WebGL export

Postby yorik » Mon Apr 02, 2018 4:46 pm

Kunda1 wrote:
Mon Apr 02, 2018 10:42 am
@microartisan aka mahaidong (on the tracker) has offered a proposed fix in issue #3418
Added, thanks for the fix!
paullee
Posts: 2502
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Postby paullee » Mon Dec 03, 2018 3:21 pm

There is a discussion about Collaborative CAD Platform not sure is there something related
- supported by Three.js, show model by uploading FC file.

https://forum.freecadweb.org/viewtopic.php?f=8&t=32521
mwhaap
Posts: 2
Joined: Sun Apr 26, 2020 9:57 pm

Re: WebGL export

Postby mwhaap » Tue Apr 28, 2020 4:17 pm

I am trying to incorporate repeated and if possible rapid exports of a FreeCAD model into a Three.js canvas component of a React web app. I read that WebGL export utilizes Three.js so I think this must be possible. I know this is less portable than the WebGL export this thread is focused on but it could allow for more full control and interaction with the model through interactive React/Three.js widgets etc. Any suggestions on how to implement my FreeCAD/Three.js/React component idea would be greatly appreciated.
xryl669
Posts: 5
Joined: Fri Jul 31, 2020 1:19 pm

Re: WebGL export

Postby xryl669 » Fri Jul 31, 2020 3:38 pm

FWIW, there a step by step tutorial to export a FreeCAD document as STEP then convert it to GLTF and use a GLTF explorer to display it here

It gives this kind of output.