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

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

A small-ish update.

I've successfully written an algorithm that finds the outer boundaries of a swept path. For a 100-step analysis, the entire calculation performs at 180-200 fps, which provides a good deal of room for a 30-60fps animation budget... or a real-time update as the user clicks / drags the vehicle around the screen.

Too much fun. :)


turns_vehicle.gif
turns_vehicle.gif (815.49 KiB) Viewed 2000 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
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

Joel_graff wrote: Tue Dec 10, 2019 9:26 pm Too much fun. :)
The vision: Rambling trucks in FreeCAD city - an interactive game: drive with your car models in a randomly generated town. We have FreeCAD as Web-Server, so it should be possible to use it as a game server for multiple gamers too.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Kunda1 »

:truck: :truck: :truck: Keep on Truckin :truck: :truck: :truck:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
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 »

microelly2 wrote: Wed Dec 11, 2019 6:49 am The vision: Rambling trucks in FreeCAD city - an interactive game: drive with your car models in a randomly generated town. We have FreeCAD as Web-Server, so it should be possible to use it as a game server for multiple gamers too.
lol. I draw some lines and dots on the screen and @microelly gets excited. ;)

I do think about 3D analysis - or at least a separate 2D vertical profile analysis. That's another useful feature in AutoTurn...
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
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Kunda1 »

Blender related news
Support for Long Vehicle traffic simulation will soon be available in #b3d #CrowdSim3D. Bus model from https://blendswap.com/blend/5741.
https://twitter.com/atmind/status/1232311284907069441
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
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 »

Fascinating... I wonder how accurate they attempt to model traffic. The professional stuff works pretty hard to do accurate traffic modelling. Still, neat to see.
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 »

So with the holidays a vacation and other things, progress has been pretty slow on my latest efforts with FreeCAD Turns. I've mostly been working on getting pivy-trackers to better support dragging, specifically visualizing the changes in geometry as the user clicks and drags. It's been harder than I anticipated, and I've pretty much botched up the API so far as dragging g is concerned. Oy.

But, it's starting to yield results. I developed this bit to support designing / resizing custom vehicles for Turns, so the user can directly manipulate the geometry rather than enter values in text fields. I've also managed to get incremental movement to work well.

In the screen shot below, I have the mouse movement locked in the x and y directions, changes are limited to 1.0 units, and the text labels indicating line lengths update while the user makes changes.

Overall, not bad for a strictly Python effort. :)
turns_vehicle.gif
turns_vehicle.gif (250.75 KiB) Viewed 1741 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
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Kunda1 »

Joel_graff wrote: Mon Mar 02, 2020 1:19 pm In the screen shot below, I have the mouse movement locked in the x and y directions, changes are limited to 1.0 units, and the text labels indicating line lengths update while the user makes changes.
Wow, I love how your efforts are brewing up potentially to become a whole new level of sophistication for FC. Not with the intention of derailing this topic, but it would be good to eventually see some scenegraph stress tests and their impact on FC performance. But that is a logistic. Right now, this is fantastic progress. Thank you!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
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 »

Kunda1 wrote: Mon Mar 02, 2020 1:25 pm Wow, I love how your efforts are brewing up potentially to become a whole new level of sophistication for FC. Not with the intention of derailing this topic, but it would be good to eventually see some scenegraph stress tests and their impact on FC performance. But that is a logistic. Right now, this is fantastic progress. Thank you!
There's nothing I'm really doing to the scenegraph directly which would be any worse than what typically occurs in FreeCAD. I may be adding a bit more hierarchy to the overall structure, but that's mostly for easiler management. Even if I add a lot of nodes that generally do nothing, optimizations of scenegraph traversals are typically good enough that it doesn't really impact performance. It shouldn't anyway, though there's always edge cases.

Of course, I'm not really any sort of expert. I'm just remembering a lot of the stuff I learned back when I used OpenSceneGraph pretty intensely. :)

The nice thing about using the scenegraph directly is it allows me to target the mouse detection to specific nodes, rather than having to process *every* mouse click and movement and test to see if it's a specific kind of event - like dragging or picking. That makes writing the Python code a lot easier, as well as limiting the amount of time spent executing Python code.
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 »

in init_gui.py

Code: Select all

from pivy_trackers.examples.select_drag import select_drag_command
from pivy_trackers.examples.select_drag_linked import select_drag_linked_command
in base_tracker_test_task.py

Code: Select all

from pivy_trackers.support.view_state import ViewState
they are causing errors
Post Reply