模擬火車旗艦站
標(biāo)題: 緩和曲線連接軌道教程 [打印本頁(yè)]
作者: 我是好人川 時(shí)間: 2018-8-27 17:24
標(biāo)題: 緩和曲線連接軌道教程
連接軌道是很容易的,但是rw不允許連接時(shí)帶緩和曲線。這令我頭疼了兩年。。
今天上Google用了無(wú)數(shù)關(guān)鍵詞如"join tracks with easement", "two tracks easement", ...竟然在github(程序猿都很熟悉{:10_3874:})上找到了一個(gè)大佬的解決方案
地址:https://github.com/macph/easement-curve
點(diǎn)擊"clone or download"再點(diǎn)"download ZIP"
此大佬(用戶名macph)運(yùn)用了高數(shù)知識(shí),對(duì)rw中的緩和曲線線型(Euler Spiral,我以為是采用其近似——三次拋物線)分析,計(jì)算出rw中使用的緩和曲線參數(shù)值。他寫了一個(gè)python程序(請(qǐng)大家自行安裝python,baidu有教程)計(jì)算需要鋪設(shè)曲線的長(zhǎng)度
[attach]47613[/attach]
(嗯,沒(méi)學(xué)過(guò)數(shù)分,看一眼就不看了)
[attach]47614[/attach]
(在python環(huán)境下運(yùn)行此的__main__.py)
作者: 我是好人川 時(shí)間: 2018-8-27 17:26
本帖最后由 我是好人川 于 2018-8-27 17:48 編輯
廢話不多說(shuō)了,以下為作者的教程(即guide.md里的內(nèi)容,下載的文件中包含有
)。需要一定英語(yǔ)閱讀能力?床欢梢詆oogle翻譯慢慢看。
也可以直接看https://github.com/macph/easement-curve/blob/master/docs/guide.md
Introduction
Starting up the GUI gives you this:
[attach]47615[/attach]
- 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 tracksSuppose 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.
[attach]47616[/attach]
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.
[attach]47617[/attach]
[attach]47618[/attach]
We want the x and z coordinates (569.349, 662.636) and the y-axis rotation 73.085, and enter them.
[attach]47619[/attach]
ℹ️ 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.
[attach]47620[/attach]
ℹ️ 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.
[attach]47621[/attach]
[attach]47622[/attach]
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.
[attach]47623[/attach]
ℹ️ 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.
[attach]47624[/attach]
Looking straight down at the gizmo, we use the cut tool exactly where the gizmo's centre is. The extraneous section is deleted.
[attach]47625[/attach]
We extend an easement curve from that point to radius of curvature 3200.0.
[attach]47626[/attach]
作者: 我是好人川 時(shí)間: 2018-8-27 17:43
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.
[attach]47629[/attach]
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.
[attach]47630[/attach]
ℹ️ 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.
[attach]47631[/attach]
Assuming the coordinates are correct, it should weld without any problem
注:以上1,2,3點(diǎn)接上一個(gè)回帖的第8點(diǎn),也就分別是9,10,11點(diǎn)
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:
[attach]47632[/attach]
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.
[attach]47633[/attach]
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.
[attach]47634[/attach]
ℹ️ 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.
[attach]47627[/attach]
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.
[attach]47635[/attach]
Clicking Calculate gives us the results.
[attach]47628[/attach]
Since we have already defined a start point, we can start with extending the easement curve to radius of curvature 844.4 m.
[attach]47636[/attach]
Following the rest of the instructions from first example (9 onwards) should result in us joining up with the second track.
[attach]47637[/attach]
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.
作者: 我是好人川 時(shí)間: 2018-8-27 17:56
總結(jié)一句:越用RW越感覺RW很不專業(yè)。。
想象有一天能有人開發(fā)出能裝下整個(gè)lkj信號(hào)數(shù)據(jù)、包含逼真物理引擎、調(diào)節(jié)鐵軌幾何線型的模擬火車軟件,但估計(jì)要賣1000$
作者: 我是好人川 時(shí)間: 2018-8-28 00:48
ARF-14 發(fā)表于 2018-8-28 00:17
國(guó)外早有大老發(fā)布,基于AutoCAD的 DXF For RW Tool 售價(jià)20歐元
我之前仔細(xì)研究過(guò)tracks.bin和track tile的文件結(jié)構(gòu),不算非常復(fù)雜。感覺寫一個(gè)類似的但稍微簡(jiǎn)單的程序不會(huì)很困難,就看你愿不愿意花這個(gè)功夫了。
作者: LOCO 時(shí)間: 2018-8-30 19:52
連接怎么不能開緩和曲線 直接就能對(duì)上{:10_3878:}
作者: 我是好人川 時(shí)間: 2018-8-30 23:23
[attach]47668[/attach]
如果不經(jīng)過(guò)精確計(jì)算,無(wú)法在AB之間用一段“緩和曲線-曲線-緩和曲線”連接
@LOCO
作者: sm19538 時(shí)間: 2018-9-4 11:03
喲為......看的俺頭都大了
作者: zhuchaobaoji 時(shí)間: 2019-1-5 00:04
這種也好連接,從A到B,可以這么弄,先從A引出一條緩和+圓曲線+B‘,然后看看和B能否對(duì)齊,如果無(wú)法對(duì)齊,那就調(diào)整中間圓曲線長(zhǎng)度,直到B‘和B引出的直線完全重合,即B‘的直線和B的直線通過(guò)線路縫合按鈕,出現(xiàn)兩個(gè)灰色的按鈕即可。這樣一來(lái),這段曲線就可以使用了,剩下的任務(wù)就是通過(guò)移動(dòng)這條緩圓緩曲線,讓它和A和B重合,然后通過(guò)再次點(diǎn)擊線路縫合按鈕,出現(xiàn)A點(diǎn)和B點(diǎn)的道岔,把兩條多余的直線股部分全部刪除,再次點(diǎn)擊線路縫合按鈕,把線路縫合起來(lái),這樣就成功連接。對(duì)于大半徑曲線來(lái)說(shuō),更省時(shí)間,但是對(duì)于小半徑曲線,就需要極其精確的對(duì)準(zhǔn),長(zhǎng)度或許會(huì)精確到0.01米,這時(shí)候就需要非常大的耐心才能成功。我自己做了一條虛擬京哈齊鐵路,基本上都是這樣連接的,比如兩條線路的聯(lián)絡(luò)線,和一些普高同臺(tái)站的四端正線,都是通過(guò)這樣的方式連接的。畢竟無(wú)緩和曲線的拐彎,都只是用在道岔上的
作者: qwert19971211 時(shí)間: 2021-3-4 14:30
扯淡,這怎么接,我都服了,就沒(méi)人出來(lái)詳細(xì)說(shuō)一下怎么連接嗎,說(shuō)的方法一個(gè)比一個(gè)難懂,總不可能一點(diǎn)點(diǎn)實(shí)驗(yàn)吧
作者: qwert19971211 時(shí)間: 2021-3-4 15:27
你這方法你自己試過(guò)嗎,沒(méi)試過(guò)你拿出來(lái)干嘛,你自己對(duì)對(duì),看看在最后向b鏈接的時(shí)候能不能準(zhǔn)確的對(duì)接上
作者: zhuchaobaoji 時(shí)間: 2021-4-23 20:55
我要是沒(méi)試過(guò)指定不能拿出來(lái)說(shuō),問(wèn)題是你得多試幾次,緩和曲線的連接比僅僅只有圓曲線的連接要麻煩的多,一個(gè)彎都要連接半個(gè)多小時(shí),而且是曲線半徑越小的越費(fèi)時(shí)間。我至少通過(guò)這種方式,能做出來(lái)聯(lián)絡(luò)線,根本沒(méi)那么復(fù)雜
作者: 羅榮浩 時(shí)間: 2023-5-3 18:13
我是好人川 發(fā)表于 2018-8-30 23:23
如果不經(jīng)過(guò)精確計(jì)算,無(wú)法在AB之間用一段“緩和曲線-曲線-緩和曲線”連接
@LOCO
所以說(shuō),兩段鐵軌為什么要這樣分開?不能一直接下去嗎?
作者: 1956863622 時(shí)間: 2023-7-30 17:45
要一點(diǎn)一點(diǎn)試,兩個(gè)軌道高度要差不多
歡迎光臨 模擬火車旗艦站 (http://www.kitis.cn/) |
Powered by Discuz! X3.4 |