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
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Post by HakanSeven12 »

gl2.png
gl2.png (131.7 KiB) Viewed 1075 times
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

I think I've fixed this. Give it a try.
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: Civil engineering feature implementation (Transportation Engineering)

Post by HakanSeven12 »

Locations are correct but spiral lines are not perpendicular to alignment :) Left spiral lines are reversed.

gl.png
gl.png (110.79 KiB) Viewed 1019 times
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

Pushed a small change. Try again.

Note: I didn't deal with the spiral lines not being perpendicular. Not sure what's causing that. My test code seemed to work ok.
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
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

HakanSeven12 wrote: Mon Jun 17, 2019 2:46 pm Locations are correct but spiral lines are not perpendicular to alignment
This issue should be fixed. I tested all of the alignments and it seems to generate orthogonals correctly now, except spirals with two non-infinite radii.
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: Civil engineering feature implementation (Transportation Engineering)

Post by HakanSeven12 »

Everything looks okey. But only one line is reversed. Its not a big problem for now :)

Edit: I tested it with other alignments. I dont see any problem with them. Its valid only for "A1 Kolu" and "D2 Kolu". Maybe its releated with my code.


gl.png
gl.png (96.19 KiB) Viewed 946 times
gl d2.png
gl d2.png (126.46 KiB) Viewed 927 times
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

Ok, so that's really weird. You must be doing something in your code that's causing that error, because it didn't show up at all in mine. In order to address that, I think we need to know at exactly what coordinate that falls - if it's exactly at the start / end of a curve, it may be a math error that needs to be handled by a if/then conditional or something.

Anyway, below is a screenshot of left-side orthogonals along both alignments spaced at 1 meter:
Capture.JPG
Capture.JPG (24.28 KiB) Viewed 916 times
There's a function I wrote in the alignment object to do that- _plot_vectors().

It's accessible through alignment.Proxy. You might want to test on your system and see if you get identical results.

Code: Select all

>>> App.ActiveDocument.K1_A_Kolu_Horiz.Proxy._plot_vectors([],1.0)
station range:  [0.0, 427.237184837352]
>>> App.ActiveDocument.K2_D_Kolu_Horiz.Proxy._plot_vectors([],1.0)
station range:  [0.0, 387.319268052876]
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: Civil engineering feature implementation (Transportation Engineering)

Post by HakanSeven12 »

I also created wires at horizontal geometry points and the wrong lines at spiral-spiral(for A1) and spiral-arc(for D2) transition. Don't interest with it. Its just insignificant bug.
Last edited by HakanSeven12 on Tue Jun 18, 2019 12:52 pm, edited 2 times in total.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

Can you do me a favor and give me the exact coordinate value that generates the line for you on K1_A? I have zeroed in on that particular point and cannot reproduce the error using my own function.

I know it's not a significant issue, but if it's a math error on my side that can be fixed easily, then it should be fixed. That could easily become a big issue in another context...
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: Civil engineering feature implementation (Transportation Engineering)

Post by HakanSeven12 »

for A1 0+313.236 (508258370.0956219,4274274595.1136127,0.0)
for D2 0+200.159 (507827001.2552882,4275021798.457997,0.0)
Post Reply