I don't understand the fascination with web based applications. It seems that it is meant to deliver software as a service and lock customers in. Having the program installed locally is better to make sure it is available without restrictions, like truly free software.
Hi, I'm a software engineer too. I've just discovered OnShape and it looks awesome. But the price of $1500 per year is just breathtaking.badmechanic wrote: ↑Sun Aug 30, 2020 2:37 amI'm a software engineer and hobby CAD user. I currently used OnShape exclusively but don't like the closed source nature. There is no way for me to add certain features myself, like the ability to rename multiple parts at once.
Anyway, I know this has been discussed before, but I didn't find a very SWE-focused discussion. Is FreeCAD's architecture suitable for writing a web-based frontend? Is there a summary of the design of the software, data model, parametric solver, etc?
I'm particularly curious about the data model used by FreeCAD vs the data model described by OnShape here: https://onshape-public.github.io/docs/a ... data-model.
One day something like FreeCAD should rule the CAD world. If you look at the programming landscape, we benefit a lot from open source editors and tools. I suspect CAD will, too. To get there, I think a web interface is table stakes.
No, there's no distinction between frontend and backend. Both Python and C++ can be used to develop both UI and the Object model.
Code: Select all
import sys sys.path = # FreeCAD*.so dirs or setup using PYTHONPATH variable from PySide2.QtWidgets import QApplication import FreeCADGui app = QApplication(sys.argv) FreeCADGui.showMainWindow(True) sys.exit(app.exec_())
This is an Electron app which is based on a web browser (chromium). I'm pretty sure it uses a web server. The source code references Google App Engine, which is a platform to create web servers.garlicbread wrote: ↑Wed Sep 16, 2020 12:09 amTypically these days for User Interfaces web based stuff seems to be the way to go
But it doesn't need to be sitting on a web-server or browsed via a web-browser it can be made to look just like a normal application
(for an example of what I mean see - https://github.com/jgraph/drawio-desktop/releases)
Yes, Qt WebEngine is the easiest to do.garlicbread wrote: ↑Wed Sep 16, 2020 12:09 am
CefPython / Eel
One of the biggest challenges though if the whole UI was replaced would be implementing Cad related functionality such as the sketcher
So a better approach might be to try and do parts of if piecemeal using the QT Webengine
If you ever decided to try and replace the QT GUI Frontend completely then one idea would be Eel or cefpython
I think Eel just launches Chrome in application mode for the UI
where cefpython instead uses the same cef library that chrome uses and is more of a standalone app approach.
Electron tends to be a bit of a memory hog by comparison.
just because it's type safe and prevents things like randomly assigning an integer to a string property in a class etc
It also supports prototyping and has more of a object orientated feel to it similar to other languages.
This should not be an issue. FreeCAD is not AGPL, so if you introduce a http/websocket API you can use whatever license you want.
I think it's too early to consider UI libs. You need to define an architecture first. Then work on POC. Then find somebody to collaborate with.
Yes I agree you'd need to run a minimal web servervanuan wrote: ↑Wed Sep 16, 2020 7:24 amFrom here, you can either use Qt's web capabilities or run a separate binary with a browser or use some python bindings for a browser.
In any case, you need html/js/css served from somewhere. I suggest starting a local web server.
You also need a way to call functions, retrieve and upload data to the FreeCAD document object model. I suggest using a local web server for that as well.
This is true, I was just trying to highlight that it wouldn't need to be just in a web browser like with onshape.
Ok that's good to know, I wasn't sure if there would be licence implications if you're using web libs from freecad
That looks interesting I like the look ofvanuan wrote: ↑Wed Sep 16, 2020 7:24 amI think it's too early to consider UI libs. You need to define an architecture first. Then work on POC. Then find somebody to collaborate with.
The simplest POC would be WebGL export. Some people already tried: https://forum.freecadweb.org/viewtopic. ... &start=120
Another interesting approach: