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

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Wed Jun 12, 2019 10:06 pm

If you fit to view, you'll see the main alignment zooms out because there's an arc farther up. I think that arc is part of the alignment with the curve issue I mentioned
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: 280
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Thu Jun 13, 2019 6:50 am

You are right. I check it in C3D. The problem is when you look at the alignment you will see a lots of little line and arc. They lenght near 2m. Because they are exploded spirals. In road plan there is only one spiral-arc-spiral element.

Also spiral object dont support this function. Icant create guide lines on spirals.

Code: Select all

Coord, vec = Alignment.Proxy.model.get_orthogonal( Station, "Left")
Menemen.png
Menemen.png (121.29 KiB) Viewed 270 times
User avatar
Joel_graff
Posts: 1581
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Thu Jun 13, 2019 12:15 pm

HakanSeven12 wrote:
Thu Jun 13, 2019 6:50 am
You are right. I check it in C3D. The problem is when you look at the alignment you will see a lots of little line and arc. They lenght near 2m. Because they are exploded spirals. In road plan there is only one spiral-arc-spiral element.
Right. I never zoomed in on it to see what was actually happening, lol.. Anyway, teh issue is broken geometry and I need to figure out how to deal with that so it doesn't just crash. That said, you might want to see if you can fix that bearing mismatch between the curve and the preceding line...
HakanSeven12 wrote:
Thu Jun 13, 2019 6:50 am
Also spiral object dont support this function. Icant create guide lines on spirals.
No it doesn't. No promises on when it will at this point.
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
Posts: 1581
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Thu Jun 13, 2019 12:36 pm

HakanSeven12 wrote:
Thu Jun 13, 2019 6:50 am
You are right. I check it in C3D. The problem is when you look at the alignment you will see a lots of little line and arc. They lenght near 2m. Because they are exploded spirals. In road plan there is only one spiral-arc-spiral element.
This issue is (somewhat) fixed. The invalid geometry is reduced to a zero-radius arc and it now renders the rest of the geometry in-place.

Capture.JPG
Capture.JPG (18.02 KiB) Viewed 239 times
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: 280
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Thu Jun 13, 2019 12:47 pm

Its ok for me :)
User avatar
Joel_graff
Posts: 1581
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Thu Jun 13, 2019 1:00 pm

HakanSeven12 wrote:
Thu Jun 13, 2019 12:47 pm
Its ok for me
Cool. Also, I just pushed preliminary support for ortho / tangent vector calculations for spirals. Give it a shot. I haven't tested it, so it's just a guess as to whether or not it works. Since you've got a functioning test case, I figured I'd test it on you. :)
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: 280
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby HakanSeven12 » Thu Jun 13, 2019 1:13 pm

Of course I can test it :)

Code: Select all

Traceback (most recent call last):
  File "C:\Users\Hakan\AppData\Roaming\FreeCAD\Mod\Geomatics\Section\CreateGuideLines.py", line 158, in CreateGuideLines
    Coord, vec = Alignment.Proxy.model.get_orthogonal( Station, "Left")
  File "C:\Users\Hakan\AppData\Roaming\FreeCAD\Mod\freecad.trails-dev\freecad\trails\alignment\alignment_model.py", line 566, in get_orthogonal
    return _fn[curve['Type']].get_ortho_vector(curve, distance, side)
  File "C:\Users\Hakan\AppData\Roaming\FreeCAD\Mod\freecad.trails-dev\freecad\trails\geometry\spiral.py", line 438, in get_ortho_vector
    _coord = get_segments(_bearing, [_delta])[1]
  File "C:\Users\Hakan\AppData\Roaming\FreeCAD\Mod\freecad.trails-dev\freecad\trails\geometry\spiral.py", line 301, in get_segments
    _bearing = spiral['BearingIn']
TypeError: 'float' object is not subscriptable
User avatar
Joel_graff
Posts: 1581
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Thu Jun 13, 2019 2:08 pm

HakanSeven12 wrote:
Thu Jun 13, 2019 1:13 pm
Of course I can test it
Try again. I manged to get it working on my end. Probably something else I've forgotten, though.
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: 280
Joined: Wed Feb 06, 2019 10:30 pm

Re: Civil engineering feature implementation (Transportation Engineering)

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

No error but looks weird
GL.png
GL.png (138.96 KiB) Viewed 199 times
User avatar
Joel_graff
Posts: 1581
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Thu Jun 13, 2019 2:49 pm

Hmmm.. looks like the curve direction is reversed when the orthogonal is calculated.

In geometry/spiral.py, try changing line 433 from:

Code: Select all

_vec.multiply(_x).normalize()
to:

Code: Select all

_vec.multiply(-_x).normalize()
and give it another shot.
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