I am not a Linux expert, but it seems that the bundled version of topologic is not compatible with your system. If you can get your hands on a compiled and compatible version of topologic for Linux (eg from homemaker) just drop it in the bin/Linux/topologic folder inside topologicpy
@brunopostle said: @paullee I'm>
...
my rpms of blenderbim and topologic use the system python. freecad downloads come with their own python interpreter (like blender), surely?
Thanks :D
This is FC 0.20 screencapture -
Below
is FC 0.21 screencapture -
To my understanding -
Python 3.9 is in FC 0.20
Python 3.10 is in FC 0.21_pre
Yes it is working on FC 0.20 (importing 3.10 topologicpy in 3.9 python console) :-
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:07:55)
[GCC 10.3.0] on linux
Type 'help', 'copyright', 'credits' or 'license' for more information.
sys.path.append("/home/paullee/.local/lib/python3.10/site-packages")
import topologicpy
from topologicpy.Vertex import Vertex
v = Vertex.ByCoordinates(10,20,30)
print(v)
@paullee Atleast it works under FC 0.20. It doesn’t matter if topologicpy was installed under python 3.10 because topologic has .pyd files for python 3.7 3.8 3.9 and 3.10
Hi @paullee. I’m not an expert in Linux but my suspicion (or unfounded theory) is that on windows, the build process for topologic includes a name mangling step for the needed libraries, but on Linux, judging by your screenshot, the file names are not changed so they conflict with FC. To confirm, is it possible that you or others test topologicpy with the latest FC on windows? I would test it myself, but I am sadly very busy this period as classes are about to start.
With the latest topologicpy installed by pip install topologicpy and run on FreeCAD 0.21 on Fedora 38, a method (x.String()) previously worked in below quoted example / post no longer works, haven't found the solution yet, @topologic or anybody has idea?
Thanks :)
Below runs in FreeCAD python console :
sys.path.append("/home/paullee/.local/lib/python3.11/site-packages")
import topologicpy as topologic
(remarks) 2 boxes / cubes for example
s=Gui.Selection.getSelection()
c1 = s[0]
c2 = s[1]
tc1 = topologic.Topology.ByString(c1.Shape.exportBrepToString())
tc2 = topologic.Topology.ByString(c2.Shape.exportBrepToString())
tc3 = tc1.Merge(tc2)
print(tc3)
... <topologic.CellComplex object at 0x7f9f56aac430>
shp3 = Part.Shape()
shp3.importBrepFromString(tc3.String())
That 'tc3.String()', used to work, now returns error :
Traceback (most recent call last):
File "", line 1, in
TypeError: String(): incompatible function arguments. The following argument types are supported:
1. (self: topologic.Topology, rkVersion: int) -> str
Invoked with: <topologic.CellComplex object at 0x7f9f56aac670>
In general, please try to move away from topologic methods and instead use topologicpy methods which are far better documented. So instead of myTopology.String() please use:
from topologicpy.Topology import Topology
brepString = Topology.BREPString(myTopology)
@topologic said:
In general, please try to move away from topologic methods and instead use topologicpy methods which are far better documented. So instead of myTopology.String() please use:
from topologicpy.Topology import Topology
brepString = Topology.BREPString(myTopology)
@paullee said: @topologic
If I just want to from the 'external edges' from a set of connecting Faces (Shell?) e.g. below screencapture, any way to do it?
6 'external edges',
1 'internal edge'
Thanks again for any hints :)
If you have a Shell, then:
from topologicpy.Shell import Shell
from topologicpy.Topology import Topology
myBoundary = Shell.ExternalBoundary(myShell)
myEdges = Topology.Edges(myBoundary)
Hmmm... the question becomes - how to 'export' OCCTShape in FreeCAD?
Sadly these methods are not well-tested and this is why they have been hidden. Instead, please use the BREP string as the standard way to communicate between FreeCAD and topologicpy (Note, I think I found a typo that is making Topology.BREPString and Topology.ByBREPString not work. I think I solved it, but I am still testing and investigating. If the following code doesn't work for you, please contact me privately or put an issue on github. This forum is supposed to be for general discussion, but I worry we are going into bugs and tracking which is best done on github. In any case, to convert a FreeCAD object to topologic:
1. Select the object that you want to convert to a topology in topologic
2. This assumes that topologicpy module can be found already and is functional
Thanks, no worry, shape.exportBrepToString() route works. Just note there maybe OCCTShape route and see if FreeCAD and Topologic speaks and communicate in 'native language'. Any my bad, would use github to discuss as necessary.
Based on the idea of HomeMaker-Topologic, created a short script on FreeCAD.
In FreeCAD :
Make a single-line Sketch of a building layout, run the script (Topologic-Homemaker like)
(On 2nd Gen i3, it needs 10s)
You get the wall, slabs, roof, windows on external walls
(Just proof of concept at the moment)
Q :
Wondering how to identify a wall access from a corridor to automatically place a door, from a common wall which divides a room from another (thus not placing a walldoor by the script) ?
Comments
@paullee topologicpy works perfectly well in FreeCAD 0.20 on Windows. Here is what I did to make it work:
10 20 30

Hmmm, searched on my Fedora 36 and seems found it under .local/lib/python3.10/site-packages ...
I am not a Linux expert, but it seems that the bundled version of topologic is not compatible with your system. If you can get your hands on a compiled and compatible version of topologic for Linux (eg from homemaker) just drop it in the bin/Linux/topologic folder inside topologicpy
One test would be to delete the files in bin/linux/topologic and try again. It might find the one you got working from homemaker
It seems:-
FC_0.20, with Python 3.9 + Brunopostle's packages for Fedora 36
= import topologic : OK
FC_0.21_pre, with Python 3.10 + Brunopostle's packages for Fedora 36
= import topologic : Not OK
= import topologicpy : Not OK
What about import topologicpy with FC_0.20 with Python 3.9?
@paullee I'm> @paullee said:
my rpms of blenderbim and topologic use the system python. freecad downloads come with their own python interpreter (like blender), surely?
It is not supposed to work - as it seems installed under python 3.10 ?
However in FC 0.20 python console (using 3.9 python version), forcing it to look into python 3.10 location :-
No Vertex etc. directly under topologicpy, but under topologicpy.topologic ....
Thanks :D

This is FC 0.20 screencapture -
Below

is FC 0.21 screencapture -
To my understanding -
Python 3.9 is in FC 0.20
Python 3.10 is in FC 0.21_pre
@paullee did you try
import topologicpy
from topologicpy.Vertex import Vertex
v = Vertex.ByCoordinates(10,20,30)
print(v)
Yes it is working on FC 0.20 (importing 3.10 topologicpy in 3.9 python console) :-
@paullee Atleast it works under FC 0.20. It doesn’t matter if topologicpy was installed under python 3.10 because topologic has .pyd files for python 3.7 3.8 3.9 and 3.10
This .local directory seems to be containing what are installed with "pip install topologicpy" :-
Noted some difference between FreeCAD 0.20 and 0.21_pre, particularly OCC :-
Would it be the difference in OCC make topologic not working in FreeCAD 0.21_pre ?
@topologic FreeCAD has its formal release 0.21.1 available, development of 0.22 (or 1.0) is in the progress :D
Any idea topologicpy is upgraded and tested to make it works in the latest version?
Thanks for your advice in advance.
Hi @paullee. I’m not an expert in Linux but my suspicion (or unfounded theory) is that on windows, the build process for topologic includes a name mangling step for the needed libraries, but on Linux, judging by your screenshot, the file names are not changed so they conflict with FC. To confirm, is it possible that you or others test topologicpy with the latest FC on windows? I would test it myself, but I am sadly very busy this period as classes are about to start.
Thanks @topologic I could test again the latest topologipy / FC on Fedora 38.
But I do not use have Windows on my PCs. I'll see if I can have access to one to test. Or some more peoples can help to test :)
Hope everbody has more resources and spare time :D
@topologic Good news :)
I do not know how, but now below combination works !
Thanks !
With the latest topologicpy installed by pip install topologicpy and run on FreeCAD 0.21 on Fedora 38, a method (x.String()) previously worked in below quoted example / post no longer works, haven't found the solution yet, @topologic or anybody has idea?
Thanks :)
Below runs in FreeCAD python console :
That 'tc3.String()', used to work, now returns error :
If you are using the latest version of topologicpy, Topology.String and Topology.ByString are now deprecated. Please try Topology.BREPString and Topology.ByBREPString
https://topologic.app/topologicpy_doc/topologic_pdoc/Topology.html
In general, please try to move away from topologic methods and instead use topologicpy methods which are far better documented. So instead of myTopology.String() please use:
from topologicpy.Topology import Topology
brepString = Topology.BREPString(myTopology)
Thanks, it seems working :D
@topologic
If I just want to from the 'external edges' from a set of connecting Faces (Shell?) e.g. below screencapture, any way to do it?
Thanks again for any hints :)
If you have a Shell, then:
from topologicpy.Shell import Shell
from topologicpy.Topology import Topology
myBoundary = Shell.ExternalBoundary(myShell)
myEdges = Topology.Edges(myBoundary)
This is really a good document, there is python source code directly below every method, very easy to understand :)
Thanks !
EDIT - It's bit difficult to find from the website main page, maybe add a link in https://topologic.app/learning/ ?
Yes. Been meaning to do that, but never got around to it. Will do soon. Thanks!
Noted there is a few method about OCCTShape and want to try, but it seems it is not presented. Deprecated ?
Thanks.
https://topologic.app/topologicpy_doc/topologic_pdoc/Topology.html#Topology.Topology.OCCTShape
https://topologic.app/topologicpy_doc/topologic_pdoc/Topology.html#Topology.Topology.ByOCCTShape
EDIT - Oops, too soon to create noise, found, 2nd screencapture :D
Hmmm... the question becomes - how to 'export' OCCTShape in FreeCAD?
Hi @paullee,
You wrote:
Sadly these methods are not well-tested and this is why they have been hidden. Instead, please use the BREP string as the standard way to communicate between FreeCAD and topologicpy (Note, I think I found a typo that is making Topology.BREPString and Topology.ByBREPString not work. I think I solved it, but I am still testing and investigating. If the following code doesn't work for you, please contact me privately or put an issue on github. This forum is supposed to be for general discussion, but I worry we are going into bugs and tracking which is best done on github. In any case, to convert a FreeCAD object to topologic:
1. Select the object that you want to convert to a topology in topologic
2. This assumes that topologicpy module can be found already and is functional
Thanks, no worry, shape.exportBrepToString() route works. Just note there maybe OCCTShape route and see if FreeCAD and Topologic speaks and communicate in 'native language'. Any my bad, would use github to discuss as necessary.
Thanks for creating and maintaining Topologic !
Based on the idea of HomeMaker-Topologic, created a short script on FreeCAD.
In FreeCAD :
Make a single-line Sketch of a building layout, run the script (Topologic-Homemaker like)
(On 2nd Gen i3, it needs 10s)
You get the wall, slabs, roof, windows on external walls
(Just proof of concept at the moment)
Q :
Thanks :)