Hm interesting info... Hopefully when we switch to python3 all these problems will be gone because the exchange of text between python and Qt is greatly simplified (all python is unicode <-> all qt is exchanged as utf8)microelly2 wrote:The cause for this error seems to be print calls in the code when the script is executed from a Qt Gui.
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
Re: WebGL export
Thanks for confirmation and feedback. Indeed print statements were the issue for me too.microelly2 wrote:The cause for this error seems to be print calls in the code when the script is executed from a Qt Gui.
I had the same problem last days.
Go through the code and deactivate all prints.
I still have no idea to redirect print in such cases.
Hopefully things will sort itself out indeed but just in case i created this "test case":yorik wrote:Hm interesting info... Hopefully when we switch to python3 all these problems will be gone because the exchange of text between python and Qt is greatly simplified (all python is unicode <-> all qt is exchanged as utf8)microelly2 wrote:The cause for this error seems to be print calls in the code when the script is executed from a Qt Gui.
Code: Select all
import sys
from PySide.QtCore import *
from PySide.QtGui import *
class Form(QDialog):
def __init__(self, parent = None):
super(Form, self).__init__(parent)
self.setWindowTitle("My Form")
self.edit = QLineEdit("Write my name here")
self.button = QPushButton("Show Greetings")
layout = QVBoxLayout()
layout.addWidget(self.edit)
layout.addWidget(self.button)
self.setLayout(layout)
self.button.clicked.connect(self.greetings)
def greetings(self):
print ("Hello : " + self.edit.text())
if __name__ == '__main__':
form = Form()
form.show()
https://github.com/jmwright/cadquery-fr ... /issues/63
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: WebGL export
Import/link of community software is necessary but difficult.
Changing the base can cause a lot of problems. Changing to python3 is a big thing, and I thank Yorik to do the hard job to inspect all the code.
To port the 3rd party products will be a task for somebody else ...
I have worked on a lot of php platforms.
In TYPO3 an extensions is killed on a syntax error or a runtime error. There is a good security support
MOODLE (may be it's now better) crashed completely. This was a nightmare for the admin, one error during the time, when a examination of students was running - and you are stoned.
As long as FreeCAD is a standalone program there is no problem.
compile, run the regression tests and when okay you can deliver.
Otherwise debug, make the next test case ..
But Computer Aided Industry is so complex, there cannot be the Singing Ringing Tree.
So how to make the system open and secure?
I think its worth to discuss about this. There should be concepts, how components can communicate in a secure manner. And we should have these concepts running before problems turn up.
I think this is not a specific problem of the cad query module (I have to change my sources too), but in general.
Changing the base can cause a lot of problems. Changing to python3 is a big thing, and I thank Yorik to do the hard job to inspect all the code.
To port the 3rd party products will be a task for somebody else ...
I have worked on a lot of php platforms.
In TYPO3 an extensions is killed on a syntax error or a runtime error. There is a good security support
MOODLE (may be it's now better) crashed completely. This was a nightmare for the admin, one error during the time, when a examination of students was running - and you are stoned.
As long as FreeCAD is a standalone program there is no problem.
compile, run the regression tests and when okay you can deliver.
Otherwise debug, make the next test case ..
But Computer Aided Industry is so complex, there cannot be the Singing Ringing Tree.
So how to make the system open and secure?
I think its worth to discuss about this. There should be concepts, how components can communicate in a secure manner. And we should have these concepts running before problems turn up.
I think this is not a specific problem of the cad query module (I have to change my sources too), but in general.
Re: WebGL export
Yes there is always risk of running any code on the computer. Improving this therefore probably can't be done on technical level in FreeCAD but the code would need to be audited by some trustworthy authority.
But that would probably take substantial amount of work for FreeCAD project developers to audit 3rd Party modules. That probably will remain responsibility of individual users unless in the future FreeCAD project would actually become interested in doing this work for whatever reason involved.
But that would probably take substantial amount of work for FreeCAD project developers to audit 3rd Party modules. That probably will remain responsibility of individual users unless in the future FreeCAD project would actually become interested in doing this work for whatever reason involved.
Re: WebGL export
As a minimum, secure hashes should be generated and checked on all macros and WBs.
Re: WebGL export
It should now be possible to use latest CadQuery module without mentioned issue.microelly2 wrote:The cause for this error seems to be print calls in the code when the script is executed from a Qt Gui.
I had the same problem last days.
Go through the code and deactivate all prints.
I still have no idea to redirect print in such cases.
Re: WebGL export
Just tried the webgl export with FreeCAD.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7569 (Git)
Build type: Release
Branch: master
Hash: f6cdf8b4709baa79fc89e8c24cf8cbfa84d55501
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attached the file I tested with. The html file has lots of lines, but the browserwindow of Firefox keeps staying a white board nothing else ?!?
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7569 (Git)
Build type: Release
Branch: master
Hash: f6cdf8b4709baa79fc89e8c24cf8cbfa84d55501
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attached the file I tested with. The html file has lots of lines, but the browserwindow of Firefox keeps staying a white board nothing else ?!?
- Attachments
-
- test.FCStd
- (103.93 KiB) Downloaded 121 times
Re: WebGL export
Hold right click and drag down your mouse, you will see something
I remember having hard time to get the right view directly from a fresh export, something like moving all geometry far from where it is...
I remember having hard time to get the right view directly from a fresh export, something like moving all geometry far from where it is...
Formations - Assistance - Développement : https://freecad-france.com
Re: WebGL export
Thanks rockn, Ahh yeah we had this allready. Wasn't it because of the way the viewer (and thus scalling and camera view point) is implemented is not optimized to view something huuuuuge like a building ...
- Attachments
-
- webgl.png (76.93 KiB) Viewed 4838 times