[Topologic] Redefining BIM through Spatial Topology, Information, and Grammars

1181921232426

Comments

  • edited March 2022

    Oh it works as you says!
    [paullee@fedora topologic]$ python
    Python 3.9.10 (main, Jan 17 2022, 00:00:00)
    [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux

    import topologic
    topologic.Vertex.ByCoordinates(10,20,30)

    <topologic.Vertex object at 0x7f4c6f0aa430>

    What OCC version topologic is using? I am using AppImage version of FreeCAD, so maybe I need to find same version of OCC first, and check github later then. Thanks again pointing out the direction :D

  • On Windows, I standardised on 7.4.2 But I believe the Linux version is compiled and given to me by @brunopostle I think it is 7.5.3 (he can confirm). I will try to build and link to a new version? What is the version that FreeCAD uses on Linux and on Windows? and what python? Perhaps I should aim to release a binary specific to FreeCAD.

    paullee
  • Please try the following:
    1. Make a note of the path to the topologic site-packages folder. I will call that topologicPath for now. Replace below with the actual path. Keep the double quotes.
    2. Start FreeCAD
    3. In FreeCAD’s own python console type the following:
    import sys
    sys.path.append(“topologicPath”)
    import topologic
    v = topologic.Vertex.ByCoordinates(10,20,30)
    print(v)

    Does the above work??

    paullee
  • @topologic said:
    On Windows, I standardised on 7.4.2 But I believe the Linux version is compiled and given to me by @brunopostle I think it is 7.5.3 (he can confirm). I will try to build and link to a new version? What is the version that FreeCAD uses on Linux and on Windows? and what python? Perhaps I should aim to release a binary specific to FreeCAD.

    I only use AppImage version of FreeCAD on Linux
    -
    Python version: 3.9.10
    ...
    OCC version: 7.5.0

  • @topologic said:
    Please try the following:
    1. Make a note of the path to the topologic site-packages folder. I will call that topologicPath for now. Replace below with the actual path. Keep the double quotes.
    2. Start FreeCAD
    3. In FreeCAD’s own python console type the following:
    import sys
    sys.path.append(“topologicPath”)
    import topologic
    v = topologic.Vertex.ByCoordinates(10,20,30)
    print(v)

    Does the above work??

    On the move, will try soon, many thanks for the instructions again !

  • @topologic said:
    On Windows, I standardised on 7.4.2 But I believe the Linux version is compiled and given to me by @brunopostle I think it is 7.5.3 (he can confirm).

    These portable Linux binaries of Topologic are built with opencascade 7.4.0

    paulleetopologic
  • @brunopostle said:

    @topologic said:
    On Windows, I standardised on 7.4.2 But I believe the Linux version is compiled and given to me by @brunopostle I think it is 7.5.3 (he can confirm).

    These portable Linux binaries of Topologic are built with opencascade 7.4.0

    That explains it then I think. I just successfully built Topologic on Windows with opencascade 7.5.0

  • Note that for fedora (34, 35 & 36) I have built rpm packages of Topologic (and IfcOpenShell/blenderbim), these are linked with the system opencascade (which is currently 7.5.0 on fedora).

    On my fedora 35 system with these packages installed, I can just import topologic in the FreeCAD python console

    topologicpaullee
  • ..also on fedora, there is a FreeCAD Nightly repository. Again this is linked with the standard system libraries so there are no python or opencascade conflicts

    topologicpaullee
  • @topologic said:
    Please try the following:
    1. Make a note of the path to the topologic site-packages folder. I will call that topologicPath for now. Replace below with the actual path. Keep the double quotes.
    2. Start FreeCAD
    3. In FreeCAD’s own python console type the following:
    import sys
    sys.path.append(“topologicPath”)
    import topologic
    v = topologic.Vertex.ByCoordinates(10,20,30)
    print(v)

    Does the above work??

    Tested, it is not working, failed similarly as if I make a Link to FreeCAD/usr/Mod :)

  • @paullee sorry not sure the path is correct. Can you please try one more time without the topologic at the end of the path. Just stop at site-packages. Regardless, I think what @brunopostle suggests is the correct solution: to use FreeCAD as downloaded from the nightly repository.

  • @topologic said:
    @paullee sorry not sure the path is correct. Can you please try one more time without the topologic at the end of the path. Just stop at site-packages. Regardless, I think what @brunopostle suggests is the correct solution: to use FreeCAD as downloaded from the nightly repository.

    Now, some new message which seem more useful :)

    import sys
    sys.path.append("/home/paullee/Downloads/brunopostle_ifcopenshell_topologicPy/usr/lib/python3.9/site-packages/")
    import topologic
    Traceback (most recent call last):
    File "", line 1, in
    File "/home/paullee/Downloads/brunopostle_ifcopenshell_topologicPy/usr/lib/python3.9/site-packages/topologic/init.py", line 54, in
    import cppyy
    ModuleNotFoundError: No module named 'cppyy'

  • @paullee Topologic stopped using cppyy a few months ago, your Topologic is out of date

  • edited March 2022

    paullee
  • @paullee said:
    I downloaded the topologicsverchok, unzip, and find the /site-packages/topologic folder and create link in the FreeCAD/usr/Mod/ folder.

    Hmmm, this is where I downloaded the Linux package.

  • @paullee said:

    @paullee said:
    I downloaded the topologicsverchok, unzip, and find the /site-packages/topologic folder and create link in the FreeCAD/usr/Mod/ folder.

    Hmmm, this is where I downloaded the Linux package.

    Either I accidentally placed the wrong binary in there or you have an old version of Topologic lurking in your standard paths. Do a sweep of python paths and remove any old topologic remnants.

    paullee
  • edited March 2022

    There should be something wrong in my information above.
    Anyway, tested as shown below again, seem topologic is imported but without any methods ? :-

    sys.path.append("/home/paullee/Downloads/topologicsverchok-2022-03-18-linux-x86_64/topologicsverchok/site-packages")

    import topologic
    topologic.Vertex.ByCoordinates(10,20,30)
    Traceback (most recent call last):
    File "", line 1, in
    AttributeError: module 'topologic' has no attribute 'Vertex'

    Dir() return -

    dir(topologic)
    ['doc', 'file', 'loader', 'name', 'package', 'path', 'spec']

  • edited March 2022

    @paullee I have to do:

    from topologic import Vertex
    
  • @brunopostle said:
    @paullee I have to do:

    from Topologic import Vertex
    

    That won’t work either. It will still say Vertex not found. I have seen this error before. It means the python module was loaded but none of the bindings. So it is an empty module. Please get the topologic python module from Bruno’s fork. He tests it on Linux far more than I do, but my aim is to see if I can create the portable binaries on Linux using opencascade 7.5.0 so you can use those. Stay tuned and thanks for your patience.

    paullee
  • Strange that it works in a shell :)

  • @brunopostle said:
    Note that for fedora (34, 35 & 36) I have built rpm packages of Topologic (and IfcOpenShell/blenderbim), these are linked with the system opencascade (which is currently 7.5.0 on fedora).

    I searched and downloaded python3-topologicPy-0.5-0.1.20210615git.fc34.noarch .rpm (can't find again from where I downloaded).

    Can't find inside something similar to what are inside the topologicsverchok-2022-03-18-linux-x86_64.zip.

    Any idea what should I be searching for ? Thanks :)

  • edited March 2022

    @paullee said:

    I searched and downloaded python3-topologicPy-0.5-0.1.20210615git.fc34.noarch .rpm (can't find again from where I downloaded).

    Can't find inside something similar to what are inside the topologicsverchok-2022-03-18-linux-x86_64.zip.

    This is an old cppyy version, you need the Topologic and Topologic-python3 packages: https://copr.fedorainfracloud.org/coprs/bpostle/IfcOpenShell/package/Topologic/

    topologicpaullee
  • @brunopostle said:

    @paullee said:

    I searched and downloaded python3-topologicPy-0.5-0.1.20210615git.fc34.noarch .rpm (can't find again from where I downloaded).

    Can't find inside something similar to what are inside the topologicsverchok-2022-03-18-linux-x86_64.zip.

    This is an old cppyy version, you need the Topologic and Topologic-python3 packages: https://copr.fedorainfracloud.org/coprs/bpostle/IfcOpenShell/package/Topologic/

    @brunopostle Is it possible to remove that obsolete file from 2021 so others don’t fall into that problem? Thanks

  • @brunopostle said:
    This is an old cppyy version, you need the Topologic and Topologic-python3 packages: https://copr.fedorainfracloud.org/coprs/bpostle/IfcOpenShell/package/Topologic/

    I am not familiar with Fedora copr, seems there are a few directory with none content ?

    Nothing for Fedora 34 ?

    This is for Fedora 33 right ?

  • OK, finally with the Fedora33 package running on Fedora 34 :D

    topologic
  • Now this is fun :D

    Searching around to look for explanation on topologic methods, any idea ? (? https://topologic.app/learning/) Thanks

    topologic
  • The following is woefully out of date, but might give you some hints on how to start and then you can look at the python code classes for TopologicSverchok to glean what the methods should be. We need volunteers to document the API!
    https://topologic.app/developer_doc/html/

    paullee
  • @paullee said:

    I am not familiar with Fedora copr, seems there are a few directory with none content ?

    Basically, it is a 'package repository' in addition to the default fedora repositories, so it isn't intended for direct download, enable it like this:

    dnf copr enable bpostle/IfcOpenShell 
    

    After this, for example, you can install the IfcOpenShell-blenderbim package using the fedora software centre, this will pull-in all dependencies (including blender if you don't already have it installed), and will upgrade to the latest version each time you do a system update.

    Similarly, with the repository enabled, you can install Topologic-python3 just like any other default fedora package. The intention is to create a blender-Homemaker-addon package too, but I haven't gotten around to it.

    paullee
  • Anyone works purely on python mode of topologic? :D

    I watched a few YT video on Sverchok-Topologic and Doxygen output of API, but can't understand how it works. I work on FreeCAD python console, and for example trying to export the Brep representation of solid compound and importing into Topologic object, finding which faces are 'external' or 'internal'. Any idea ? Thanks !

    cc=Gui.Selection.getSelection()[0]
    built-in method exportBrepToString of Part.Compound object at 0x55e3ea99d498

    ccbs=cc.Shape.exportBrepToString()
    ccbs
    '\nCASCADE Topology V1, (c) Matra-Datavision\nLocations 7\n1\n 1 0 0 0 \n 0 1 0 0 \n 0 0 1 0 \n1\n 1 0 0 0 \n 0 1 0 0 \n 0 0 1 0 \n1\n 1 0 0 0 \n 0 1 0 0 \n 0 0 1 3000 \n2 2 1 3 1 0\n1\n 1 0 0 0 \n 0 1 0 0 \n 0 0 1 0 \n1\n 1 0 0 0 \n 0 1 0 0 \n 0 0 1 3000 \n2 5 1 6 1 0\nCurve2ds 0\nCurves 13\n1 0 2500 0 0 0 1 \n1 0 0 0 0 0 1 \n1 0 2500 0 0 -1 0 \n1 2417.8812109999999 2500 0 0 0 1 \n1 5000 2500 0 -1 0 0 \n1 2918.5437010000001 0 0 0 0 1 \n1 2918.5437010000001 0 0 -0.19636597175974246 0.9805306752645998 0 \n1 0 0 0 1 0 0 \n1 2918.5437010000001 0 0 0 0 1 \n1 2417.8812109999999 2500 0 0 0 1 \n1 5000 2500 0 0 0 1 \n1 5000 0 0 0 0 1 \n1 5000 0 0 0 1 0 \nPolygon3D 0\nPolygonOnTriangulations 0\nSurfaces 9\n1 0 2500 0 1 0 -0 0 -1 0 0 -0 -1 \n1 2417.8812109999999 2500 0 0 -1 0 -1 0 0 -0 -0 -1 \n1 2918.5437010000001 0 0 -0.9805306752645998 -0.19636597175974246 0 -0.19636597175974246 0.9805306752645998 0 -0 0 -1 \n1 0 0 0 0 1 0 1 0 0 0 0 -1 \n1 -5000 -5000 0 0 0 1 1 0 -0 -0 1 0 \n1 2918.5437010000001 0 0 -0.9805306752645998 -0.19636597175974246 0 -0.19636597175974246 0.9805306752645998 0 -0 0 -1 \n1 5000 2500 0 0 -1 0 -1 0 0 -0 -0 -1 \n1 5000 0 0 -1 0 0 0 1 0 0 0 -1 \n1 2918.5437010000001 0 0 0 1 0 1 0 0 0 0 -1 \nTriangulations 0\n\nTShapes 46\nVe\n1e-07\n0 2500 0\n0 0\n\n0101101\n\nEd\n 1e-07 1 1 0\n1 1 0 0 3000\n0\n\n0101000\n+46 2 -46 4 *\nVe\n1e-07\n0 0 0\n0 0\n\n0101101\n\nEd\n 1e-07 1 1 0\n1 2 0 0 3000\n0\n\n0101000\n+44 2 -44 4 \nEd\n 1e-07 1 1 0\n1 3 0 0 2500\n0\n\n0101000\n+46 0 -44 0 *\nWi\n\n0101100\n+45 0 -43 0 -42 2 +42 4 *\nFa\n0 1e-07 1 0\n\n0101000\n+41 0 *\nVe\n1e-07\n2417.881211 2500 0\n0 0\n\n0101101\n\nEd\n 1e-07 1 1 0\n1 4 0 0 3000\n0\n\n0101000\n+39 2 -39 4 \nEd\n 1e-07 1 1 0\n1 5 0 2582.118789 5000\n0\n\n0101000\n+39 0 -46 0 *\nWi\n\n0101100\n+38 0 -45 0 -37 2 +37 4 *\nFa\n0 1e-07 2 0\n\n0101000\n+36 0 *\nVe\n1e-07\n2918.543701 0 0\n0 0\n\n0101101\n\nEd\n 1e-07 1 1 0\n1 6 0 0 3000\n0\n\n0101000\n+34 2 -34 4 \nEd\n 1e-07 1 1 0\n1 7 0 0 2549.639764534\n0\n\n0101000\n+34 0 -39 0 *\nWi\n\n0101100\n+33 0 -38 0 -32 2 +32 4 *\nFa\n0 1e-07 3 0\n\n0101000\n+31 0 *\nEd\n 1e-07 1 1 0\n1 8 0 0 2918.543701\n0\n\n0101000\n+44 0 -34 0 *\nWi\n\n0101100\n+43 0 -33 0 -29 2 +29 4 *\nFa\n0 1e-07 4 0\n\n0101000\n+28 0 *\nWi\n\n0101100\n+42 0 +37 0 +32 0 +29 0 *\nFa\n0 1e-07 5 0\n\n0101000\n+26 0 *\nSh\n\n0101100\n+40 0 +35 0 +30 0 +27 0 +25 2 -25 4 *\nSo\n\n0100000\n-24 0 *\nEd\n 1e-07 1 1 0\n1 9 0 0 3000\n0\n\n0101000\n+34 5 -34 7 *\nEd\n 1e-07 1 1 0\n1 10 0 0 3000\n0\n\n0101000\n+39 5 -39 7 *\nWi\n\n0101100\n+22 0 -21 0 -32 5 +32 7 *\nFa\n0 1e-07 6 0\n\n0101000\n+20 0 *\nVe\n1e-07\n5000 2500 0\n0 0\n\n0101101\n\nEd\n 1e-07 1 1 0\n1 11 0 0 3000\n0\n\n0101000\n+18 5 -18 7 \nEd\n 1e-07 1 1 0\n1 5 0 0 2582.118789\n0\n\n0101000\n+18 0 -39 0 *\nWi\n\n0101100\n+17 0 -21 0 -16 5 +16 7 *\nFa\n0 1e-07 7 0\n\n0101000\n+15 0 *\nVe\n1e-07\n5000 0 0\n0 0\n\n0101101\n\nEd\n 1e-07 1 1 0\n1 12 0 0 3000\n0\n\n0101000\n+13 5 -13 7 *\nEd\n 1e-07 1 1 0\n1 13 0 0 2500\n0\n\n0101000\n+13 0 -18 0 *\nWi\n\n0101100\n+12 0 -17 0 -11 5 +11 7 *\nFa\n0 1e-07 8 0\n\n0101000\n+10 0 *\nEd\n 1e-07 1 1 0\n1 8 0 2918.543701 5000\n0\n\n0101000\n+34 0 -13 0 *\nWi\n\n0101100\n+22 0 -12 0 -8 5 +8 7 *\nFa\n0 1e-07 9 0\n\n0101000\n+7 0 *\nWi\n\n0101100\n-32 0 +16 0 +11 0 +8 0 *\nFa\n0 1e-07 5 0\n\n0101000\n+5 0 *\nSh\n\n0101100\n-19 0 +14 0 +9 0 +6 0 +4 5 -4 7 *\nSo\n\n0100000\n-3 0 *\nCo\n\n1100000\n+23 0 +2 0 *\n\n+1 1 '

    tcc=topologic.CellComplex
    tcc.ByString(ccbs)
    <topologic.Cluster object at 0x7fee6ec3c470>

    topologic
  • Your best source is the python code at:
    https://github.com/wassimj/TopologicSverchok/tree/main/nodes/Topologic
    You can look at the function “processItem” in each file and find out how Topologic Python works

    paullee
Sign In or Register to comment.