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

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Thu Jun 13, 2019 2:54 pm

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

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Mon Jun 17, 2019 2:20 pm

I think I've fixed this. Give it a try.
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
HakanSeven12
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Mon Jun 17, 2019 2:46 pm

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

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

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Mon Jun 17, 2019 3:07 pm

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.
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
Joel_graff
Posts: 1376
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Mon Jun 17, 2019 7:35 pm

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.
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
HakanSeven12
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Tue Jun 18, 2019 7:55 am

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 204 times
gl d2.png
gl d2.png (126.46 KiB) Viewed 185 times
User avatar
Joel_graff
Posts: 1376
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Tue Jun 18, 2019 12:14 pm

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 174 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]
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
HakanSeven12
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Tue Jun 18, 2019 12:27 pm

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
Posts: 1376
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Tue Jun 18, 2019 12:51 pm

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...
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
HakanSeven12
Posts: 264
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Tue Jun 18, 2019 1:00 pm

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