Yes it worksJoel_graff wrote: ↑Wed Apr 17, 2019 11:50 am EDIT: Fixed in two places. Try it now. It should work fine with the __path__ attribute.
Civil engineering feature implementation (Transportation Engineering)
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Civil engineering feature implementation (Transportation Engineering)
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Re: Civil engineering feature implementation (Transportation Engineering)
VERY interesting improvements! I really like this stuff that appears when hovering on an object... We should use that more..
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Civil engineering feature implementation (Transportation Engineering)
It's really the result of needing arcs and splines in n architecture optimized for wires.
The issue is that I need better visual tessellation than I can get with arcs / splines, so I defaulted to discretized wires. Given that precision in highway design depends entirely on what you're doing (bridges and surveys need way more accuracy than, say, ditches), discretized wires give me that exact level of control. But they're useless when I want to, say, interactively adjust the radius of a curve. So I had to devise a way to overlay the geometry model (as it exists in the actual XML data) over the wire representation in FC.
I've got some fun ideas I'm playing with at the moment - your recent responses on my other posts helped a lot.
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
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Civil engineering feature implementation (Transportation Engineering)
My test alignment.
error
I think it gives error at consecutive curves.
error
Code: Select all
C:/Users/Hakan/Desktop/Manisa.xml
Invalid curve definition: cannot determine radius / tangent lengths
Invalid curve definition: cannot determine radius / tangent lengths
Invalid curve definition: cannot determine radius / tangent lengths
Invalid curve definition: cannot determine radius / tangent lengths
Errors encountered during alignment creation:
Bearing mismatch (0.2040, 6.2511) at curve {'Type': 'Line', 'Hash': None, 'Start': Vector (4275019402.22413, 507603457.4799376, 0.0), 'End': Vector (4275017561.111967, 507660837.8030049, 0.0), 'Center': None, 'PI': None, 'Description': '', 'BearingIn': 6.251110187446423, 'Length': 57409.852545577996, 'ID': '', 'StartStation': 0.0, 'Status': '', 'ObjectID': '', 'Note': '', 'BearingOut': 6.251110187446423, 'InternalStation': (-769657.0, -712247.147454422)}
Last edited by HakanSeven12 on Wed Jan 06, 2021 7:03 pm, edited 1 time in total.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Civil engineering feature implementation (Transportation Engineering)
You know, that very likely could be. I've never actually tested consecutive curves. Eventually, I'll write 2-center / 3-center curve object support, but I figured they could just be pieced together for the time being.
Hmmm. Definitely something to test over the weekend.
Edit: I did take a quick look. The issue isn't the consecutive curves. It's at the second line object in your XML. It appears the parser is comparing the 'dirStart' attribute of the preceding curve with the line's direction / bearing. It should be comparing the 'dirEnd' attribute.
I see no obvious problems with your XML, though... Odd.
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
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Civil engineering feature implementation (Transportation Engineering)
Ok, so I think I've sorted this out. There were three issues at play - documenting them here for posterity:
- When curve data is imported, it's run through some matrix math. Basically, I can't assume any specific parameters have been provided, so I use a general algorithm to test to see if enough parameters have been provided to define the curve. If so, then it checks to ensure that all of the parameters are correct. So, if the curve coordinates are all defined, it passes check #1, but if the radius value doesn't match what is calculated from the coordinates, it fails check #2.
The issue, here, is my tolerance for error in check #2 was 0.00001 mm (a millionth of a millimeter). In reality, that should be a millionth of a foot / meter. So, I reduced the tolerance to 0.0001 mm (one ten-thousandth of a millimeter) and everything passed the second check.
- The 'bearing mismatch' error, it turns out, was because the algorithm was calculating bearings which were outside [0, 2*pi]. A quick bound check on that calculation fixed it.
- If 'optional' elements / attributes were omitted in the original XML (like the start station of a curve), the algorithm would substitute in a default value, like '0.0'. Switched this to None to prevent an invalid attribute from being interpreted as a valid one (Station 'None' is invalid, station '0', however may be perfectly valid).
Will have to explore that a bit further.
And... I think I need to start using the issue tracker. lol
Anyway, give it a try, it should import...
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
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Civil engineering feature implementation (Transportation Engineering)
Also fixed the unit issue. If you import / open a document that's in different units, you will now get asked if you want to switch the system preferences to those units. If not, it will fail to import / load.
It's a start, anyway.
It's a start, anyway.
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
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Civil engineering feature implementation (Transportation Engineering)
Its work but X-Y coordinates swapped
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Civil engineering feature implementation (Transportation Engineering)
Right.
Probably because you measure bearings counterclockwise from east? I assumed bearings measured clockwise from north.
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
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Civil engineering feature implementation (Transportation Engineering)
I dont think its about bearing. Its totally have diffrerent coordinates from my road.I added my road surface too. Its far far away from my model.Joel_graff wrote: ↑Fri Apr 26, 2019 7:56 pm Right.
Probably because you measure bearings counterclockwise from east? I assumed bearings measured clockwise from north.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum