Anyone interested in bringing Topologic to FreeCAD?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
nmt
Posts: 29
Joined: Sun Feb 19, 2017 2:45 pm

Anyone interested in bringing Topologic to FreeCAD?

Post by nmt »

Hi FreeCAD community,

I am wondering if there is anyone who would be interested in bringing Topologic (http://topologic.app) to FreeCAD as a workbench. Topologic is free and open source, so a very good fit for FreeCAD (plus they share the same engine).

I recently demonstrated that you can access Topologic from Python 3.x through pythonnet. I am just wondering if that means FreeCAD can also access the Topologic DLLs from its own python module? I have worked a bit with FreeCAD (because both FreeCAD and Topologic are built on opencascade), but I am not an expert in how to create a FreeCAD workbench etc etc.

Anyway, if you have time to spare, you are interested, and you know your stuff :) then please contact me (info at topologic dot app) and I will be happy to show you what Topologic can do and see if we can bring it to FreeCAD.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by vocx »

nmt wrote: Wed Aug 05, 2020 3:04 pm ...
I recently demonstrated that you can access Topologic from Python 3.x through pythonnet. I am just wondering if that means FreeCAD can also access the Topologic DLLs from its own python module? ...
Creating a workbench is very easy. It's done by amateurs who aren't expert programmers by just copying bits and pieces of other workbenches and hacking together something that loads. Or see freecad.workbench_starterkit and Workbench creation.

I think the most important question is what exactly is this topologic? Is it a pure C++ library? Does it include a GUI interface? Does it have Python bindings? Is it a node programming language? Does it create shapes, shape-definitions? It's not entirely clear to me.

As long as you can import something in Python, and provide data to FreeCAD, it should work to create a workbench around it.

Code: Select all

import topologic

obj = topologic.create_something()

# Do something with obj
This seems similar to NodeEditor and PyFlow, node editor - pyflow.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
nmt
Posts: 29
Joined: Sun Feb 19, 2017 2:45 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by nmt »

vocx wrote: Wed Aug 05, 2020 3:30 pm I think the most important question is what exactly is this topologic? Is it a pure C++ library? Does it include a GUI interface? Does it have Python bindings? Is it a node programming language? Does it create shapes, shape-definitions? It's not entirely clear to me.

As long as you can import something in Python, and provide data to FreeCAD, it should work to create a workbench around it.

Code: Select all

import topologic

obj = topologic.create_something()

# Do something with obj
This is the code that I use in python 3.x from the console. What is the FreeCAD equivalent?

Code: Select all

import sys
import clr
sys.path.append("C:\Program Files\Topologic")
clr.AddReference("TopologicNET")
import Topologic

v1 = Topologic.Vertex.ByCoordinates(0.0,0.0,0.0)
v2 = Topologic.Vertex.ByCoordinates(10.0,10.0,10.0)
e1 = Topologic.Edge.ByStartVertexEndVertex(v1,v2)
c1 = e1.Centroid
print(c1.X,c1.Y,c.Z)
The result should be 5.0 5.0 5.0
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by vocx »

nmt wrote: Wed Aug 05, 2020 5:17 pm This is the code that I use in python 3.x from the console. What is the FreeCAD equivalent?
But what do you want to do with that code? Does it create only low level things, like vertices and edges?

In FreeCAD this is provided by the Part Module, which exposes the base classes of OpenCASCADE.

Code: Select all

v1 = Part.Vertex(0, 0, 0)
v2 = Part.Vertex(10, 10, 10)
line = Part.LineSegment(v1.Point, v2.Point)
edge = line.toShape()

Code: Select all

>>> print(edge.CenterOfMass)
Vector (5.0, 5.0, 5.0)
Topological data scripting

Do notice that many parts of the programmer documentation in FreeCAD are old, so the code may not work exactly as described; a few changes here are there are necessary to make it work. See also Source documentation.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
nmt
Posts: 29
Joined: Sun Feb 19, 2017 2:45 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by nmt »

I know I can do some of this stuff in FreeCAD. I am asking about what python code I can use to import Topologic and use it not how to achieve a similar result in FreeCAD.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by Kunda1 »

nmt wrote: Wed Aug 05, 2020 6:37 pm I know I can do some of this stuff in FreeCAD. I am asking about what python code I can use to import Topologic and use it not how to achieve a similar result in FreeCAD.
I think we're still needing some clarification on what Topologic is and what your intention is. If you can be explicit about that, it would be appreciated. It would help us understand context and again, intention.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by carlopav »

phpBB [video]


Here you have a really cool presentation of what topologic can do.
I find it really promising from a bim point of view... It could be really interesting to experiment a workflow and try to integrate it somehow into the arch/bim wb.


Here you have the link to the thread in osarch forum: https://community.osarch.org/discussion ... gic#latest

Another interesting feature is that - if I got it correctly - in topologic the topological naming is consistent and keeps the lineage history of the shape... It could be something interesting to understand how it works @realthunder.
follow my experiments on BIM modelling for architecture design
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by paullee »

There is another discussion in OSArch

1st August 20:00 UTC Monthly Meetup

I am thinking of a workflow that streamline the generation of the 'CellComplex' suited for Topologic Workflow and the general Architectural Worflow...
... maybe the Base Sketch / Wire can help.

[EDIT]

OK, can make another set of ArchSpace which share common surface between adjacent Rooms

Screenshot from 2020-08-06 06-59-31.png
Screenshot from 2020-08-06 06-59-31.png (252.42 KiB) Viewed 2990 times
Screenshot from 2020-08-06 07-00-02.png
Screenshot from 2020-08-06 07-00-02.png (218.4 KiB) Viewed 2990 times
User avatar
nmt
Posts: 29
Joined: Sun Feb 19, 2017 2:45 pm

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by nmt »

I hope that presentation was clear. Can someone please answer my original question: Seeing the python code that I can use to import Topologic, what is the equivalent python code that will allow me to import the Topologic.dll into FreeCAD? The main step that did not work is “import clr” and then of course clr.AddReference
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Anyone interested in bringing Topologic to FreeCAD?

Post by carlopav »

wmayer wrote: ping
May I draw your attention to this topic? ;)
follow my experiments on BIM modelling for architecture design
Post Reply