OSArch Community

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

  1. P

    This .local directory seems to be containing what are installed with "pip install topologicpy" :-

  2. P

    Noted some difference between FreeCAD 0.20 and 0.21_pre, particularly OCC :-

    OS: Fedora Linux 36 (Workstation Edition) (GNOME/gnome)

    Word size of FreeCAD: 64-bit

    Version: 0.20.29177 (Git)

    Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3

    Version: 0.21.0.31391 (Git)

    Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3

    Would it be the difference in OCC make topologic not working in FreeCAD 0.21_pre ?

  3. P

    @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.

  4. T

    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.

  5. P

    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

  6. P

    @topologic Good news :)

    I do not know how, but now below combination works !

    • Topologicpy (by pip install 6.9.2023) + FreeCAD 0.21.0 (AppImage) + Fedora 38

    • Topologicpy (by pip install 6.9.2023) + FreeCAD 0.20.0 (Fedora rpm Repo) + Fedora 38

    Thanks !

  7. P

    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 "<input>", line 1, in <module>

    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>

  8. T
  9. T

    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)

  10. P

    @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)

    Thanks, it seems working :D

  11. P

    @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 :)

  12. T

    @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)

  13. P
  14. T
  15. P
  16. T

    Hi @paullee,

    You wrote:

    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

      import FreeCAD

      from topologicpy.Topology import Topology

      doc = FreeCAD.ActiveDocument

      sel = doc.ActiveObject

      shape = sel.Shape

      brep = shape.exportBrepToString()

      new_topology = Topology.ByBREPString(brep)

      print(new_topology)

  17. P

    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 !

  18. P

    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 wall door by the script) ?

    • Found Face.FacingToward() method ( https://topologic.app/topologicpy_doc/topologic_pdoc/Face.html#Face.Face.FacingToward ), seems needs input of direction to test to return result . Any other method available which return the direction?

    Thanks :)

  19. T

    Amazing progress, @paullee!

    In the following, I am going to assume 2D, but 3D works in exactly the same way. Just replace "Edge" in 2D with "Face" in 3D and "Face" in 2D with "Cell" in 3D. I am also assuming that rather than just a 2D wire, you are able to create a 2D shell (made of inter-connected faces).

    You should assign a dictionary to each face. Or perhaps this can be intelligently derived by the faces' location, size, shape, neighbours etc (we are researching using machine learning to do exactly that).

    Get the interior edges/boundaries of the Shell. Loop through them. For each edge, ask it for its super topologies. It should give you two faces. Ask each cell for its dictionary value at key (e.g. "Function") and if the answers are "space" and "circulation" then you know you should place a door between the two.

    To return the direction of a face, use Face.Normal()

  20. T

    Hi @paullee,

    Here is a sample script in jupyter notebook that shows you how to find the walls that separate offices from circulation

  21. P

    Thanks for your time @topologic in explaining and the sample codes, learnt a lot, still studying :D

    Now, user defines 'type' of space. Conceiving usescases like user define main entrance and the script know the 1st cell/space is kind of passage and place doors to reach every room, checking of escape route distance, window area vs room area etc.

    @yorik @Moult Anything in IFC define 'main entrance(s) ' ( for door(s)) of a building ?

    Thanks all again :D

  22. T

    Yes. Very possible.

  23. Y
  24. T

    Happy to announce that #topologicpy now supports Apple Silicon. Download the latest version (0.4.41) through pip install topologicpy --upgrade or visit: http://pypi.org/project/topologicpy

  25. P

    Further to previous Automatic Building Generator,

    now feature includes automatically :-

    • identify Internal Corridor

    • identify Internal Wall connecting to Rooms, and

    • place Door at these internal walls :D

    (Next is let Topologic to work out the graph of corridor and rooms?)

  1. Page 1
  2. 2
  3. 3
  4. 28
  5. 29
  6. 30
  7. 31

Login or Register to reply.