National War Museum
Design Competition Entry
1
//Ashoka Chakra
2
chkC1=Circle.ByCenterPointRadius(Point.Origin(),190);
3
4
chkPc1=PolyCurve.ByPoints(Point.PruneDuplicates(Flatten(Point.ByCoordinates
5
({-4.3182,-2.9278,-1.6079,-5.552,0,5.552,1.6079,2.9278,4.3182},
6
{32.8,32.8903,33.4260,65.2,157.6,65.2,33.4260,32.8903,32.8})<1>.
7
Rotate(Point.Origin(),Vector.ZAxis(),(360..0..#25)<2>)),0.001),true);
8
9
chkA1=Arc.ByThreePoints(Point.ByCoordinates(-8.5,166.5),Point.ByCoordinates(0,158),
10
Point.ByCoordinates(8.5,166.5));
11
chkA2=List.DropItems(chkA1.Rotate(Point.Origin(),Vector.ZAxis(),360..0..#25),1).
12
Rotate(Point.Origin(),Vector.ZAxis(),7.5);
13
chkL2=Line.ByStartPointEndPoint(List.ShiftIndices(chkA2.StartPoint,-1),chkA2.EndPoint);
14
chkPc2=PolyCurve.ByJoinedCurves(Flatten(Transpose({chkA2,chkL2})));
15
16
chkSld1=chkPc1.ExtrudeAsSolid(Vector.ZAxis(),1).Union(chkC1.ExtrudeAsSolid
17
(Vector.ZAxis(),1).Difference(chkPc2.ExtrudeAsSolid(Vector.ZAxis(),1)));
18
chkSrf1=chkSld1.Intersect(Plane.XY());
19
20
//Data file
21
fil1=File.FromPath("..\DataExtraction\\boundaries.xls");
22
23
//Boundary
24
exl4=Excel.ReadFromFile(fil1,("Boundary"+(1..2))<1>,true);
25
exl5=List.DropItems(List.Transpose(exl4<1>)<1><2>,1);
26
exl6=Math.Round(String.ToNumber(exl5),3);
27
minXDed=718180;
28
minYDed=3167444;
29
enx2=List.GetItemAtIndex(exl6<1>,0)-minXDed;
30
eny2=List.GetItemAtIndex(exl6<1>,1)-minYDed;
31
stx2=List.GetItemAtIndex(exl6<1>,3)-minXDed;
32
sty2=List.GetItemAtIndex(exl6<1>,4)-minYDed;
33
ep2=Point.ByCoordinates(enx2,eny2);
34
sp2=Point.ByCoordinates(stx2,sty2);
35
bdpn1=List.SortByKey(sp2[0],{0,1,11,9,10,2,8,6,7,5,4,3});
36
bdry1=Polygon.ByPoints(bdpn1["sorted list"]);
37
bdpn2=List.SortByKey(sp2[1],{0,1,6,5,4,3,2});
38
bdry2=Polygon.ByPoints(bdpn2["sorted list"]);
39
bdry3=Polygon.ByPoints(Flatten({bdpn1["sorted list"][9..10],bdpn2["sorted list"][{1,0,6}]}));
40
bdry4=PolySurface.ByJoinedSurfaces({bdry1.Patch(),bdry3.Patch(),bdry2.Patch()}).PerimeterCurves();
41
42
//Trees
43
exl7=String.ToNumber(Transpose(Excel.ReadFromFile(fil1,("trees"),true)));
44
trpt1=List.FirstItem(List.SortByKey(Point.ByCoordinates(exl7[0]-minXDed,exl7[1]-minYDed,0),exl7[3]));
45
trbl1=bdry1.ContainmentTest(trpt1)||bdry2.ContainmentTest(trpt1);
46
trpt2=List.FilterByBoolMask(trpt1,trbl1)["in"];
47
trsl1=(Circle.ByCenterPointRadius(trpt2,0.5)).ExtrudeAsSolid(Vector.ZAxis(),0.5);
48
49
//Existing Buildings
50
exl1=Excel.ReadFromFile(fil1, ("Building"+(1..18))<1>,true);
51
exl2=List.DropItems(List.Transpose(exl1<1>)<1><2>,1);
52
exl3=Math.Round(String.ToNumber(exl2),3);
53
enx1=List.GetItemAtIndex(exl3<1>,0)-minXDed;
54
eny1=List.GetItemAtIndex(exl3<1>,1)-minYDed;
55
stx1=List.GetItemAtIndex(exl3<1>,3)-minXDed;
56
sty1=List.GetItemAtIndex(exl3<1>,4)-minYDed;
57
ep1=Point.ByCoordinates(enx1,eny1);
58
sp1=Point.ByCoordinates(stx1,sty1);
59
Line.ByStartPointEndPoint(sp1,ep1);
60
61
//Building 0
62
bg1dr1=Vector.ByTwoPoints(sp1[0][2],sp1[0][1]);
63
bg1pt1=sp1[0][1].Translate(bg1dr1,9);
64
bg1pt2=sp1[0][28].Translate(bg1dr1,2);
65
bg1pt3=sp1[0][19].Translate(bg1dr1,1);
66
bg1pt4=bg1pt3.Translate(18,-30,0);
67
bg1pt5=bg1pt4.Translate(0,0,12);
68
69
//Amphiteater
70
ampcir1=Circle.ByCenterPointRadius(bg1pt4,20).ExtrudeAsSolid(Vector.ZAxis(),-4);
71
ampcir2=Circle.ByCenterPointRadius(bg1pt4.Translate(Vector.ZAxis(),-4),12).ExtrudeAsSolid(Vector.ZAxis(),-1);
72
site1=PolyCurve.ByJoinedCurves(bdry4).ExtrudeAsSolid(Vector.ZAxis(),-8);
73
site2=(site1.Difference(ampcir1)).Difference(ampcir2);
74
75
//Corridor
76
crdDir1=Vector.ByTwoPoints(sp1[1][3],sp1[2][2]);
77
crdDir2=Vector.ByTwoPoints(sp1[14][0],sp1[1][3]);
78
crdPnt1=sp1[14][0].Translate(crdDir1,3).Translate(crdDir2,-45);
79
crdPln1=Plane.ByOriginNormal(crdPnt1,crdDir2);
80
crdSld1=Rectangle.ByWidthLength(crdPln1,9,6).Translate(0,0,4.5).ExtrudeAsSolid(crdDir2,290);
81
crdPnt2=crdPnt1.Translate(crdDir2,290).Translate(0,0,-2);
82
83
//Tunnel 1
84
tn1Dir1=Vector.ByTwoPoints(crdPnt2,bg1pt4.Translate(0,0,-2.25));
85
tn1Pln1=Plane.ByOriginNormal(crdPnt2,tn1Dir1);
86
tn1Sld1=Rectangle.ByWidthLength(tn1Pln1,3.5,6).ExtrudeAsSolid(tn1Dir1);
87
tn1Sld2=tn1Sld1.Difference(ampcir1);
88
89
//Tunnel 2
90
tn2Dir1=Vector.ByTwoPoints(bg1pt4.Translate(0,0,-2.25),sp2[0][1].Translate(0,0,-2.25));
91
tn2Pln1=Plane.ByOriginNormal(bg1pt4.Translate(0,0,-2),tn2Dir1);
92
tn2Sld1=Rectangle.ByWidthLength(tn2Pln1,3.5,6).ExtrudeAsSolid(tn2Dir1);
93
tn2Sld2=tn2Sld1.Difference(ampcir1);
94
95
//Vertical Transition
96
vt1Sld1=Circle.ByCenterPointRadius(crdPnt2.Translate(0,0,-2),8).ExtrudeAsSolid(Vector.ZAxis(),14);
97
98
crdSld2=Solid.ByUnion({crdSld1,tn1Sld2,vt1Sld1,tn2Sld2});
99
crdSld3=Solid.ByUnion({crdSld1,vt1Sld1});
100
site3=site2.Difference(crdSld2);
101
site4=site3.Explode()[10];
102
site5=site3.Explode()[0..9];
103
site6=site3.Explode()[12..15];
104
105
//Main Chakra
106
chkSrf2=chkSrf1.Scale(0.1).Translate(bg1pt4.X,bg1pt4.Y,11).Thicken(0.5);
107
chkSrf2A=chkSrf1.Scale(0.1).Translate(bg1pt4.X,bg1pt4.Y,11);
108
109
bg1dr2=Vector.ByTwoPoints(bg1pt1,bg1pt4);
110
bg1dr3=Vector.ByTwoPoints(bg1pt3,bg1pt4);
111
bg1dr4=Vector.ByTwoPoints(bg1pt2,bg1pt4);
112
113
bg1dr10=Vector.ByTwoPoints(sp1[0][10],sp1[0][15]);
114
bg1pt10=sp1[0][10].Translate(bg1dr10,-50);
115
bg1pt11=sp1[0][15].Translate(bg1dr10,20);
116
117
bg1dr11=Vector.ByTwoPoints(bg1pt4,bg1pt10);
118
bg1dr12=Vector.ByTwoPoints(bg1pt4,bg1pt11);
119
120
bg1pt12=(bg1pt10.Translate(0,0,18));
121
bg1pt13=(bg1pt10.Translate(0,0,21)).Translate(bg1dr11,3);
122
bg1pt14=(bg1pt11.Translate(0,0,18));
123
bg1pt15=(bg1pt11.Translate(0,0,21)).Translate(bg1dr12,3);
124
125
bg1ar10=Arc.ByThreePoints(bg1pt10,bg1pt12,bg1pt13);
126
bg1ar11=Arc.ByThreePoints(bg1pt11,bg1pt14,bg1pt15);
127
bg1sr10=Surface.ByLoft({bg1ar10,bg1ar11});
128
129
bg1ar1=Arc.ByThreePoints(bg1pt1,bg1pt3,bg1pt2);
130
bg1cr1=Circle.ByCenterPointRadius(bg1pt4,20);
131
132
bg1ar2=NurbsCurve.ByControlPoints({bg1pt1,(bg1pt1.Translate(0,0,15)).Translate(bg1dr2,4),(bg1pt1.Translate(0,0,45)).Translate(bg1dr2,25),bg1pt5},3);
133
bg1ar3=NurbsCurve.ByControlPoints({bg1pt3,(bg1pt3.Translate(0,0,18)).Translate(bg1dr3,0),(bg1pt3.Translate(0,0,45)).Translate(bg1dr3,21),bg1pt5},3);
134
bg1ar4=NurbsCurve.ByControlPoints({bg1pt2,(bg1pt2.Translate(0,0,15)).Translate(bg1dr4,3),(bg1pt2.Translate(0,0,45)).Translate(bg1dr4,21),bg1pt5},3);
135
bg1sr1=Surface.ByLoft({bg1ar2,bg1ar3,bg1ar4});
136
137
bg1cr1=PolyCurve.ByPoints({bg1pt4,bg1pt10.Translate(bg1dr10,12),bg1pt11.Translate(bg1dr10,-10)},true).Translate(Vector.ZAxis(),3);
138
bg1sl1=bg1cr1.ExtrudeAsSolid(Vector.ZAxis(),15).Difference(Circle.ByCenterPointRadius(bg1pt4,10).ExtrudeAsSolid(Vector.ZAxis(),25));
139
bg1sl2=(bg1sl1.Trim(bg1sr1,bg1pt4)).Trim(bg1sr10,bg1pt10);
140
bg1sr2=Flatten(bg1sl2.Explode())[{1,2,4}];
141
142
bg1sr11={bg1sr1,bg1sr10}.ToNurbsSurface();
143
bg1sr12=TSplineSurface.ByNurbsSurfaceUniform(bg1sr11,8,8,true,true,true);
144
bg1sr13=TSplineSurface.Thicken(bg1sr12,1,true);
145
bg1sr14=bg1sr12[0].WeldCoincidentVertices(0.001);
146
147
bg1msh1=bg1sr13.ToMesh(1,0.01);
148
149
bldg0=Flatten({bg1sr13,bg1sr13,bg1sl2});
150
151
//Function - Building Footprint
152
def bldBdr (sp1:var[]..[],ep1:var[]..[],bn,sq:var[]..[])
153
{
154
blps=List.SortByKey(sp1[bn],sq)["sorted list"];
155
blpe=List.SortByKey(ep1[bn],sq)["sorted list"];
156
blpn=Equals(blps<1>,List.ShiftIndices(blps,1)<1>)?blpe:blps;
157
bldg=PolyCurve.ByPoints(SetUnion(blpn,blpe),true);
158
return=bldg;
159
};
160
161
//Existing Building Footprint
162
bldg1=bldBdr(sp1,ep1,1,{0,1,3,2});
163
bldg2=bldBdr(sp1,ep1,2,{2,0,3,1});
164
bldg3=bldBdr(sp1,ep1,3,{0,2,1,3});
165
bldg4=bldBdr(sp1,ep1,4,{2,3,1,0});
166
bldg5=bldBdr(sp1,ep1,5,{3,0,1,2});
167
bldg6=bldBdr(sp1,ep1,6,{2,3,1,0});
168
bldg7=bldBdr(sp1,ep1,7,{1,2,3,0});
169
bldg8=bldBdr(sp1,ep1,8,{1,0,2,3});
170
bldg9=bldBdr(sp1,ep1,9,{2,0,3,1});
171
bldg10=bldBdr(sp1,ep1,10,{3,0,2,1});
172
bldg11=bldBdr(sp1,ep1,11,{1,0,2,3});
173
bldg12=bldBdr(sp1,ep1,12,{2,0,1,3});
174
bldg13=bldBdr(sp1,ep1,13,{2,3,1,0});
175
bldg14=bldBdr(sp1,ep1,14,{0,3,2,1});
176
bldg15=bldBdr(sp1,ep1,15,{2,3,1,0});
177
bldg16=bldBdr(sp1,ep1,16,{2,3,1,0});
178
bldg17=bldBdr(sp1,ep1,17,{2,3,1,0});
179
180
bldgs={bldg1,bldg2,bldg3,bldg4,bldg5,bldg6,bldg7,bldg8,bldg9,bldg10,bldg11,
181
bldg12,bldg13,bldg14,bldg15,bldg16,bldg17}.ExtrudeAsSolid(Vector.ZAxis(),12);
182
183
//Chakras on buildings
184
bldgs1=bldgs[{0,2,4,6,8,9,10,11,12,13,14,16}].Explode();
185
bld1Sr1=List.GetItemAtIndex(bldgs1<1>,{2,0,1,2,1,2,0,1,0,1,0,0}<1>);
186
bld1Cs1=bld1Sr1.CoordinateSystemAtParameter(0.5,0.5);
187
chkSrf3=((chkSrf1.Scale(0.02))<1>.Transform(bld1Cs1<2>)).Thicken(0.25);
188
189
//Dome
190
dmci1=Circle.ByCenterPointRadius(Point.ByCoordinates(0,0,2),3);
191
dmci2=Circle.ByCenterPointRadius(Point.ByCoordinates(0,0,2.25),2.75);
192
dmci3=Circle.ByCenterPointRadius(Point.ByCoordinates(0,0,2.25),2.5);
193
dmci4=Circle.ByCenterPointRadius(Point.ByCoordinates(0,0,2.75),2.25);
194
dmci5=Circle.ByCenterPointRadius(Point.ByCoordinates(0,0,3.65),1.75);
195
dmci6=Circle.ByCenterPointRadius(Point.ByCoordinates(0,0,4),0.5);
196
dmrc1=Rectangle.ByWidthLength(5.5432772,5.5432772).ExtrudeAsSolid(Vector.ZAxis(),1.5);
197
dmoc1=Polygon.RegularPolygon(dmci1,8).ExtrudeAsSolid(Vector.ZAxis(),-0.5).Rotate(Point.Origin(),Vector.ZAxis(),22.5);
198
dmoc2=Solid.ByLoft({Polygon.RegularPolygon(dmci1,8),Polygon.RegularPolygon(dmci2,8)}).Rotate(Point.Origin(),Vector.ZAxis(),22.5);
199
dmhm1=Solid.ByLoft({dmci3,dmci4,dmci5,dmci6});
200
dome1=Solid.ByUnion({dmrc1,dmoc1,dmoc2,dmhm1});
201
202
bld1Sr2=List.GetItemAtIndex((bldgs.Explode())<1>,({2,1,0,0,1,0,2,0,1,2,0,1,0,1,0,2,0})<1>);
203
bld1Sr3=List.GetItemAtIndex((bldgs.Explode())<1>,({0,3,2,2,3,3,0,2,3,0,2,3,2,3,2,0,2})<1>);
204
bld1Pt1=bld1Sr2.PointAtParameter(0.5,1);
205
bld1Pt2=bld1Sr3.PointAtParameter(0.5,1);
206
bld1Pt3=bld1Sr2.PointAtParameter(1,1);
207
bld1Dr1=Vector.ByTwoPoints(bld1Pt1,bld1Pt2);
208
bld1Dr2=Vector.ByTwoPoints(bld1Pt2,bld1Pt3);
209
//bld1Pt4=bld1Pt1<1>.Translate(bld1Dr1<1>,(6..#14..10)<2>);
210
bld1Pt4=bld1Pt1<1>.Translate(bld1Dr1<2>,(6..#14..10)<2>);
211
bld1Bl1=bld1Pt4.DoesIntersect(bldgs);
212
bld1Pt5=List.FilterByBoolMask(bld1Pt4,bld1Bl1)["in"];
213
bld1cs5=CoordinateSystem.ByOriginVectors(bld1Pt5<1>,bld1Dr2,bld1Dr1,Vector.ZAxis());
214
215
dome11=Solid.ByUnion(Flatten(dmrc1.Transform(bld1cs5)));
216
dome12=Solid.ByUnion(Flatten(Solid.ByUnion({dmoc1,dmoc2}).Transform(bld1cs5)));
217
dome13=Solid.ByUnion(Flatten(dmhm1.Transform(bld1cs5)));
218
domes={dome11,dome12,dome13};
219
220
//Direct Shape
221
dsCat1=Category.ByName("Generic Models");
222
dsSit1=DirectShape.ByGeometry(site4,dsCat1,Material.ByName(".site1"),"nwmSite");
223
dsTre1=DirectShape.ByGeometry(trsl1,dsCat1,Material.ByName(".trees1"),"nwmTrees");
224
dsTun1=DirectShape.ByGeometry(site5,dsCat1,Material.ByName(".tunnel1"),"nwmTunnel");
225
dsCrt1=DirectShape.ByGeometry(site6,dsCat1,Material.ByName(".court1"),"nwmCourt");
226
dsCrd1=DirectShape.ByGeometry(crdSld3,dsCat1,Material.ByName(".corridor1"),"nwmCorridor");
227
dsBl01=DirectShape.ByMesh(bg1msh1[0],dsCat1,Material.ByName(".building01"),"nwmFeature01");
228
dsBl02=DirectShape.ByMesh(bg1msh1[1],dsCat1,Material.ByName(".building02"),"nwmFeature02");
229
dsBl03=DirectShape.ByGeometry(bg1sl2,dsCat1,Material.ByName(".building03"),"nwmGarage");
230
dsBl11=DirectShape.ByGeometry(bldgs,dsCat1,Material.ByName(".building11"),"nwmBuildings");
231
dsDom1=DirectShape.ByGeometry(dome11,dsCat1,Material.ByName(".domes1"),"nwmDomes01");
232
dsDom2=DirectShape.ByGeometry(dome12,dsCat1,Material.ByName(".domes2"),"nwmDomes02");
233
dsDom3=DirectShape.ByGeometry(dome13,dsCat1,Material.ByName(".domes3"),"nwmDomes03");
234
dsChk1=DirectShape.ByGeometry(chkSrf2,dsCat1,Material.ByName(".chakra1"),"nwmChakra01");
235
dsChk2=DirectShape.ByGeometry(chkSrf3,dsCat1,Material.ByName(".chakra2"),"nwmChakra02");
Copied!
Last modified 1yr ago
Copy link