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
microelly2
Posts: 4507
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby microelly2 » Sat Nov 04, 2017 4:54 pm

This is the example of a feedbacksketch for the 2 tangent arc connection problem
phpBB [video]

I put the file here.
https://www.dropbox.com/s/6q0l6x9dprs3w ... fcstd?dl=0

sketch hold two lines. the direction of one line is controlled by the first manager
the twoclientsfeedback sketch is full constrainted and one parameter ist controlled by the 2nd manager.

the latest version fo the nurbswb and the animation wb is needed.
User avatar
Kunda1
Posts: 6220
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Kunda1 » Fri Nov 24, 2017 1:18 pm

Feature Request: Add horizontal split view: https://forum.freecadweb.org/viewtopic.php?f=34&t=25523
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1616
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Sun Nov 26, 2017 5:00 pm

Ok, so I haven't had much time to really work through the implementation for the transportation module, but I've had some very helpful conversations with @microelly2 regarding sketcher feedback objects. At the moment, before I get too much into writing code, I'm trying to develop a clear picture of what the implementation should look like. Forgive the length of this, but it's helpful to me to think out loud, so to speak..

So, the module needs to use two types of alignments: horizontal and vertical. Both use the same kinds of geometries, but relationships and terminologies vary. Additionally, there is some interplay between the two types of alignments. For example, it's occasionally necessary to force certain parts of the horizontal alignment to align to certain parts of the vertical alignment (horizontal curves shouldn't coincide with vertical curves - I don't want to be driving around a curve while also driving over a hill, for example). Also, both alignments are measured using a common stationing.

A quick review of how stationing works is in Chapter 6 of the following document (page 16 or so):
https://www.codot.gov/programs/tetp/con ... eading.pdf

As I've thought more about it, I've been considering implementing these elements as FeaturePython objects (FPOs). At the moment, I'm looking at it like this:

  • A Feedback sketch would consist of two clients, each rendering an "alignment" FPO. One would be a horizontal alignment and the other, vertical.
  • The "alignment" FPO would either be two separate FPOs or just one that is customized for horizontal / vertical orientations at the time of construction.
  • Each alginment object would have a stationing property - they would be synchornized in code (I think just forcing the vertical's property to match the horizontal's will be sufficient).
  • Each alignment is made up of line / curve geometries with corresponding constraints. (tangents, one / two / three center curves, spiral curves)
  • Each geometry element could be constructed as a separate FPO, to manage the geometry and it's specific constraints.
  • Creating separate FPOs for the individual elements makes managing each element (and it's constraints) possible on a selection basis. That is, simply picking an element means the FPO code can automatically pick the corresponding constraints and apply operations to them in aggregate.
Screenshot from 2017-11-26 10-51-41.png
Screenshot from 2017-11-26 10-51-41.png (68.94 KiB) Viewed 578 times


The pros:
  • A single feedback sketch is strictly limited to a two-client flavor, and each feedback sketch corresponds to one and only one alignment. This corresponds nicely with the way alignments are generally managed in transportation engineering, as opposed to representing multiple alignments (and their H/V curves) in a single feedback sketch.
  • Using FPOs to encapsulate the alignment hierarchy makes application of both local and system wide properties easier to manage.
  • Using FPOs potentially makes interacting with the alignments more straightforward as geometries and their corresponding constraints can be individually selected and manipulated.
The cons:
  • Need interoperability between sibling feedback sketches (master - master interoperability would be sufficient), or the ability to nest feedback sketches
  • Constraints need to be made individually visible / invisible, since they would now exist in the same sketch as their corresponding geometries

Questions:
  • Does this hierarchy seem reasonable?
  • Are the needed features (interoperability between feedback sketch masters / toggle visbility for individual constraints) already available or manageable in some other way?
  • Do I have a completely wrong-headed view of how to use Feature Python Objects?
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
Posts: 4507
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby microelly2 » Tue Nov 28, 2017 9:30 pm

phpBB [video]

first the video, the files will come next after some beautifying
User avatar
Joel_graff
Posts: 1616
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Wed Nov 29, 2017 1:21 am

Joel_graff wrote:
Sun Nov 26, 2017 5:00 pm
first the video, the files will come next after some beautifying
I think that demonstrates the intent nicely. Being able to arbitrarily link the points of curvature / tangency in each curve with the other is really useful.

Now to figure out how to manage constraints. I hate to create a separate sketch client to contain them, but allowing them to be constantly visible just creates a cluttered view...

Maybe I just need to get over it and let it go. :)
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
Posts: 6220
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Kunda1 » Wed Nov 29, 2017 1:58 am

phpBB [video]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1616
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Wed Nov 29, 2017 3:30 am

:lol:
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
Posts: 4507
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby microelly2 » Wed Nov 29, 2017 8:30 pm

today: connect two roads by an arc with some helping tangent segments
phpBB [video]


the first picture shows the feedbacksketch.
it caclulates the arc and the connecting tangents
it depends on the two roads.
bp_640.png
bp_640.png (43.08 KiB) Viewed 463 times
the 2nd picture shows the arc sketch. It is full constrainted. But only the radius can be changed by the user,
the other parameters (ax, ... by) come back from the feedbacksketch
bp_641.png
bp_641.png (64.9 KiB) Viewed 463 times
User avatar
microelly2
Posts: 4507
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby microelly2 » Mon Dec 04, 2017 5:36 pm

on the way to a robust design ...
phpBB [video]

my experience was that working with arcs during construction is hard. often the layout switches to the unwanted solution.
So I use arcs only for the visualization of the results.
User avatar
Joel_graff
Posts: 1616
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Postby Joel_graff » Tue Dec 05, 2017 10:51 pm

I had a small eureka moment the other day and discovered a rather nice way to deal with the erratic jumping caused by constraining new elements to an alignment.

phpBB [video]
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