请选择 进入手机版 | 继续访问电脑版

缓和曲线连接轨道教程 

2018-08-27 17:24 发布

连接轨道是很容易的,但是rw不允许连接时带缓和曲线。这令我头疼了两年。。
今天上Google用了无数关键词如"join tracks with easement", "two tracks easement", ...竟然在github(程序猿都很熟悉)上找到了一个大佬的解决方案
地址:https://github.com/macph/easement-curve
点击"clone or download"再点"download ZIP"

此大佬(用户名macph)运用了高数知识,对rw中的缓和曲线线型(Euler Spiral,我以为是采用其近似——三次抛物线)分析,计算出rw中使用的缓和曲线参数值。他写了一个python程序(请大家自行安装python,baidu有教程)计算需要铺设曲线的长度



(嗯,没学过数分,看一眼就不看了)


(在python环境下运行此的__main__.py)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册RWC会员

x
B Color Smilies

全部评论14

  • zhuchaobaoji
    zhuchaobaoji 2019-1-5 00:04:44
    我是好人川 发表于 2018-8-30 23:23
    如果不经过精确计算,无法在AB之间用一段“缓和曲线-曲线-缓和曲线”连接
    @LOCO

    这种也好连接,从A到B,可以这么弄,先从A引出一条缓和+圆曲线+B‘,然后看看和B能否对齐,如果无法对齐,那就调整中间圆曲线长度,直到B‘和B引出的直线完全重合,即B‘的直线和B的直线通过线路缝合按钮,出现两个灰色的按钮即可。这样一来,这段曲线就可以使用了,剩下的任务就是通过移动这条缓圆缓曲线,让它和A和B重合,然后通过再次点击线路缝合按钮,出现A点和B点的道岔,把两条多余的直线股部分全部删除,再次点击线路缝合按钮,把线路缝合起来,这样就成功连接。对于大半径曲线来说,更省时间,但是对于小半径曲线,就需要极其精确的对准,长度或许会精确到0.01米,这时候就需要非常大的耐心才能成功。我自己做了一条虚拟京哈齐铁路,基本上都是这样连接的,比如两条线路的联络线,和一些普高同台站的四端正线,都是通过这样的方式连接的。毕竟无缓和曲线的拐弯,都只是用在道岔上的
  • 我是好人川
    我是好人川 2018-8-27 17:26:38
    本帖最后由 我是好人川 于 2018-8-27 17:48 编辑

    废话不多说了,以下为作者的教程(即guide.md里的内容,
    下载的文件中包含有
    )。需要一定英语阅读能力。看不懂可以google翻译慢慢看。
    也可以直接看https://github.com/macph/easement-curve/blob/master/docs/guide.md


    Introduction
    Starting up the GUI gives you this:

    • There are two methods of calculating easement curves - you can select them with the Select method menu. Below is a short description of what each method does.
    • Then there is the speed tolerance and minimum radius. The speed tolerance, which can either be in mph or km/h, determines how long the easement curves are. The minimum radius of curvature sets an upper limit on the curvature.
    • The Curve data section is where you enter the data needed to recreate the tracks and curves.
    • The Clear button clears away all the fields in the 'Curve data' section. The Calculate button does what it says on the tin.
    • At the bottom is the table which gives you the curve coordinates you need to recreate the curve in Train Simulator.
    Let us get started with some examples of joining up tracks with easement curves.
    Joining two straight tracks
    Suppose we have two straight tracks, and we want to create a section with easement curves of radius of curvature 3,200 m to join them. The track rule we are using has a speed tolerance of 120 mph and minimum radius of curvature 1,000 m.

    • As we need a specific radius of curvature, we select method 1. We double click on the first track - it doesn not matter where exactly, as it is the straight line which is used for the calculations. The coordinates rolls out.


    • We want the x and z coordinates (569.349, 662.636) and the y-axis rotation 73.085, and enter them.

      ℹ️ In TS2016 the x and z axes are the horizontal axes, while the y axis is the vertical axis. This is in contrast to the standard Cartesian coordinates where x and y are the horizontal axes.
    • We also need the quadrant. Move the camera down to the track and look down the track in the direction you want to build the curve in. The compass says it is about 75 degrees between N and E, therefore the quadrant is NE. We enter that in.

      ℹ️ The y-axis rotation value is in the [-90, 90] range only, which is half that needed for the full 360 degrees range. Including the quadrant solves this problem. See the reference for more on this.
      ⚠️ Take care with tracks aligned towards W (y-axis rotation -90) or E (y-axis rotation 90), as the rotation values can be the same on either side of the axis.
    • We do the same thing for the second track - again, it does not matter where exactly on the track. The coordinates are (681.732, 700.001) and the rotation is 69.511 NE.


    • Finally, we enter the radius of curvature 3200 m. The direction can be left as N/A, as we are only interested in the shortest curve. Clicking Calculate gives us the results.

      ℹ️ Picking CW or ACW will force the curve to be aligned in that direction, even if it is a much longer curve and crosses itself. By leaving it at N/A by default the curve will be aligned in the shortest direction.
    • We need to recreate the curve in Train Simulator. The start point is at (508.235, 644.051), so we find that point on the first track by double clicking it until the coordinates rollout gives us the correct values.

    • Looking straight down at the gizmo, we use the cut tool exactly where the gizmo's centre is. The extraneous section is deleted.

    • We extend an easement curve from that point to radius of curvature 3200.0.


  • 我是好人川
    我是好人川 2018-8-27 17:43:09
    • We create a curve of constant radius of curvature, that is, a static curve, and making sure it is longer than needed so we can cut it in the right place.

    • We find the end point of the static curve by looking for the right coordinates - just keep double clicking until the coordinates show 697.867 for the x-axis coordinate. We cut the curve at that point.

      ℹ️ If the radius of curvature is small you can find the correct place to cut the track by looking for the  y-axis rotation value - but as 3,200 m is quite large the x and z position values are more accurate.
    • Finally, we extend another easement curve, straightening it out to join the second straight track.

      Assuming the coordinates are correct, it should weld without any problem
    • 注:以上1,2,3点接上一个回帖的第8点,也就分别是9,10,11点


    Extending a track to join another
    The second method calculates easement curves starting at a specific point and extended to join a straight track. The starting track can either be straight or curved, as long as it is in the same direction as the ending track. As the radius of curvature shown by Train Simulator for a track is only accurate to 1 decimal place, the tool uses an additional pair of coordinates to acquire a more accurate radius of curvature for the starting track. If the starting track is straight, the additional pair of coordinates can be left blank.

    Suppose we want to extend an curved track to join with a straight track with easement curves, using a track rule with 60 mph speed tolerance and minimum radius 400 m:



    • This time, it is important where the starting coordinate is. We hover the cursor just outside the end of the bounding box for the track loft - the yellow boundary should still be visible. Double clicking gives us the coordinates right at the end of the track. We enter the coordinates (490.146, 786.863) and the rotation 65.067 SW.

    • For the second set of coordinates, we double click on another point on the curved track that is not too close, and enter the coordinates (521.558, 802.368). The rotation/quad values are not needed here.

      ℹ️ It does not matter where the second pair of coordinates is, just as long as it is on the same track section with the same radius of curvature. If you are starting on a easement curve you can extend a static curve with the easement tool and pick a pair of coordinates before deleting the curve - it will work either side of the starting point.

    • Finally, we enter the coordinates of the straight track - it does not matter where exactly on the track. The coordinates are (465.935, 775.315) and 69.148 SW.

    • Clicking Calculate gives us the results.

    • Since we have already defined a start point, we can start with extending the easement curve to radius of curvature 844.4 m.

    • Following the rest of the instructions from first example (9 onwards) should result in us joining up with the second track.



    Other ways of implementing the curve data
    The above instructions show one way to recreate the curve in Train Simulator, but it may not always work because Train Simulator will only show radius of curvature and length for tracks with one decimal place - any hidden errors when laying down the track can easily blow up and make the curve unable to join the second track.

    It is for that reason the results are laid out in a table with all the data required rather than a list of instructions.

    One other way of laying down the track would be to look at the coordinates for the start and the end of the static curve, and lay down two straight tracks whose ends match up with those coordinates. Then, with Train Simulator's joining tool, the static curve is formed by joining those tracks without easements. The straight tracks are deleted and new easement curves created in place, both of which should join up with the starting and ending tracks without problems.


  • 我是好人川
    我是好人川 2018-8-27 17:56:47
    总结一句:越用RW越感觉RW很不专业。。
    想象有一天能有人开发出能装下整个lkj信号数据、包含逼真物理引擎、调节铁轨几何线型的模拟火车软件,但估计要卖1000$
  • ARF-14
    ARF-14 2018-8-28 00:17:44
    本帖最后由 ARF-14 于 2018-8-28 00:19 编辑

    国外早有大老发布,基于AutoCAD的 DXF For RW Tool 售价20欧元






    点评

    我之前仔细研究过tracks.bin和track tile的文件结构,不算非常复杂。感觉写一个类似的但稍微简单的程序不会很困难,就看你愿不愿意花这个功夫了。  详情 回复 发表于 2018-8-28 00:48
  • 我是好人川
    我是好人川 2018-8-28 00:48:44 来自手机
    ARF-14 发表于 2018-8-28 00:17
    国外早有大老发布,基于AutoCAD的 DXF For RW Tool 售价20欧元

    我之前仔细研究过tracks.bin和track tile的文件结构,不算非常复杂。感觉写一个类似的但稍微简单的程序不会很困难,就看你愿不愿意花这个功夫了。
  • LOCO
    LOCO 2018-8-30 19:52:50
    连接怎么不能开缓和曲线 直接就能对上

    点评

    可能是我表达有问题。如下图所示,已有两段笔直的轨道A和B,如果没精确算出长度是根本无法用一段“缓和曲线-弯道-缓和曲线”连接起来的  发表于 2018-8-30 23:22
  • 我是好人川
    我是好人川 2018-8-30 23:23:48

    如果不经过精确计算,无法在AB之间用一段“缓和曲线-曲线-缓和曲线”连接
    @LOCO

    点评

    这种也好连接,从A到B,可以这么弄,先从A引出一条缓和+圆曲线+B‘,然后看看和B能否对齐,如果无法对齐,那就调整中间圆曲线长度,直到B‘和B引出的直线完全重合,即B‘的直线和B的直线通过线路缝合按钮,出现两个  详情 回复 发表于 2019-1-5 00:04
    也不用精确计算 多试几次就能接上 只不过数据要特别精确 不然就会错位{:10_3875:}  发表于 2018-8-31 13:53
  • sm19538
    sm19538 2018-9-4 11:03:15
    哟为......看的俺头都大了

    点评

    难怪我看不懂哦......我高小文化{:7_3628:}{:7_3628:}  发表于 2018-9-4 12:53
    高中水平的英语够了。不过,对准备考托福的我来说已经忘了什么叫高中英语{:10_3888:}  发表于 2018-9-4 11:56
快速回复 返回顶部 返回列表