WebGL export
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: WebGL export
I have too say, that web "counterpart" of bolts is really impressive.. Not many projects have such a solid online side...
-
- Posts: 329
- Joined: Mon Sep 09, 2013 6:08 pm
Re: WebGL export
It is not so difficult once you have everything in machine-readable form. And for example for OpenSCAD it is really necessary to have documentation, as there is no GUI that offers you choices.
The website is another field where I need to invest some more time at some point. At the moment it is a bit hacky, with a two stage template process: First BOLTS fills in some data into templates to create templates that get then layouted by Jekyll. It works, but is quite cumbersome.
The website is another field where I need to invest some more time at some point. At the moment it is a bit hacky, with a two stage template process: First BOLTS fills in some data into templates to create templates that get then layouted by Jekyll. It works, but is quite cumbersome.
Re: WebGL export
Just perfect ! Thank you.
Formations - Assistance - Développement : https://freecad-france.com
Re: WebGL export
The OpenSCAD guys are planning to support the 'customizer' parametrization.jreinhardt wrote:And for example for OpenSCAD it is really necessary to have documentation, as there is no GUI that offers you choices.
https://github.com/openscad/openscad/wi ... er-support
Re: WebGL export
+1 And it gets better and better and there are still ideas around so even more better . But on the other side a OpenSource CAD Framwork needs a smart OpenSource part library.yorik wrote:I have too say, that web "counterpart" of bolts is really impressive.. Not many projects have such a solid online side...
-
- Posts: 329
- Joined: Mon Sep 09, 2013 6:08 pm
Re: WebGL export
https://github.com/jreinhardt/FreeCAD_s ... tree/webgl
contains a small feature and a fix. The feature is to allow selection of the line width using
and the fix is for correctly treating non-straight edges in faceloop mode.
contains a small feature and a fix. The feature is to allow selection of the line width using
Code: Select all
importWebGL.linewidth = 5
Re: WebGL export
I merged your change, very useful, thanks!!
Re: WebGL export
Hello,
I get something wrong with the webgl exporter, it make too big file :/ I saw this when it make me a 350Mo html file
A simplest beam (100x200x1000 mmm) make a 9.7Mo file with this version :
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3488 (Git)
Branch: master
Hash: 147976515460de19bdf541d7d8de17c39b3a4bc7
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1
There is more than 100000 line and the most are like this :
It make just a 10 ko file. With a old version :
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3374 (Git)
Branch: master
Hash: fabe39b976a1456b70cf9da0c91bdb530e7e94d7
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1
Have you got the same problem ?
I get something wrong with the webgl exporter, it make too big file :/ I saw this when it make me a 350Mo html file
A simplest beam (100x200x1000 mmm) make a 9.7Mo file with this version :
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3488 (Git)
Branch: master
Hash: 147976515460de19bdf541d7d8de17c39b3a4bc7
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1
There is more than 100000 line and the most are like this :
Code: Select all
var wire = new THREE.Geometry();
wire.vertices.push(new THREE.Vector3(-0.493266880512, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(-0.393266880512, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(-0.293266880512, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(-0.193266880512, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(-0.093266880512, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.006733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.106733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.206733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.306733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.406733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.506733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.606733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.706733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.806733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(0.906733119488, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(1.00673311949, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(1.10673311949, -49.7647999972, -100.0));
wire.vertices.push(new THREE.Vector3(1.20673311949, -49.7647999972, -100.0));
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3374 (Git)
Branch: master
Hash: fabe39b976a1456b70cf9da0c91bdb530e7e94d7
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1
Have you got the same problem ?
Formations - Assistance - Développement : https://freecad-france.com
-
- Posts: 329
- Joined: Mon Sep 09, 2013 6:08 pm
Re: WebGL export
Yes, I noticed that too yesterday. I guess I broke it with my "fix" for nonstraight edges. I will investigate.
-
- Posts: 329
- Joined: Mon Sep 09, 2013 6:08 pm
Re: WebGL export
I found the problem. The documentation string of Wire.discretize was wrong. This function can either be called with an integer or with a float. If called with an integer, this is interpreted as the number of vertices for the approximation. The docstring claims that a float is interpreted as the deflection of the discretization. The implementation however produces points that are uniformly spaced, which lead to a huge number of points for parts with long, straight lines.
In my webgl branch (https://github.com/jreinhardt/FreeCAD_s ... tree/webgl) I changed the implementation of Wire.discretize to be consistent with the docstring. This considerably reduces the filesize of the produces files. I tested with cylinders of size r x h and this is the result:
217469 -> 47080 10x10
222983 -> 43981 10x20
902408 -> 23600 1x1000
41702 -> 22805 1x10
54558 -> 43379 1x1
One little annoyance remains, namely that every edge is traced twice, once for each adjacent face. However, I believe that this is not easily fixed.
In my webgl branch (https://github.com/jreinhardt/FreeCAD_s ... tree/webgl) I changed the implementation of Wire.discretize to be consistent with the docstring. This considerably reduces the filesize of the produces files. I tested with cylinders of size r x h and this is the result:
217469 -> 47080 10x10
222983 -> 43981 10x20
902408 -> 23600 1x1000
41702 -> 22805 1x10
54558 -> 43379 1x1
One little annoyance remains, namely that every edge is traced twice, once for each adjacent face. However, I believe that this is not easily fixed.