Civil engineering feature implementation (Transportation Engineering)

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!
User avatar
Joel_graff
Posts: 1881
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Sat Nov 14, 2020 1:45 pm

pvandeneynde wrote:
Sat Nov 14, 2020 9:36 am
It works indeed as a alpha version.. congrats for the package and happy to dive into its possibilities!
Great!
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
Posts: 1076
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Tue Nov 17, 2020 11:50 am

Hi Joel. I writed a GeoOrigin FPO. It can create a SoGeoOrigin node and edit its properties. You can get it by using this code.

Code: Select all

from freecad.trails import geo_origin

origin = geo_origin.get(vector)
If there is an object funtion returns it. If not, function will create a new object. Vector is optional. If origin.Origin is (0,0,0) it use vector variable as origin. It has two properties.

Code: Select all

zone = origin.UtmZone
geo_origin = origin.Origin
Also I added folders under it.
Attachments
geoOrigin.png
geoOrigin.png (7.05 KiB) Viewed 444 times
User avatar
Joel_graff
Posts: 1881
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Wed Nov 18, 2020 7:17 pm

HakanSeven12 wrote:
Tue Nov 17, 2020 11:50 am
If there is an object funtion returns it. If not, function will create a new object. Vector is optional. If origin.Origin is (0,0,0) it use vector variable as origin. It has two properties.
Excellent!

I'm still working through some refactoring on my code, so I haven't had a chance to really look at this yet. I'll try to soon, but I just don't know when.
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
Posts: 1076
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Mon Nov 23, 2020 10:03 am

I think I understand why there is a GeoSeparator node. If your coordinates has same system with your GeoOrigin you dont need it. But if your coordinates has not same system with GeoOrigin you can use GeoSeparator to define another system to scenegraph origin. That gives you to ability of use different coordinate system values in same scenegraph.

For example, you have two point file. First one is utm coordinates, second one is geodetic coordinates. You can create GeoOrigin with utm system for first file and you can use GeoSeparator with geodetic system for second file. Then you can convert your GeoOrigin origin coordinate to geodatic coordinates and use it as GeoSeparator origin coordinate.

That would be very helpful when using multiple coordinate systems in one scenegraph.
User avatar
HakanSeven12
Posts: 1076
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Sun Nov 29, 2020 8:41 pm

Hi Joel. The xml importer throwing some errors when I try to import any alignment. I can't send the report because I don't have a computer for now. Can you take a look when you have time?
balrobs
Posts: 177
Joined: Fri Apr 24, 2020 8:58 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby balrobs » Sun Nov 29, 2020 9:23 pm

Maybe I can help. Tried to import @HakanSeven12 xml-file
"A Kolu Güzergah.xml"
and got probably the same errors

Code: Select all

22:14:19  Missing Spiral Center coordinate in alignment K1 A Kolu
22:14:19  Missing Spiral Center coordinate in alignment K1 A Kolu
22:14:19  Missing Spiral Center coordinate in alignment K1 A Kolu
22:14:35  Traceback (most recent call last):
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad/trails/design/project/tasks/alignment/import_alignment_task.py", line 74, in accept
    result = alignment.create(_v, _v['meta']['ID'] + ' Horiz')
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad/trails/design/alignment/alignment.py", line 70, in create
    result.set_geometry(geometry, zero_reference)
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad/trails/design/alignment/alignment.py", line 365, in set_geometry
    self.model = alignment_model.AlignmentModel(geometry, zero_reference)
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad/trails/design/alignment/alignment_model.py", line 58, in __init__
    if not self.construct_geometry(geometry, zero_reference):
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad/trails/design/alignment/alignment_model.py", line 118, in construct_geometry
    self.validate_stationing()
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad/trails/design/alignment/alignment_model.py", line 523, in validate_stationing
    TupleMath.subtract(geo_coord, prev_coord))
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad_python_support/tuple_math.py", line 140, in subtract
    return TupleMath._operation(op_sub, op1, op2, fail_on_empty)
  File "/home/balrobs/.FreeCAD/Mod/Trails/freecad_python_support/tuple_math.py", line 114, in _operation
    return tuple(map(op, _op1, _op2))
<class 'TypeError'>: First arg must be Vector
System info:

Code: Select all

OS: Ubuntu 20.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23074 (Git) AppImage
Build type: Release
Branch: master
Hash: 74b866ed3022fd1452c534dae31a721bcc668f2f
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

Edit: removed the "A Kolu Güzergah.xml" attachement
Last edited by balrobs on Thu Jan 07, 2021 1:34 pm, edited 1 time in total.
User avatar
HakanSeven12
Posts: 1076
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Mon Nov 30, 2020 5:40 am

Thanks. Yes that is the error that I talked about.
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Civil engineering feature implementation (Transportation Engineering)

Postby bernd » Mon Nov 30, 2020 8:32 am

Is it possible to install trails on windows without installing git?
User avatar
HakanSeven12
Posts: 1076
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Mon Nov 30, 2020 8:47 am

I didn't test with addon manager. I'm using visual studio code and git assistant to pull all files. But you can manually download repos an put them where they should be.
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Civil engineering feature implementation (Transportation Engineering)

Postby bernd » Mon Nov 30, 2020 9:52 am

HakanSeven12 wrote:
Mon Nov 30, 2020 8:47 am
I didn't test with addon manager. I'm using visual studio code and git assistant to pull all files. But you can manually download repos an put them where they should be.
Either manually download nor AddOn manager will fetch the submodules.