-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.json
1 lines (1 loc) · 23.5 KB
/
params.json
1
{"name":" Computational Graphics 2012/2013 Final Project","tagline":"Marco Sbaffoni - 283934","body":"# A 3D representation of ETR 450 and ETR 480, trains of the _Pendolino_ series, created using PLaSM modeling language in Javascript and Python \r\n\r\nFor the final project of the Computational Graphics course at Roma Tre University, I chose to represent two models of glorious _Pendolino_ train series, namely the ETR 450 and the ETR 480.\r\n\r\n### Table of content\r\n* [The History of Pendolino](#the-pendolino-train-series) \r\n* [The ETR 450](#the-etr-450)\r\n* [The ETR 480](#the-etr-480)\r\n* [Source Code](#source-code)\r\n* [Credits](#credits)\r\n\r\n\r\n##The Pendolino train series\r\n### A success of Italian industrial design\r\n\r\nPendolino is an Italian family of tilting trains used in Italy, Spain, Portugal, Slovenia, Finland, Russian Federation, the Czech Republic, the United Kingdom, Slovakia, Switzerland, China and shortly in Romania and Poland. Based on the design of the Italian ETR 401 and the British Advanced Passenger Train, it was further developed and manufactured by Fiat Ferroviaria, which was taken over by Alstom in 2000.\r\n\r\nThe idea of a tilting train became popular in the 1960s and 1970s when various rail operators, impressed by the high-speed rail services being introduced in France and Japan, wondered how they could similarly speed up travel without building a dedicated parallel rail network (as those two countries were doing). By tilting, the train could go around curves designed for slower trains at higher speeds without causing undue discomfort to passengers.\r\n\r\nIn Italy, various possibilities were explored (including one early design for fixed carriages with tilting seats). A number of prototypes were built and tested, including an automotrice (self-propelled) derived from ALn 668 diesel car and provided with tilting seats. The first working prototype using a tilting carbody was ETR Y 0160, an electrically powered car launched by FIAT in 1969. This was the first to be christened Pendolino.\r\n\r\n\r\n\r\n### The Beginning\r\n\r\nIt led to the construction of a whole EMU in 1975, the ETR 401, built in two units by FIAT. One was put into public service on 2 July 1976 on the Rome-Ancona (later extended to Rimini) line, operated by Italian State Railways (Ferrovie dello Stato). Between Roma and Ancona (km. 295) the train took 2 hours and 50 minutes while the ordinary trains took 3 hours and 30 minutes. The train had four cars and was mostly considered a travelling laboratory for the new technology. The second unit was adapted for service to the wide-gauge RENFE Spanish lines.\r\n\r\n\r\n\r\nIn 1982, FIAT acquired patents for the tilting bogie used in the ill-fated British project APT. This and other improvements led to the introduction of the more advanced ETR 450, the first Pendolino to enter regular service in the world. Characterized by an 8-car (later 9-car, with the addition of a restaurant coach) configuration, ETR 450 could run the Rome-Milan line in under four hours, at speeds up to 250 km/h. Passenger numbers increased from 220,000 in 1988 to 2.2 million in 1993.\r\n\r\n### The past\r\n\r\nIn 1993, the next generation, the ETR 460, styled by Giorgetto Giugiaro, began service. Though plagued by technical teething problems, the ETR 460 introduced several innovations, such as more powerful AC asynchronous motors. Further, the pistons actuating the anti-tilting action were placed in the bogie instead of on the carbody sides: this permitted the reorganisation of the vestibules and passenger compartment areas, improving comfort. The bogie-to-body connection is extremely simple and easy to make, with clear advantages for maintenance. For safety and comfort reasons, maximum tilt was reduced to 8° from the 13° of ETR 450.\r\n\r\n\r\n\r\nETR 460 keeps axle load to an extremely low level (14.5 ton/axle) to allow the train to negotiate curves up to 35% faster than conventional Intercity trains (loco plus coaches). The body, which exploits large aluminium extrusion technology, has substantial modularity and allows for extremely low axle weight, whilst fully respecting the highest safety standards, and allows the best exploitation of the space with different loading gauges.\r\n\r\nETR 460 was built in only 10 units. Improved versions include ETR 470 for the Italo-Swiss Cisalpino company and the ETR 480, used by Trenitalia under AC lines such as those in France and Switzerland. A total of 34 EMUs of the ETR 460/470/480 series were built.\r\n\r\n### The present\r\n\r\nFIAT Ferroviaria was sold to the French Alstom company in 2000. The development of the Pendolino technology continued in the Italian factories of Alstom and the next generation, the New Pendolino, was delivered to Trenitalia and Cisalpino as the ETR 600 and the ETR 610 from 2006.\r\n\r\n\r\n\r\n## The ETR 450\r\n\r\n\r\n\r\n### Technical information\r\n* Construction years: 1987 - 1992\r\n* Max. speed (in service): 250 km/h (155 mph)\r\n* Max. tilting angle: 8°\r\n* Total number of seats: 390 (220 II + 170 I)\r\n\r\n### 3D Representation\r\nI chose to divide the model in some main parts: the front face, two sides and the top. These parts will form the main structure of the train.\r\nLet's begin with the top of the train: this is the code in PyPlasm and a screen of the result.\r\n\r\n```python\r\ndef generateTop450():\r\n\theight=1.2\r\n\tSu0=BEZIER(S1)([[0,0,0],[trainLength,0,0]])\r\n\tSu1=BEZIER(S1)([[0,trainWidth,0],[trainLength,trainWidth,0]])\r\n\tcontrol2=[[0,0,0],[0,0,height],[0,trainWidth,height],[0,trainWidth,0]]\r\n\tSv0=BEZIER(S2)(control2)\r\n\tcontrol3=[[trainLength,0,0],[trainLength,0,height],[trainLength,trainWidth,height],[trainLength,trainWidth,0]]\r\n\tSv1=BEZIER(S2)(control3)\r\n\tout=MAP(COONSPATCH([Su0,Su1,Sv0,Sv1]))(dom2D)\r\n\treturn out\r\n```\r\n\r\n\r\n\r\n\r\nHere is the Python code and the relative screenshot for the two sides of the ETR 450: \r\n\r\n```python\r\ndef genLRS450():\r\n\tadjust=0.85\r\n\tadjustBase=0.25\t\r\n\tSu0=BEZIER(S1)([[0,0,0],[0,trainHeight/3,0],[-adjust,trainHeight*2/3,0],[-adjustBase,trainHeight,0]])\r\n\tSu1=BEZIER(S1)([[0,0,-trainLength],[0,trainHeight/3,-trainLength],[-adjust,trainHeight*2/3,-trainLength],[-adjustBase,trainHeight,-trainLength]])\r\n\tSv0=BEZIER(S2)([[0,0,0],[0,0,-trainLength]])\r\n\tSv1=BEZIER(S2)([[-adjustBase,trainHeight,0],[-adjustBase,trainHeight,-trainLength]])\r\n\tout1=MAP(COONSPATCH([Su0,Su1,Sv0,Sv1]))(dom2D)\r\n\tsU0=BEZIER(S1)([[trainWidth,0,0],[trainWidth,trainHeight/3,0],[trainWidth+adjust,trainHeight*2/3,0],[trainWidth+adjustBase,trainHeight,0]])\r\n\tsU1=BEZIER(S1)([[trainWidth,0,-trainLength],[trainWidth,trainHeight/3,-trainLength],[trainWidth+adjust,trainHeight*2/3,-trainLength],[trainWidth+adjustBase,trainHeight,-trainLength]])\r\n\tsV0=BEZIER(S2)([[trainWidth,0,0],[trainWidth,0,-trainLength]])\r\n\tsV1=BEZIER(S2)([[trainWidth+adjustBase,trainHeight,0],[trainWidth+adjustBase,trainHeight,-trainLength]])\r\n\tout2=MAP(COONSPATCH([sU0,sU1,sV0,sV1]))(dom2D)\r\n\tout=STRUCT([R([1,3])(PI),R([2,3])(PI/2),R([2,3])(PI/2),out1,out2])\r\n\treturn out\r\n```\r\n\r\n\r\n\r\n\r\nIn the end, the code for the front part of ETR 450: instead of using COONSPATCH function, I chose to use only BEZIER for modeling the surface.\r\n\r\n```python\r\ndef genFrontSide450():\r\n\tadjust = 0.85\r\n\tadjustBase = 0.25\r\n\tcc0 = BEZIER(S1)([[0,0,-etr450adjust],[0,0,-etr450adjust],[0,-1.5,-etr450adjust],[trainWidth,-1.5,-etr450adjust],[trainWidth,0,-etr450adjust],[trainWidth,0,-etr450adjust]])\r\n\tc0 = BEZIER(S1)([[0,0,-etr450adjust],[0,0,-0.1],[trainWidth/2,1,3],[trainWidth,0,-0.1],[trainWidth,0,-etr450adjust]])\r\n\tc1 = BEZIER(S1)([[0,trainHeight/3,-etr450adjust],[0,trainHeight/3,-0.1],[trainWidth/2,trainHeight/3,1],[trainWidth,trainHeight/3,-0.1],[trainWidth,trainHeight/3,-etr450adjust]])\r\n\tc2 = BEZIER(S1)([[-adjust,trainHeight*2/3,-etr450adjust],[-adjust,trainHeight*2/3,-0.1],[trainWidth/2,trainHeight*2/3,16],[trainWidth+adjust,trainHeight*2/3,-0.1],[trainWidth+adjust,trainHeight*2/3,-etr450adjust]])\r\n\tc3 = BEZIER(S1)([[-adjustBase,trainHeight,-etr450adjust],[-adjustBase,trainHeight,-0.1],[trainWidth/2,trainHeight,1],[trainWidth+adjustBase,trainHeight,-0.1],[trainWidth+adjustBase,trainHeight,-etr450adjust]])\r\n\tout = MAP(BEZIER(S2)([cc0,c0,c1,c2,c3]))(dom2D)\r\n\toutT = R([1,2])(PI/2)(out)\r\n\tout = R([1,3])(-PI/2)(outT)\r\n\treturn out\r\n```\r\n\r\n\r\n\r\n\r\nNow, the code for the base of the lateral doors and one of the lateral windows.\r\n\r\n```python\r\ndef generateDoor450():\r\n\tc1=BEZIER(S1)([[0,0,0],[0.3,0,0],[0.3,0,0],[0.3,0.3,0],[0.3,trainHeight/4-0.3,0],[0.3,trainHeight/4,0],[0.3,trainHeight/4,0],[0,trainHeight/4,0]])\r\n\tc2=BEZIER(S1)([[0,0,0],[-0.3,0,0],[-0.3,0,0],[-0.3,0.3,0],[-0.3,trainHeight/4-0.3,0],[-0.3,trainHeight/4,0],[-0.3,trainHeight/4,0],[0,trainHeight/4,0]])\r\n\tfin=COLOR([1.71,2.05,2.55])(MAP(BEZIER(S2)([c1,c2]))(dom2D))\r\n\tc3=BEZIER(S1)([[0,0,0.7],[0.7,0,0.7],[1.3,0,0.7],[0.7,0.3,0.3],[0.7,trainHeight-0.3,0],[0.7,trainHeight-0.2,0],[1.3,trainHeight-0.2,0.4],[0.7,trainHeight,0.4],[0,trainHeight-0.2,0.4]])\r\n\tc4=BEZIER(S1)([[0,0,0.7],[-0.7,0,0.7],[-1.3,0,0.7],[-0.7,0.3,0.3],[-0.7,trainHeight-0.3,0],[-0.7,trainHeight-0.2,0],[-1.3,trainHeight-0.2,0.4],[-0.7,trainHeight,0.4],[0,trainHeight-0.2,0.4]])\r\n\tdoorBase=COLOR(col)(MAP(BEZIER(S2)([c3,c4]))(dom2D))\r\n\tdoorTemp=STRUCT([doorBase,T([1,2,3])([0,1.2,0.35]),R([2,3])(-PI/20),fin])\r\n\tdoor=STRUCT([T([1,2])([2,-0.7]),R([2,3])(-PI/2),doorTemp])\r\n\treturn door\r\n```\r\n\r\n\r\n\r\n\r\n```python\r\ndef generateWindow450():\r\n\tc1=BEZIER(S1)([[0,0,0],[1.5,0,0],[1.5,0,0],[1.5,0.5,0],[1.5,trainHeight/3-0.5,0],[1.5,trainHeight/3,0],[1.5,trainHeight/3,0],[0,trainHeight/3,0]])\r\n\tc2=BEZIER(S1)([[0,0,0],[-1.5,0,0],[-1.5,0,0],[-1.5,0.5,0],[-1.5,trainHeight/3-0.5,0],[-1.5,trainHeight/3,0],[-1.5,trainHeight/3,0],[0,trainHeight/3,0]])\r\n\ttemp=MAP(BEZIER(S2)([c1,c2]))(dom2D)\r\n\tout=COLOR([1.71,2.05,2.55])(STRUCT([T([2])([0.29]),R([2,3])(-PI/16),T([1,2,3])([2,-0.3,-trainHeight/2-0.65]),R([2,3])(PI/2),temp]))\r\n\treturn out\r\n```\r\n\r\n\r\n\r\n\r\nIn _plasm.js_ I defined every particular of the model (colors, windows, doors, wheels, the windshield); here some pictures of these elements and their relative code.\r\n\r\n\r\n```javascript\r\nfunction generateWheel450(){\r\n\tvar thick1 = railWidth/8;\r\n\tvar thick2 = (railWidth/8)*6;\r\n\tvar w1 = DISK(0.8)(32);\r\n\tvar w2 = DISK(0.6)(16);\r\n\tvar w3 = EXTRUDE([thick1])(w1);\r\n\tvar w4 = EXTRUDE([thick2])(w2);\r\n\r\n\treturn STRUCT([w3,w4]);\r\n}\r\n\r\nfunction generateWheels450(){\r\n\tvar distance = 2.5;\r\n\tvar w1 = generateWheel450();\r\n\tvar w2 = T([0])([distance])(w1);\r\n\r\n\tvar cylB = DISK(0.1)(16);\r\n\tvar cyl = EXTRUDE([distance])(cylB);\r\n\r\n\tvar side1Temp = STRUCT([T([1])([0.25]),w1,w2,T([2])([railWidth]),R([0,2])(PI/2),cyl]);\r\n\tvar side1 = STRUCT([R([1,2])(PI/2),side1Temp]);\r\n\tvar side2 = STRUCT([T([0,1])([0,trainWidth-0.2]),R([1,2])(PI),side1]);\r\n\r\n\tvar front = STRUCT([T([0,2])([3.5,-trainHeight]),side1,side2]);\r\n\r\n\treturn COLOR([0.3,0.3,0.3])(STRUCT([front,T([0])([trainLength-10.5]),front]));\r\n}\r\n\r\n```\r\n\r\n\r\n\r\n\r\n```javascript\r\nfunction generateWindshield450(){\r\n\r\n\tvar p1=function(){\r\n\t\tvar c1 =BEZIER(S0)([[0,0,0],[0.7,0,0.02],[0.7,0,0.02],[0.7,0.7,0.02],[0.7,trainHeight/3-0.7,0.02],[0.7,trainHeight/3,0.02],[0.7,trainHeight/3,0.02],\r\n\t\t\t\t\t\t\t[0,trainHeight/3,0]]);\r\n\t\tvar c2 =BEZIER(S0)([[0,0,0],[-0.7,0,0.02],[-0.7,0,0.02],[-0.7,0.7,0.02],[-0.7,trainHeight/3-0.7,0.02],[-0.7,trainHeight/3,0.02],[-0.7,trainHeight/3,0.02],\r\n\t\t\t\t\t\t\t[0,trainHeight/3,0]]);\r\n\r\n\t\tvar fin = COLOR([1.71,2.05,2.55])(MAP(BEZIER(S1)([c1,c2]))(dom2D));\r\n\r\n\t\treturn STRUCT([R([0,2])(PI/4),T([0,1,2])([-0.65,trainWidth/2,-0.17]),R([0,1])(PI/2),R([1,2])(-PI/2),fin]);};\r\n\r\n\tvar lat1 = function(){\r\n\t\tvar c1 =BEZIER(S0)([[0,0,0],[0.5,0,0.02],[0.5,0,0.02],[0.5,0.5,0.02],[0.5,trainHeight/3-0.5,0.02],[0.5,trainHeight/3-0.1,0.02],[0.5,trainHeight/3-0.1,0.02],\r\n\t\t\t\t\t\t\t[0,trainHeight/3-0.1,0]]);\r\n\t\tvar c2 =BEZIER(S0)([[0,0,0],[-0.5,0,0.02],[-0.5,0,0.02],[-0.5,0.5,0.02],[-0.5,trainHeight/3-0.5,0.02],[-0.5,trainHeight/3-0.1,0.02],[-0.5,trainHeight/3-0.1,0.02],\r\n\t\t\t\t\t\t[0,trainHeight/3-0.1,0]]);\r\n\r\n\t\tvar fin = COLOR([1.71,2.05,2.55])(MAP(BEZIER(S1)([c1,c2]))(dom2D));\r\n\r\n\t\tvar out = COLOR([1.71,2.05,2.55])(STRUCT([R([0,2])(PI/5),T([0,1,2])([-0.52,trainWidth/2+1.28,-0.1]),R([0,1])(-PI/7),R([0,1])(PI/2),R([1,2])(PI*3/2),fin]));\r\n\r\n\t\treturn out;};\r\n\r\n\tvar lat2 = function(){\t\r\n\t\tvar c1 =BEZIER(S0)([[0,0,0],[0.5,0,0.02],[0.5,0,0.02],[0.5,0.5,0.02],[0.5,trainHeight/3-0.5,0.02],[0.5,trainHeight/3-0.1,0.02],\r\n\t\t\t\t\t\t\t[0.5,trainHeight/3-0.1,0.02],[0,trainHeight/3-0.1,0]]);\r\n\t\tvar c2 =BEZIER(S0)([[0,0,0],[-0.5,0,0.02],[-0.5,0,0.02],[-0.5,0.5,0.02],[-0.5,trainHeight/3-0.5,0.02],\r\n\t\t\t[-0.5,trainHeight/3-0.1,0.02],[-0.5,trainHeight/3-0.1,0.02],[0,trainHeight/3-0.1,0]]);\r\n\r\n\t\tvar fin = COLOR([1.71,2.05,2.55])(MAP(BEZIER(S1)([c1,c2]))(dom2D));\r\n\r\n\t\tvar out = COLOR([1.71,2.05,2.55])(STRUCT([R([0,2])(PI/5),T([0,1,2])([-0.52,trainWidth/2-1.28,-0.1]),R([0,1])(PI/7),R([0,1])(PI/2),R([1,2])(PI*3/2),fin]));\r\n\r\n\t\treturn out;};\r\n\r\n\treturn STRUCT([p1(),lat1(),lat2()]);\r\n}\r\n\r\n```\r\n\r\n\r\n\r\n\r\nSo, this is the final result: here you can find some screenshots, or you can see it in action in the _plasm.js_ environment using the source code and the link to _plasm.js_ project (just use the console of your browser).\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n* [ETR 450 - Source code](https://github.com/cvdlab-cg/283934/blob/master/final-project/etr450model.js)\r\n* [Plasm.js environment](http://cvdlab.github.io/plasm.js/)\r\n\r\n\r\n\r\n## The ETR 480\r\n\r\n\r\n\r\n### Technical information\r\n* Construction years: 1996 - 1998 \r\n* Max. speed (in service): 250 km/h (155 mph)\r\n* Traction system: = 3 kV (all 15 trainsets)\r\n* Power: 6 MW (8,000 hp)\r\n* Length: 236.6 m (776 ft)\r\n* Max. tilting angle: 8°\r\n* Total number of seats: 480 (341 II + 139 I)\r\n\r\n### 3D Representation\r\n\r\nLike the ETR 450 model, I divided the structure in some parts (top, sides, front); for example, this is the Python code for the front part of ETR 480 model.\r\n\r\n\r\n```python\r\ndef genFrontSide480():\r\n\tadjust = 0.4\r\n\tadjustBase = 0.15\r\n\tleng = 3\r\n\theight = 0.9\r\n\tetr480adjust = 0.8\r\n\tadj = 1.8\r\n\tcc0 = BEZIER(S0)([[0,0,-etr480adjust-0.08],[0,-height/2,-etr480adjust-0.08],[0,-height,-etr480adjust-0.08],[trainWidth,-height,-etr480adjust-0.08],[trainWidth,-height/2,-etr480adjust-0.08],[trainWidth,0,-etr480adjust-0.08]])\r\n\tc0 = BEZIER(S0)([[0,0,-etr480adjust],[0,0,-0.1],[trainWidth/2,0,height],[trainWidth,0,-0.1],[trainWidth,0,-etr480adjust]])\r\n\tc1 = BEZIER(S0)([[0,trainHeight/3,-etr480adjust],[0,trainHeight/3,-0.1],[trainWidth/2,trainHeight/3,1],[trainWidth,trainHeight/3,-0.1],[trainWidth,trainHeight/3,-etr480adjust]])\r\n\tc4 = BEZIER(S0)([[-adjust,trainHeight*2/3,-etr480adjust],[-adjust,trainHeight*2/3,leng+adj],[-adjust,trainHeight*2/3,leng+adj],[trainWidth/2,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,-etr480adjust]])\r\n\tc2 = BEZIER(S0)([[-adjust,trainHeight*3/4,-etr480adjust],[-adjust,trainHeight*3/4,leng],[-adjust,trainHeight*3/4,leng],[trainWidth/2,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,-etr480adjust]])\r\n\tc3 = BEZIER(S0)([[-adjustBase,trainHeight,-etr480adjust],[-adjustBase,trainHeight,-0.1],[trainWidth/2,trainHeight,1],[trainWidth+adjustBase,trainHeight,-0.1],[trainWidth+adjustBase,trainHeight,-etr480adjust]])\r\n\tout = MAP(BEZIER(S1)([cc0,cc0,cc0,c0,c4,c4,c2,c2,c3,c3,c3]))(dom2D)\r\n\toutT = R([1,2])(PI/2)(out)\r\n\tout = R([1,3])(-PI/2)(outT)\r\n\treturn out\r\n```\r\n\r\n\r\n\r\n\r\nSome hard work was requested for the front livery: it has been created by overlapping some surfaces. Here's the code in Javascript and relative screenshots.\r\n\r\n```javascript\r\nfunction generateFrontLivery480(){\r\n\tvar adjust = 0.3;\r\n\tvar adjustBase = 0.15;\r\n\tvar leng = 2.13;\r\n\tvar height = 0.9;\r\n\tvar etr480adjust = 0.8;\r\n\tvar adj = 2.9;\r\n\r\n\tvar cc0 = BEZIER(S0)([[0,0,-etr480adjust-0.08],[0,-height/2,-etr480adjust-0.08],[0,-height,-etr480adjust-0.08],[trainWidth,-height,-etr480adjust-0.08],[trainWidth,-height/2,-etr480adjust-0.08],[trainWidth,0,-etr480adjust-0.08]]);\r\n\r\n\tvar c0 = BEZIER(S0)([[0,0,-etr480adjust],[0,0,-0.1],[trainWidth/2,0,height],[trainWidth,0,-0.1],[trainWidth,0,-etr480adjust]]);\r\n\r\n\tvar c1 = BEZIER(S0)([[0,trainHeight/3,-etr480adjust],[0,trainHeight/3,-0.1],[trainWidth/2,trainHeight/3,1],[trainWidth,trainHeight/3,-0.1],[trainWidth,trainHeight/3,-etr480adjust]]);\r\n\r\n\tvar c2 = BEZIER(S0)([[-adjust,trainHeight*3/4,-etr480adjust],[-adjust,trainHeight*3/4,leng],[-adjust,trainHeight*3/4,leng],[trainWidth/2,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,-etr480adjust]]);\r\n\r\n\tvar c3 = BEZIER(S0)([[-adjustBase,trainHeight,-etr480adjust],[-adjustBase,trainHeight,-0.1],[trainWidth/2,trainHeight,1],[trainWidth+adjustBase,trainHeight,-0.1],[trainWidth+adjustBase,trainHeight,-etr480adjust]]);\r\n\r\n\tvar c4 = BEZIER(S0)([[-adjust,trainHeight*2/3,-etr480adjust],[-adjust,trainHeight*2/3,leng+adj],[-adjust,trainHeight*2/3,leng+adj],[trainWidth/2,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,-etr480adjust]]);\r\n\r\n\tvar out = MAP(BEZIER(S1)([cc0,cc0,cc0,c0,c4,c4,c2,c2,c3,c3,c3]))(dom2D);\r\n\tvar outT = R([0,1])(PI/2)(out);\r\n\tout = R([0,2])(-PI/2)(outT);\r\n\treturn COLOR([0.5,0.5,0.5])(STRUCT([T([0])([-etr450adjust+0.1]),out]));\r\n}\r\n\r\nfunction generateFrontRedLivery480(){\r\n\tvar adjust = 0.38;\r\n\tvar adjustBase = 0.23;\r\n\tvar leng = 2.19;\r\n\tvar height = 0.9;\r\n\tvar etr480adjust = 0.9;\r\n\tvar adj = 2.9;\r\n\r\n\tvar cc0 = BEZIER(S0)([[0,0,-etr480adjust-0.08],[0,-height/2,-etr480adjust-0.08],[0,-height,-etr480adjust-0.08],[trainWidth,-height,-etr480adjust-0.08],[trainWidth,-height/2,-etr480adjust-0.08],[trainWidth,0,-etr480adjust-0.08]]);\r\n\r\n\tvar c0 = BEZIER(S0)([[0,0,-etr480adjust],[0,0,-0.1],[trainWidth/2,0,height],[trainWidth,0,-0.1],[trainWidth,0,-etr480adjust]]);\r\n\r\n\tvar c1 = BEZIER(S0)([[0,trainHeight/3,-etr480adjust],[0,trainHeight/3,-0.1],[trainWidth/2,trainHeight/3,1],[trainWidth,trainHeight/3,-0.1],[trainWidth,trainHeight/3,-etr480adjust]]);\r\n\t\r\n\tvar c2 = BEZIER(S0)([[-adjust,trainHeight*3/4,-etr480adjust],[-adjust,trainHeight*3/4,leng],[-adjust,trainHeight*3/4,leng],[trainWidth/2,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,leng],[trainWidth+adjust,trainHeight*3/4,-etr480adjust]]);\r\n\r\n\tvar c3 = BEZIER(S0)([[-adjustBase+0.1,trainHeight,-etr480adjust],[-adjustBase+0.1,trainHeight,-0.1],[trainWidth/2,trainHeight,1],[trainWidth+adjustBase,trainHeight,-0.1],[trainWidth+adjustBase-0.1,trainHeight,-etr480adjust]]);\r\n\r\n\tvar c4 = BEZIER(S0)([[-adjust,trainHeight*2/3,-etr480adjust-0.02],[-adjust,trainHeight*2/3,leng+adj],[-adjust,trainHeight*2/3,leng+adj],[trainWidth/2,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,leng+adj],[trainWidth+adjust,trainHeight*2/3,-etr480adjust-0.02]]);\r\n\r\n\tvar out = MAP(BEZIER(S1)([cc0,cc0,cc0,c0,c4,c4,c2,c2,c3,c3,c3]))(dom2D);\r\n\tvar outT = R([0,1])(PI/2)(out);\r\n\tout = R([0,2])(-PI/2)(outT);\r\n\treturn COLOR([0.7,0,0])(STRUCT([T([0])([-etr450adjust+0.1]),out]));\r\n\r\n}\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nFinally, here's some screenshots of the whole model of ETR 480 or you can see it in action in the _plasm.js_ environment using the source code and the link to _plasm.js_ project (just use the console of your browser).\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n* [ETR 450 - Source code](https://github.com/cvdlab-cg/283934/blob/master/final-project/etr480model.js)\r\n* [Plasm.js environment](http://cvdlab.github.io/plasm.js/) \r\n\r\n\r\n## Source Code\r\nThese are the links for the source code of those 3D models.\r\n* [Javascript ETR 450](https://github.com/cvdlab-cg/283934/blob/master/final-project/etr450model.js)\r\n* [Javascript ETR 480](https://github.com/cvdlab-cg/283934/blob/master/final-project/etr480model.js)\r\n* [Python code of some elements of ETR 450 / ETR 480](https://github.com/cvdlab-cg/283934/blob/master/final-project/modelParts.py)\r\n\r\n\r\n## Credits\r\nPhotos and text from [Wikipedia](http://en.wikipedia.org). \r\nThis data is used for descriptive purpose only. No copyright infringement was intended. \r\nPLaSM, functional language for computing with geometry - [official website](http://www.plasm.net) ","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}