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

12021222426

Comments

  • That’s the beauty of it. All the code in TopologicSverchok can potentially be ported almost as is to FreeCAD.
    As to processing speed, I have not done any comparisons. If you do tests and timings, please share. Thanks.

    paullee
  • Further test with Boolean Fragment, generating 'internal faces' :D




    topologic
  • @paullee said:
    Further test with Boolean Fragment, generating 'internal faces' :D

    Just the tip of the iceberg. I can add all the sverchok code, but two things are standing in my way that perhaps someone here can help with:
    1. I don’t know how to get and display alphanumeric values from and to dialog boxes etc in FreeCAD.
    2. I don’t know how to pass output (including topologies) from one button push to the other. Does everything in FreeCAD pass through the viewer or can we stash objects in other data structures?
    Thanks for any help you can offer.

  • edited April 2022

    @topologic said:
    Just the tip of the iceberg. I can add all the sverchok code, but two things are standing in my way that perhaps someone here can help with:
    1. I don’t know how to get and display alphanumeric values from and to dialog boxes etc in FreeCAD.
    2. I don’t know how to pass output (including topologies) from one button push to the other. Does everything in FreeCAD pass through the viewer or can we stash objects in other data structures?

    Hope FreeCAD expert comes in (maybe posting in FreeCAD forum?), I have not much idea about GUI things in FreeCAD.

    For item 2, my 2 cents (as Python and FreeCAD coding beginner :) ), maybe :

    • instead of "f = doc.addObject("Part::Feature", sel.Name+"_"+names[i]) " for every 'outputs'
    • create a Part:Feature with App::PropertyLink to 'Source Object' to make thing parametric

      " fp.addProperty("App::PropertyLink","Source Object","xxx","yyy")

    • then create a few Part::PropertyPartShape to contain the Shape of the 'outputs'

      if not hasattr(fp,"output1"):
      fp.addProperty('Part::PropertyPartShape', 'output1', 'vert_faces', "xxx"),8)
      if not hasattr(fp,"output2"):
      fp.addProperty('Part::PropertyPartShape', 'output2', 'hor_faces', "xxx"),8)

    • then, contain the output in this 'properties'

      fp.output1 = output1
      fp.output2 = output2

    Now, other object can refer to these as

    • TopologicDecomposeObject.output1
    • TopologicDecomposeObject.output2
    • ...
    topologic
  • p.s.
    Questions related to python in FreeCAD can goes here :D

    https://forum.freecadweb.org/viewforum.php?f=22

  • See wiki on Scripted Objects for details and available properties :D

    (and the thread on Differences between Part::Feature, Part::FeaturePython and App::FeaturePython objects )

    I just use Part::FeaturePython

  • edited April 2022

    Some codes not tested for reference, rename the attached *.txt to *.py :)

    class TpFcObject():

    ''' Description '''

    def init(self, obj):

      ''' call self.setProperties '''                     
      self.setProperties(obj)                         
      obj.ViewObject.Proxy=0                          
      return None                             
          
    

    def setProperties(self, fp):

      ''' Add self.properties '''                     
      fp.Proxy = self                             
      if not hasattr(fp,"SourceObject"):                                                                                      
          fp.addProperty("App::PropertyLink","SourceObject","xxx","yyy")
    
      if not hasattr(fp,"output1"):
          fp.addProperty('Part::PropertyPartShape', 'output1', 'vert_faces', "xxx"),8)
      if not hasattr(fp,"output2"):
          fp.addProperty('Part::PropertyPartShape', 'output2', 'hor_faces', "xxx"),8)
    

    def execute(self, fp):

    ''' Features to Run (extract codes from your exsiting library)'''

      # algorithm to find the external vertical faces ...etc.
      inputShape = fp.SourceObject.Shape
      ...
      fp.output1 = output1
      fp.output2 = output2
      ...
      fp.Shape = (can chose to 'display' which output, e.g. depends on a switch)
     
    

    ''' make a FreeCAD 'document object' '''
    tpObj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","TpObj")

    ''' 'apply' the class / create an TpFcObject 'instance' passing the 'document object' to it '''
    tpObjInstance = TpFcObject(tpObj)

    ''' pass the selected obj to the Topologic Object for execution '''
    tpObj.SourceObject = Gui.Selection.getSelection()[0]

  • edited August 2022

    Hi OSARCH, sorry for being quiet here. Just wanted to let you know that a new version of Topologic has been released. With it comes the addition of node classification for graph machine learning. Imagine you have a graph of your building where a node represents either a space/room or a building component (wall, window etc). Imagine then that some nodes are fully known as what they are, but others are not yet fully specified (what kind of window or door? What room function?). Topologic can now fill in the blanks which means, theoretically, you can pull in the full BIM details of the missing component and auto-complete your project.
    None of this has been tested yet. I would love to collaborate if you are interested and have a dataset that can be encoded as a graph. We need at least 500 graphs to get going (or one graph with 500 nodes)

    paulleeGorgious
  • @brunopostle said:
    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 
    

    >

    Hi, thanks for your Copr works and I have been using it on Fedora.

    I have upgraded to Fedora 36 for a few weeks and would like to install the Topologic support. Is there any plan to include in the Copr the support for Fedora 36 ? Thanks :D

  • @paullee oops I forgot, fixed

    paullee
  • edited August 2022

    @brunopostle said:
    @paullee oops I forgot, fixed

    Found and try using, just to report below :D

    • FreeCAD latest release 0.20 is still using Python 3.9

    • FC36 : Topologic-python3-0.0-0.20220131git.fc36.x86_64.rpm provides support to Python 3.10

    • FreeCAD does not find the Python 3.10 site package upon importing topologic

    • Now I use FC34 : Topologic-python3-0.0-0.20220131git.fc34.x86_64.rpm, which provide support to Python 3.9
    • And it works :D
    • Can support to Python 3.9 be also added ?
      Thanks
  • @paullee I'm packaging these as if they were normal fedora packages, so I'm linking to system libraries wherever possible, so on fedora 35 & 36 it is linked with python 3.10.

    So you can either force install the old rpm for 3.9 support, or use the portable version in the Homemaker add-on zip which has Topologic compiled for 3.7, 3.8, 3.9 and 3.10, or you can install a freecad snapshot built for fedora 36 and python 3.10 from this freecad fedora copr repository.

    paullee
  • Today's progress. Topologic is interactive on the web! Try it for yourself at: https://wassimj-topologicst-plotly-test01-yul95o.streamlitapp.com/

    paulleeAcedimitarpeperibera
  • edited October 2022

    @topologic does it make sense to keep this or have you considered just redirecting to this osarch forum?
    https://topologic.app/community/
    I just had a colleague posting internally wondering where the community was and where they could read about what people are using it for. This forum seems like the place for that.

  • @duncan said:
    @topologic does it make sense to keep this or have you considered just redirecting to this osarch forum?
    https://topologic.app/community/
    I just had a colleague posting internally wondering where the community was and where they could read about what people are using it for. This forum seems like the place for that.

    I agree. The community page on http://topologic.app never took off. These pages is where the discussion about Topologic is. When I have a few minutes, I will edit that web page to include a link to these pages. Thank you for the suggestion.

  • @topologic said:
    I agree. The community page on http://topologic.app never took off. These pages is where the discussion about Topologic is. When I have a few minutes, I will edit that web page to include a link to these pages. Thank you for the suggestion.

    Please feel free (encouraged) to use OSArch branding/logo and say something more general about what this OSArch project is about :-)

  • By-the-way ... I really think it's time to stop keeping the whole discussion of topologic in one thread. It's almost useless to anyone searching for a specific answer.

    theoryshaw
  • @duncan said:

    @topologic said:
    I agree. The community page on http://topologic.app never took off. These pages is where the discussion about Topologic is. When I have a few minutes, I will edit that web page to include a link to these pages. Thank you for the suggestion.

    Please feel free (encouraged) to use OSArch branding/logo and say something more general about what this OSArch project is about :-)

    This is done! Please check and let me know if you are happy with how it looks and what it says: https://topologic.app/community/

    peperiberapaullee
  • For those of you who have not yet heard :)
    pip install topologicpy

    SinastaduncanJesusbill
  • https://github.com/nortikin/sverchok/blob/master/index.yaml
    there is change in menu approach.
    Please, grub your menu to that to make it work.

  • @paullee topologicpy works perfectly well in FreeCAD 0.20 on Windows. Here is what I did to make it work:

    import sys
    sys.path.append("path/to/the/top/folder/that/contains/topologicpy/")
    import topologicpy
    from topologicpy.Vertex import Vertex
    v = Vertex.ByCoordinates(10,20,30)
    print(Vertex.X(v), Vertex.Y(v), Vertex.Z(v))

    10 20 30

    paullee
  • Hmmm, searched on my Fedora 36 and seems found it under .local/lib/python3.10/site-packages ...

    import sys
    sys.path.append("/home/paullee/.local/lib/python3.10/site-packages")
    import topologicpy

    Traceback (most recent call last):
    File "", line 1, in
    File "/home/paullee/Downloads/FreeCAD_weekly-builds-31391-2022-12-22-conda-Linux-x86_64-py310/squashfs-root/usr/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
    File "/home/paullee/.local/lib/python3.10/site-packages/topologicpy/__init__.py", line 16, in
    import topologic
    File "/home/paullee/Downloads/FreeCAD_weekly-builds-31391-2022-12-22-conda-Linux-x86_64-py310/squashfs-root/usr/lib/python3.10> /site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
    ImportError: /home/paullee/.local/lib/python3.10/site-packages/topologicpy/bin/linux/topologic/./libTopologicCore.so.0: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv

  • 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

    paullee
  • 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

    paullee
  • It seems:-

    1. FC_0.20, with Python 3.9 + Brunopostle's packages for Fedora 36
      = import topologic : OK

    2. FC_0.21_pre, with Python 3.10 + Brunopostle's packages for Fedora 36
      = import topologic : Not OK
      = import topologicpy : Not OK

    topologic
  • @paullee said:
    It seems:-

    1. FC_0.20, with Python 3.9 + Brunopostle's packages for Fedora 36
      = import topologic : OK

    2. 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:

    It seems:-

    1. FC_0.20, with Python 3.9 + Brunopostle's packages for Fedora 36
      = import topologic : OK

    2. FC_0.21_pre, with Python 3.10 + Brunopostle's packages for Fedora 36
      = import topologic : Not OK
      = import topologicpy : Not OK

    my rpms of blenderbim and topologic use the system python. freecad downloads come with their own python interpreter (like blender), surely?

    paullee
  • edited January 2023

    @topologic said:
    What about import topologicpy with FC_0.20 with Python 3.9?

    It is not supposed to work - as it seems installed under python 3.10 ?

    /home/paullee/.local/lib/python3.10/site-packages/topologicpy

    However in FC 0.20 python console (using 3.9 python version), forcing it to look into python 3.10 location :-

    sys.path.append("/home/paullee/.local/lib/python3.10/site-packages")
    import topologicpy
    topologicpy.platform
    'linux'
    topologicpy.os

    topologicpy.topologic.Vertex

    dir (topologicpy)
    ['builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'os', 'os_name', 'platform', 're', 'sitePackagesFolderName', 'sys', 'test1', 'topologic', 'topologicFolderName', 'topologicPath']

    No Vertex etc. directly under topologicpy, but under topologicpy.topologic ....

Sign In or Register to comment.