If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

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

1568101126

Comments

  • @topologic said:
    If anyone wants to pre alpha test Topologic for python on Linux, email me at wassim.jabi@gmail.com

    Thanks :D Sent you a mail, hope there is something I can help.

  • edited January 2021

    Hi everyone. Just to update you on our efforts to port Topologic to Linux, Python, and Blender, we have over-come some segmentation faults we were causing in python. Since yesterday, I have been stress-testing the Topologic methods and I am not able to break it so that is good news. The way Topologic works requires a bit of type checking on the return values so the python syntax needs to be carefully considered. I think a more general purpose solution is to create a set of python classes that wrap and represent Topologic classes (e.g. Vertex, Edge, Wire, etc etc). These python classes would replicate all the methods. Most will be one-liners, but some need a bit more work. This is not a difficult task, but time consuming. Any python experts who would like to contribute to this effort let me know.
    In addition, @brunopostle tested the latest modifications within Blender/python and everything seems to be working fine on his setup! He reports that Topologic builds easily, but ccppyy is a bit more tricky, but he managed to build it on Fedora. I am still facing issues getting the same done for Ubuntu. I am meeting @brunopostle and @Theo on Friday to try to figure it out. Once it is in Blender, we can accelerate the development of a Topologic Add-on and integrate it with sverchok. This should yield something that looks very similar to TopologicDynamo and TopologicGH.

    The last, but not least challenge will be the conversion of geometry between Blender and Topologic. Topologic uses Opencascade BREP. So, if anyone knows of a python utility to convert blender geometry into and from BREP then it would be as simple as myTopology = Topology.ByString(brepString) and brepString = myTopology.String(). Any help on that is also most welcome. Absent that kind of instant conversion, we will need to examine the input geometry, parse it down to vertices and build the Topologic shape from the bottom up. I am NOT looking forward to that!

    The other challenge is to bring all this work to FreeCAD. I believe we will be able to do that, but again, I am looking for an expert programmer that knows FreeCAD well and knows how to extend its python engine with additional tools. With FreeCAD, topologic will be comfortably at home as they both use OCCT.

    Attached is a screenshot of the work thus far. No 3D images, but the text shows that everything is working fine.

    stephen_lJQLcarlopavCGRJesusbillpaulleeduncanMoult
  • @topologic said:
    The way Topologic works requires a bit of type checking on the return values so the python syntax needs to be carefully considered. I think a more general purpose solution is to create a set of python classes that wrap and represent Topologic classes (e.g. Vertex, Edge, Wire, etc etc). These python classes would replicate all the methods. Most will be one-liners, but some need a bit more work. This is not a difficult task, but time consuming.

    This does need to happen, because currently an error generates a segfault which takes out blender too. In perl I would subclass each of the classes, this way there is no need to rewrite any methods that are already ok, just those methods that take a list (as I understand the problem).

    topologicJQL
  • edited January 2021

    @brunopostle said:

    @topologic said:
    The way Topologic works requires a bit of type checking on the return values so the python syntax needs to be carefully considered. I think a more general purpose solution is to create a set of python classes that wrap and represent Topologic classes (e.g. Vertex, Edge, Wire, etc etc). These python classes would replicate all the methods. Most will be one-liners, but some need a bit more work. This is not a difficult task, but time consuming.

    This does need to happen, because currently an error generates a segfault which takes out blender too. In perl I would subclass each of the classes, this way there is no need to rewrite any methods that are already ok, just those methods that take a list (as I understand the problem).

    Hi @brunopostle Yes you are right actually. We just sub-class it and over-write the troublesome methods.

    JQL
  • Sorry to geek out on this, but here is an example of how the syntax can be made much more intuitive. This is the example of creating a Cluster that needs a std:list of Topology objects, so you cannot send it Wires and Edges and Vertices. They all first need to be converted to Topologies:
    class ClusterPy(Cluster):
    def ByTopologies(topologies):
    topologyList = cppyy.gbl.std.list[Topology.Ptr]()
    for aTopology in topologies:
    aTopology.__class__ = cppyy.gbl.TopologicCore.Topology
    topologyList.push_back(aTopology)
    return Cluster.ByTopologies(topologyList)

    Then the syntax is no longer like this:
    topologies = cppyy.gbl.std.list[Topology.Ptr]()
    wire1.__class__ = cppyy.gbl.TopologicCore.Topology
    wire2.__class__ = cppyy.gbl.TopologicCore.Topology
    topologies.push_back(wire1)
    topologies.push_back(wire2)
    cluster = Cluster.ByTopologies(topologies)

    Instead it is simplified to:
    cluster = ClusterPy.ByTopologies([wire1, wire2])

    JQLpaulleeCGR
  • is the way for geometry not possible via ifc? ifcopenshell is also OCC? so brep<->OCC<->IfcOpenShell<->BlenderBIM<->Blender?
    do I misunderstand it all?
    Lukas

    topologic
  • Does this mean that, eventually, Topologic will become a plugin for blender and that we'll be able to use it on Windows or Mac? I'm eagerly antecipating that!

    topologic
  • @lukas said:
    is the way for geometry not possible via ifc? ifcopenshell is also OCC? so brep<->OCC<->IfcOpenShell<->BlenderBIM<->Blender?
    do I misunderstand it all?
    Lukas

    Yes that is possible too. I think ifcopenshell outputs and accepts breps so Topologic can communicate with it. I have already done a proof of concept of that in TopologicDynamo on Windows.

    CGR
  • @JQL said:
    Does this mean that, eventually, Topologic will become a plugin for blender and that we'll be able to use it on Windows or Mac? I'm eagerly antecipating that!

    Yes. Windows version (ie. for python3 in Windows) is being developed as we speak, but in the open-source spirit, I have focused my energy on making sure Topologic is available on Linux's python. The Mac is still a way off, but I think @Theo can help here. So my priority is:
    1. Topologic in Blender python add-on module in Linux
    2. Topologic in sverchock in Linux
    3. Topologic for FreeCAD in Linux
    4. Topologic in for python/ Blender/Sverchok/FreeCAD Windows
    5. Topololgic for python/Blender/Scerchok/FreeCAD Mac

    carlopavJQLbruno_perdigaoJesusbillpaulleeCGR
  • As a proof of concept, the test Topologic python script in Linux outputs a brep string (line 116 Topology.String(cellComplex) and then I copy and paste that in a text file on Windows and import it into FreeCAD. Since it is a brep string/file, it opens with no errors. I am hoping I can do that directly inside Blender so that I can read and write to its list of objects.

    CGR
  • Great news @topologic!
    FreeCAD has a shape from mesh function, maybe you can check if it is useful: https://wiki.freecadweb.org/Part_ShapeFromMesh

    topologic
  • I see myself using it in FreeCAD as I see myself using FreeCAD in the future (I love FreeCAD Sketches). I was under the impression Topologic required the visual programming UI to enable us to program what to do with it. How do you envision that being circumvented in FreeCAD?

    topologicpaullee
  • @JQL said:
    I see myself using it in FreeCAD as I see myself using FreeCAD in the future (I love FreeCAD Sketches). I was under the impression Topologic required the visual programming UI to enable us to program what to do with it. How do you envision that being circumvented in FreeCAD?

    @yorik just got it working in FreeCAD!! Topologic does not need visual programming. You can use it in a python script very similar to what you can do in FreeCAD.

    JQL
  • So the UI in FreeCAD would be something like typing code?

  • I am @Theo but I am not the Theo you probably want to contact.
    Anyway, thanks for bringing me into the discussion. It looks interesting.
    Theo Armour

    topologicbrunopostle
  • @Theo said:
    I am @Theo but I am not the Theo you probably want to contact.
    Anyway, thanks for bringing me into the discussion. It looks interesting.
    Theo Armour

    Ooops Sorry!

  • @JQL said:
    So the UI in FreeCAD would be something like typing code?

    it's the same as ladybug. dynamo/grasshopper is a convenient way for users to manipulate code.. we dont have that in freecad (atm at least), so yes the way to interact with it is with code. But of course what would be best is to build specific UI tools to manipulate it, for ex a topologic workbench in freecad. That is not so hard to do, who knows ;)

    paulleecarlopavbitacovir
  • Looking forward to Topologic functions in FreeCAD :)

  • For bringing IfcOpenShell shapes into Blender, this is the code: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcblenderexport/blenderbim/bim/import_ifc.py#L1978-L2007 - if there are faces, I use one method, if not, I use another. The foreach_set technique is the fastest method you'll find in Blender. IfcOpenShell geometry are IfcGeom::Representation::Triangulation (https://github.com/IfcOpenShell/IfcOpenShell/blob/b1c4481795445de3c91b2557048607ef269c4d6e/src/ifcgeom/IfcGeomIteratorImplementation.h#L25-L33). I'm still very slowly looking at the C++ side of IfcOpenShell but https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcgeom/IfcGeomRepresentation.h#L103 is a good starting point to see how it starts to wrap what I expect is originally an OCC brep.

    I never convert Blender into OCC breps - I go straight to IFC during the export process. Here's the code, which is probably irrelevant: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcblenderexport/blenderbim/bim/module/geometry/add_representation.py#L97-L139

    topologicJQL
  • edited January 2021

    so we are close to the automatic ifc building generator ? handling ifcspaces via Topologic, send them to homebuilder/topologise.. and that's it.
    A topologic super-graph to handle to ifc-buildings to deliver a whole city (like testfit.io)
    Or a parallel-graph to handle the ifcspaces to build the energymodeling structure. (ifc to gbxml)
    a similar under-graph for the piping structure of water distribution within the building.. all elements being ifc entities that would be transformed by a 'topologise' to a geometry (wether blender or freecad does not matter no more) ?
    Architecture, well construction/building is reduced to defining dictionaries and rules (setting and rearranging nodes).. and there will be the german arrangements (according to DIN) or the Danisch ones (according to their regulations)...
    the automatics run behind the time free-ed for creativity.. sounds good

    topologicJQLbruno_perdigao
  • @Moult thank you! The code is quite helpful and will enable me to write a two-way translator between Blender and Topologic. It is now a matter of time and resources.

    JQLCGR
  • I have to say I still don't quite understand what topologic does - but wow people are so enthusiastic here and outside and so much is happening! So cool be watching from the sidelines.

    topologicbrunopostleCGR
  • edited January 2021

    I'm with @duncan!
    ;-)
    And I build the Ladybug Tools / Spider gbXML Viewer in Three.js and happy to help as and when free, open source in-browser viewers are needed!

    CGRtopologicJesusbill
  • @duncan said:
    I have to say I still don't quite understand what topologic does - but wow people are so enthusiastic here and outside and so much is happening! So cool be watching from the sidelines.

    You are not alone in that! Topologic looks almost trivial until you put it into action to serve a larger design problem. It has to be used to be understood. But I will explain some features here. Unlike just a collection of solids or meshes, Topologic allows you to build connected boundary representations that are non-manifold (mysterious term that practically means that a solid can have an internal surface or and edge can have more than two surfaces connected to it). Topologic allows you to ask questions like: “Hey Living Room, what room is directly above you?” Or “if I need to go from patient room 1 to the x-ray room, what spaces do I have to go through?”
    The above only scratches the surface. There is a lot more to it. Best to read our published papers if you want to see how it can be used.

    CGRLaurensJNstephen_lpaullee
  • JQLJQL
    edited January 2021

    For what I understood, you draw geometry that represents architecture. You parse that geometry in topologic and so it knows whatthat geometry means in architectural language. What interests me is cells that can be indentifiable and know they represent spaces both interior and exterior. Topologic knows the relations between spaces and thus you can program it to respond to those relationships.

    In a first take I'm interesting in making it generate walls and slabs according to those relations and a preset wall types library. Then I'm thinking in more advanced architectural generation purposes. I'd be modelling the creative part, topologic would help on the repetitive work.

    Simulations and analyses are not my cup of tea, but I think I will be interested in hiring something to investigate it too.

    arquitextonicatopologic
  • In a first take I'm interesting in making it generate walls and slabs according to those relations and a preset wall types library. Then I'm thinking in more advanced architectural generation purposes. I'd be modelling the creative part, topologic would help on the repetitive work.

    This is all done on another platform (namely Rhino+Grasshopper and linked to Archicad realtime) but is exactly what you are expecting.
    The basis comes from this simple but bigger exercise.

    You can guess that from the colors, the conversion to BIM elements is trivial.

  • @Theo said:
    I'm with @duncan!
    ;-)
    And I build the Ladybug Tools / Spider gbXML Viewer in Three.js and happy to help as and when free, open source in-browser viewers are needed!

    Oh great! Do you know Michal Dengusiak? He integrated Topologic in his SAM software. TopologicEnergy has a Topology->gbxml method that we can chain to the Spider viewer perhaps?

  • JQLJQL
    edited January 2021

    @arquitextonica said:

    In a first take I'm interesting in making it generate walls and slabs according to those relations and a preset wall types library. Then I'm thinking in more advanced architectural generation purposes. I'd be modelling the creative part, topologic would help on the repetitive work.

    This is all done on another platform (namely Rhino+Grasshopper and linked to Archicad realtime) but is exactly what you are expecting.
    The basis comes from this simple but bigger exercise.
    You can guess that from the colors, the conversion to BIM elements is trivial.

    I know, I know and I've got your example in the back of my mind since I saw it. It's exactly what I want to do with Topologic. Brilliant!

    I just don't want to suddenly go the Revit route to get it. Why not go the Blender/FreeCAD route instead and help building/testing a OS workflow while we're at it.

  • @JQL said:

    @arquitextonica said:

    In a first take I'm interesting in making it generate walls and slabs according to those relations and a preset wall types library. Then I'm thinking in more advanced architectural generation purposes. I'd be modelling the creative part, topologic would help on the repetitive work.

    This is all done on another platform (namely Rhino+Grasshopper and linked to Archicad realtime) but is exactly what you are expecting.
    The basis comes from this simple but bigger exercise.
    You can guess that from the colors, the conversion to BIM elements is trivial.

    I know, I know and I've got your example in the back of my mind since I saw it. It's exactly what I want to do with Topologic. Brilliant!

    I just don't want to suddenly go the Revit route to get it. Why not go the Blender/FreeCAD route instead and help building/testing a OS workflow while we're at it.

    That´s precisely one of my concern/goals for my thesis. I can´t code worth my salt, but I can visual script with confidence. I can think conceptually and then develop some tools that adhere to this concepts but the how in the right way as in proper coding has tooooo many implications and I feel it builds for a lot of the colleagues involved, a sort of Alice in Wonderland-Rabbit-hole that takes the problem into the how and away from the what. You see in this thread a huge percentage of the discussion has been on the instrumentalization of the processes but much less has been on the what are the processes, how is space qualified (just program is so banal and boring...), could we think about space without aprioristic forms? There are a lot of questions that need tech to be solved but need even more a conceptual prior approach. IMHO of course...

    JQL
Sign In or Register to comment.