In FreeCAD, the C++ API is generally exposed as-is in Python. That means if you find a function in C++, there's a good chance it has the same (or nearly the same) signature in Python. Not everything is exposed, but I've rarely seen anything with the level of parity between the scripting API and the internal API as I've seen with FreeCAD.
Anyway, the easiest way to sort that out is to call dir() on a FreeCAD object. That should tell you if those functions are there.
I just did some poking around, and it looks like the MeshTopoAlgorithm methods are exposed in the Mesh module. I got this using the FreeCAD Python console:
Code: Select all
>>> import Mesh
>>> x = Mesh.Mesh()
>>> dir(x)
['Area', 'BoundBox', 'Content', 'CountEdges', 'CountFacets', 'CountPoints', 'Facets', 'Matrix', 'MemSize', 'Module', 'Placement', 'Points', 'Topology', 'TypeId', 'Volume', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'addFacet', 'addFacets', 'addMesh', 'clear', 'coarsen', 'collapseEdge', 'collapseFacet', 'collapseFacets', 'copy', 'countComponents', 'countNonUniformOrientedFacets', 'countSegments', 'crossSections', 'cut', 'decimate', 'difference', 'dumpContent', 'fillupHoles', 'fixDeformations', 'fixDegenerations', 'fixIndices', 'fixSelfIntersections', 'flipNormals', 'foraminate', 'getAllDerivedFrom', 'getEigenSystem', 'getFacesFromSubelement', 'getFacetSelection', 'getInternalFacets', 'getNonUniformOrientedFacets', 'getPlanarSegments', 'getPointNormals', 'getPointSelection', 'getSegment', 'getSegmentsByCurvature', 'getSelfIntersections', 'getSeparateComponents', 'harmonizeNormals', 'hasInvalidPoints', 'hasNonManifolds', 'hasNonUniformOrientedFacets', 'hasSelfIntersections', 'inner', 'insertVertex', 'intersect', 'isDerivedFrom', 'isSolid', 'meshFromSegment', 'nearestFacetOnRay', 'offset', 'offsetSpecial', 'optimizeEdges', 'optimizeTopology', 'outer', 'printInfo', 'read', 'rebuildNeighbourHood', 'refine', 'removeComponents', 'removeDuplicatedFacets', 'removeDuplicatedPoints', 'removeFacets', 'removeFoldsOnSurface', 'removeInvalidPoints', 'removeNonManifoldPoints', 'removeNonManifolds', 'restoreContent', 'rotate', 'setPoint', 'smooth', 'snapVertex', 'splitEdge', 'splitEdges', 'splitFacet', 'swapEdge', 'transform', 'transformToEigen', 'translate', 'trim', 'unite', 'write', 'writeInventor']
>>>
I see the 'swapEdge()' method in the list, though I don't see the isSwapEdgeLegal() method...