FreeCAD Trails Workbench (Transportation and Geomatics)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Geomatic Workbench

Post by HakanSeven12 »

Joel_graff wrote: Tue Mar 05, 2019 11:53 am I presume you want to delete the edge and re-add it so it's endpoints are connected to the other two vertices of the triangles...
You are right :)
Joel_graff wrote: Tue Mar 05, 2019 11:53 am I don't know offhand, but I'm sure microelly does - he's probably already got the algorithm for it. :)
I hope he can help me
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geomatic Workbench

Post by Joel_graff »

HakanSeven12 wrote: Tue Mar 05, 2019 12:11 pm I hope he can help me
Ok, so I just did a bit of digging - saw this in the C++ API, and I'm guessing it's exposed to Python:

https://www.freecadweb.org/api/d6/d22/c ... 9f5f97efce

Also noticed you have a 'SwapEdge' function implemented in your workbench. Is there anything more specific you can provide about the problem?
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Geomatic Workbench

Post by HakanSeven12 »

I forget to erase it :) İt's not working. I never used C++. Can we use C++ functions in Python? I think in C++ we need a bridge for accessing functions in it.

I used this for add triangle and delete triangle: https://github.com/FreeCAD/FreeCAD/blob ... ommand.cpp
Last edited by HakanSeven12 on Thu Jun 13, 2019 1:40 pm, edited 1 time in total.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geomatic Workbench

Post by Joel_graff »

HakanSeven12 wrote: Tue Mar 05, 2019 2:39 pm I forget to erase it İt's not working. I never used C++. Can we use C++ functions in Python? I think in C++ we need a bridge for accessing functions in it.
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...
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
BC-carpenter
Posts: 10
Joined: Mon Feb 12, 2018 11:55 pm

Re: Geomatic Workbench

Post by BC-carpenter »

HakanSeven12 wrote: Thu Feb 28, 2019 9:58 pm
Joel_graff wrote: Thu Feb 28, 2019 8:18 pm Volumetric calculations are supported, but you need solid shapes to do it. Essentially, it's a call to a solid's Shape.Volume attribute.
I'm talking about sample lines, surfaces sections, section views and calculation between two or more surfaces. İs it support that or something like this? İf it can, that's help me a lot :)
I don't see how your problem is different from the one already solved by Yorik with the Arch > Site object. Once your terrain surface has been accepted as a Site object, it will accept additions (fills) or subtractions (cuts). The cut volumes can have sloped sides. All of this is working for me.
To reproduce your workflow would require you to get a bit creative with this tool, but I don't see any problems.
https://forum.freecadweb.org/viewtopic.php?f=3&t=33316
I recently posted my own experience creating a terrain surface from LandXML. https://forum.freecadweb.org/viewtopic. ... &start=560
What I didn't say in that post, was that I then created an Arch > IfcSite object from my terrain and tested these cut and fill features. I was also able to export the site as a .ifc.
Your decision to work with faceted rather than curved surfaces agrees with what I have learned.
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Geomatic Workbench

Post by HakanSeven12 »

Image

Import Point File Updated

-Multiple file support.
-Preview of selected file.
-Add and remove files from list.
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Geomatic Workbench

Post by HakanSeven12 »

BC-carpenter wrote: Wed Apr 03, 2019 11:56 pm I don't see how your problem is different from the one already solved by Yorik with the Arch > Site object. Once your terrain surface has been accepted as a Site object, it will accept additions (fills) or subtractions (cuts). The cut volumes can have sloped sides. All of this is working for me.
To reproduce your workflow would require you to get a bit creative with this tool, but I don't see any problems.
https://forum.freecadweb.org/viewtopic.php?f=3&t=33316
I recently posted my own experience creating a terrain surface from LandXML. https://forum.freecadweb.org/viewtopic. ... &start=560
What I didn't say in that post, was that I then created an Arch > IfcSite object from my terrain and tested these cut and fill features. I was also able to export the site as a .ifc.
Your decision to work with faceted rather than curved surfaces agrees with what I have learned.
Your method required different programs. I want to make all prosses in freecad. If I understand correctly, your method calculating volume between two surface. I want to calculate between two or more surface.
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Geomatics Workbench

Post by HakanSeven12 »

Image

Export Points tool added. Also Edit Surface-Swap Edge function added.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geomatics Workbench

Post by Joel_graff »

HakanSeven12 wrote: Thu Apr 25, 2019 12:47 pm Export Points tool added. Also Edit Surface-Swap Edge function added.
Looking good!
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Geomatics Workbench

Post by HakanSeven12 »

Joel_graff wrote: Thu Apr 25, 2019 8:50 pm Looking good!
Thanks :) Are you planing to do more landxml work? Like add spiral support or metric system support.
Post Reply