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!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: WebGL export

Post by bernd »

Attached an webgl building export I'm dreaming to do with FreeCAD one day. http://www.b75.ch/webgl/biberstein/
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: WebGL export

Post by yorik »

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

Re: WebGL export

Post by bernd »

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
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: WebGL export

Post by microartisan »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: WebGL export

Post by Kunda1 »

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
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: WebGL export

Post by Kunda1 »

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
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: WebGL export

Post by yorik »

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
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: WebGL export

Post by paullee »

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: 4
Joined: Sun Apr 26, 2020 9:57 pm

Re: WebGL export

Post by mwhaap »

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: 32
Joined: Fri Jul 31, 2020 1:19 pm

Re: WebGL export

Post by xryl669 »

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.
Post Reply