[Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
gneiss
Posts: 75
Joined: Tue Mar 05, 2019 4:13 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by gneiss »

OK, hopefully looo will see this and give me a hint...

In the meanwhile I had compiled Freecad.
Giving the instructions from https://wiki.freecadweb.org/Compile_on_Linux it works, even that I had to install a lot of extra (not mentioned there) packages (I compile unter Ubuntu 20.04.4 LTS, that's my fastet PC)
Compilation is done, now I try to understand the structure of the source tree.
Right now I don't see a "global" or "core" python-Module where my function CallExternalExecutable should go.
As I found there must be a Module FreeCAD, because this is imported from OpenSCAD, but there is no such Module-Dir in the src-tree.
There is a FreeCAD.so in the Build (under lib), but I don't now where to place my function so that is will be available inside a python script when "import FreeCAD" was performed.

Any help appreciated.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by Kunda1 »

What's the status of this thread? (...and it's relationship to issue #7182)
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
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by adrianinsaval »

it seems the folk at cfdOF had a similar issue and implemented a workaround in the addon: https://gitlab.com/opensimproject/cfdof ... ss.py#L181
a general solution others can use would be ideal
gneiss
Posts: 75
Joined: Tue Mar 05, 2019 4:13 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by gneiss »

As I mentioned before, I need some help in where to put my global function...
No hint given till now..
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by looo »

to create an AppImage you need to have conda/mamba installed. Best to install mambaforge:

https://github.com/conda-forge/miniforge

then do this steps in the FreeCAD-Bundle repo:

Code: Select all

export DEPLOY_RELEASE=weekly-builds
cd conda/linux
bash create_bundle.sh
hope this helps
gneiss
Posts: 75
Joined: Tue Mar 05, 2019 4:13 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by gneiss »

Sorry, no. As mentioned above, I have no idea where I should place a "global" (python) function..
It seams that freecad base isn't (real) python it's python written in C(++)
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by onekk »

gneiss wrote: Wed Sep 14, 2022 1:32 pm Sorry, no. As mentioned above, I have no idea where I should place a "global" (python) function..
It seams that freecad base isn't (real) python it's python written in C(++)
If you are not aware, there is this section of the wiki:

https://wiki.freecadweb.org/Developer_hub

Where you could find some informations for "developers", probably the best place to start.

In section "Modifying FreeCAD" you will find this page:

https://wiki.freecadweb.org/The_FreeCAD_source_code

That has this sentence.
The FreeCAD code is programmed mainly in C++, but relies heavily on Python.

Hope it helps

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by adrianinsaval »

@wmayer where in the source could a globally available python file be placed?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by wmayer »

What about Ext/freecad? If you put there a file myModule.py you can import with

Code: Select all

from freecad import myModule
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Bug?] AppImage version of FreeCad can't use AppImage of OpenScad (and possible other externals)

Post by onekk »

wmayer wrote: Thu Sep 15, 2022 9:51 am What about Ext/freecad? If you put there a file myModule.py you can import with

Code: Select all

from freecad import myModule
So in my case, with a conda install, the path should be?

/home/username/miniconda3/envs/fcenv-dev/Ext/freecad/

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply