Walden
1
//Tank Position
2
TankCen=Point.ByCoordinates(0,0,720.5);
3
Vantage=TankCen.Translate(Vector.ZAxis(),5.5);
4
Base=TankCen.Translate(Vector.ZAxis(),2);
5
6
//Shrine positions
7
Anjanaya=Point.ByCoordinates(64.982,224.412,741.821);
8
Ganesha=Point.ByCoordinates(7.910,200.187,742.974);
9
ShivaLinga=Point.ByCoordinates(-3.873,42.791,722.440);
10
Subramanya=Point.ByCoordinates(-101.993,227.327,750.097);
11
Shiva=Point.ByCoordinates(-516.424,-23.435,678.037);
12
Dhanwanthari=Point.ByCoordinates(-88.529,-21.002,713.843);
13
Buddha=Point.ByCoordinates(-508.277,-149.171,661.635);
14
Nagas=Point.ByCoordinates(-385.322,-165.240,680.901);
15
Vanadevatha=Point.ByCoordinates(-360.374,-177.952,684.753);
16
Jesus=Point.ByCoordinates(-144.263,-97.897,711.005);
17
Krishna=Point.ByCoordinates(-21.942,-36.820,720.496);
18
19
Shrines=[Krishna,Jesus,Vanadevatha,Nagas,Buddha,Dhanwanthari,Shiva,Subramanya,ShivaLinga,Ganesha,Anjanaya];
20
ShrineConnect=Line.ByStartPointEndPoint(Vantage,Shrines);
21
22
GridSpacing=1;
23
GridMinRadius=6;
24
GridMaxRadius=16;
25
26
//BaseGrid
27
BaseGrid=Point.ByCoordinates((-20..20..GridSpacing)<1>,(-20..20..GridSpacing)<2>,Base.Z);
28
BaseDist=BaseGrid.DistanceTo(Base);
29
30
Cyl1=Cylinder.ByPointsRadius((Point.ByCoordinates(0,0,600)),(Point.ByCoordinates(0,0,800)),GridMaxRadius);
31
Cyl2=Cylinder.ByPointsRadius((Point.ByCoordinates(0,0,600)),(Point.ByCoordinates(0,0,800)),GridMinRadius);
32
Cyl=Cyl1.Difference(Cyl2);
33
ShrineRidges=Flatten(Cyl.Intersect(ShrineConnect));
34
ShrineConnectSurf=Surface.ByRuledLoft(ShrineRidges);
35
ShrineConnectSurfExp=ShrineConnectSurf.Explode();
36
37
//Extents of Walls
38
ShrineSurfPnts1=ShrineConnectSurfExp<1>.Intersect(Flatten(BaseGrid.Project(ShrineConnectSurf,Vector.ZAxis()))<2>);
39
ShrineSurfPnts=Flatten(ShrineSurfPnts1<1>);
40
41
GrdBndBx=(BoundingBox.ByGeometry(Flatten(ShrineSurfPnts1)));
42
GrdBndBxMx=GrdBndBx.MaxPoint;
43
GrdBndBxMn=GrdBndBx.MinPoint;
44
45
//Extent of Roof
46
ShrineRf=Flatten([(Point.ByCoordinates(110.499,-206.013,701.623)),Shrines,(Point.ByCoordinates(207.827,121.375,710.844))]);
47
ShrineRfConnect=Line.ByStartPointEndPoint(Vantage,ShrineRf);
48
CylRf=Cylinder.ByPointsRadius((Point.ByCoordinates(0,0,600)),(Point.ByCoordinates(0,0,800)),(GridMaxRadius+2));
49
ShrineRfRidges=Flatten(CylRf.Intersect(ShrineRfConnect));
50
ShrineRfConnectSurf=Surface.ByLoft(ShrineRfRidges);
51
52
//Group by Height Range-Walls
53
h1=[725.00,726.30];
54
h2=[725.62,727.50];
55
PnGrBl1=(ShrineSurfPnts<1>.Z)>h1<2>&&(ShrineSurfPnts<1>.Z)<h2<2>;
56
PntGrp1=List.FirstItem(List.FilterByBoolMask(ShrineSurfPnts,PnGrBl1<1>)<1>);
57
PntGrp=Transpose(PntGrp1);
58
59
SldDivsPnt=Flatten(PntGrp);
60
SldDivsPntsGrd=Point.ByCoordinates(SldDivsPnt.X,SldDivsPnt.Y,Base.Z);
61
SldDivsBasePln=Plane.ByOriginNormal(Base,Vector.ZAxis());
62
SldDivsBasePro=Rectangle.ByWidthLength(CoordinateSystem.ByOrigin(SldDivsPntsGrd),GridSpacing,GridSpacing);
63
SldDivsBaseSol1=SldDivsBasePro.ExtrudeAsSolid(Vector.ZAxis(),1);
64
SldDivsBaseSol2=Solid.ByUnion(SldDivsBaseSol1);
65
SldDivsBaseSurf=SldDivsBaseSol2.IntersectAll(SldDivsBasePln);
66
SldDivsBasePerCrv=SldDivsBaseSurf.PerimeterCurves();
67
SldDivsBasePerPnt=SldDivsBasePerCrv.StartPoint;
68
SldDivsBasePerNur=NurbsCurve.ByControlPoints(SldDivsBasePerPnt,1,true);
69
SldDivs1=SldDivsBasePerNur.ExtrudeAsSolid(Vector.ZAxis(),3);
70
SldDivs=Solid.ByUnion(List.Clean(Flatten(SldDivs1),false));
71
SldDivsFlr=SldDivs.IntersectAll(Plane.ByOriginNormal(Base,Vector.ZAxis()));
72
BasePerCrv=SldDivsFlr.PerimeterCurves();
73
BasePerPnt=BasePerCrv.StartPoint;
74
BasePerNur=NurbsCurve.ByControlPoints(BasePerPnt,9,true);
75
BaseSol1=BasePerNur.ExtrudeAsSolid(Vector.ZAxis(),6);
76
BaseSol2=BasePerNur.ExtrudeAsSolid(Vector.ZAxis(),[-0.75,-0.3,-3.0]);
77
BaseSol3=BaseSol1.Union(BaseSol2);
78
BaseSol4=(List.Transpose(BaseSol3.Split(ShrineRfConnectSurf)))[0];
79
80
//Frames and Stilts
81
PntsParm=[(0.275..0.475..#5),(0.145..0.3..#4),(-0.01..0.35..#4)];
82
StltHt=[3.6,3,0.25];
83
FrmIntPln=BasePerNur.PlaneAtParameter(PntsParm);
84
frminoff=0.30;
85
frmoutoff=0.15;
86
frmthk=0.3;
87
SolThnShl=BaseSol4.ThinShell(frminoff,frminoff);
88
FrmSur=Flatten(SolThnShl.Intersect(FrmIntPln)<1>);
89
FrmSol1=FrmSur.Thicken(frmthk,true);
90
FrmSol2=Solid.ByUnion(FrmSol1);
91
SolCutPnt=(BoundingBox.ByGeometry(BaseSol4).MinPoint).Translate(Vector.ZAxis(),frminoff+3);
92
SolCutPln=Plane.ByOriginNormal(SolCutPnt,Vector.ZAxis());
93
StltSur=FrmSol2.Intersect(SolCutPln);
94
StltSol=StltSur.Thicken(-(0.1+StltHt),false);
95
FrmSol3=FrmSol2.UnionAll(StltSol);
96
Frms=FrmSol3.Translate(Vector.ZAxis(),-(frminoff));
97
BaseSol5=BaseSol4.DifferenceAll(Frms);
98
99
//Floor Area
100
SldDivsAre=Flatten(SldDivsFlr.Area);
101
102
//Roofs
103
Rfh1=[725.00];
104
Rfh2=[727.50];
105
RfPnGrBl1=(ShrineSurfPnts<1>.Z)>Rfh1<2>&&(ShrineSurfPnts<1>.Z)<Rfh2<2>;
106
RfPntGrp1=List.FirstItem(List.FilterByBoolMask(ShrineSurfPnts,RfPnGrBl1<1>)<1>);
107
RfPntGrp=Transpose(RfPntGrp1);
108
RfDivsPnt=Flatten(RfPntGrp);
109
RfDivsPntsGrd=Point.ByCoordinates(RfDivsPnt.X,RfDivsPnt.Y,Base.Z);
110
RfDivsBasePln=Plane.ByOriginNormal(Base,Vector.ZAxis());
111
RfDivsBasePro=Rectangle.ByWidthLength(CoordinateSystem.ByOrigin(RfDivsPntsGrd),GridSpacing,GridSpacing);
112
RfDivsBaseSol1=RfDivsBasePro.ExtrudeAsSolid(Vector.ZAxis(),1);
113
RfDivsBaseSol2=Solid.ByUnion(RfDivsBaseSol1);
114
RfDivsBaseSurf=RfDivsBaseSol2.IntersectAll(RfDivsBasePln);
115
RfDivsBasePerCrv=RfDivsBaseSurf.PerimeterCurves();
116
RfDivsBasePerPnt=RfDivsBasePerCrv.StartPoint;
117
RfDivsBasePerNur=NurbsCurve.ByControlPoints(RfDivsBasePerPnt,1,true);
118
RfDivs1=RfDivsBasePerNur.ExtrudeAsSolid(Vector.ZAxis(),3);
119
RfDivs=Solid.ByUnion(Flatten(List.Clean(RfDivs1,false)));
120
RfDivsFlr=RfDivs.IntersectAll(Plane.ByOriginNormal(Base,Vector.ZAxis()));
121
RfPerCrv=RfDivsFlr.PerimeterCurves();
122
RfPerPnt=RfPerCrv.StartPoint;
123
RfPerNur=NurbsCurve.ByControlPoints(RfPerPnt,10,true);
124
RfPerCur=RfPerNur.Offset(1.5);
125
RfSol1=RfPerCur.ExtrudeAsSolid(Vector.ZAxis(),6);
126
RfSur=Flatten(RfSol1.IntersectAll(ShrineRfConnectSurf));
127
RfSol=RfSur.Thicken(-0.1);
128
//RfSur=PolySurface.ByJoinedSurfaces(RfSur1);
129
130
//Extent of Openings
131
/*
132
FilPth="E:\\Projects\\India\\2015-AR01-WAL\\Dynamo\\SolarData\\Walden-";
133
OpnExt1=InsValOpn(120000,200000,4.5,5.0,723.0,1.5,1.5,FilPth+"1.csv");
134
OpnExt2=InsValOpn(120000,200000,4.5,4.0,721.0,1.5,1.5,FilPth+"2.csv");
135
OpnExt3=InsValOpn(120000,225000,4.5,4.0,723.5,1.5,1.5,FilPth+"3.csv");
136
OpnExt={OpnExt1,OpnExt2,OpnExt3};
137
138
BaseSol6=BaseSol5.DifferenceAll(OpnExt);
139
BaseSol7=BaseSol5.DifferenceAll(BaseSol6);
140
141
Elements=Flatten({BaseSol6,BaseSol7,Frms,RfSol});
142
*/;
Copied!
1
//Function-Openings based on solar insolation values
2
def InsValOpn(InsMin,InsMax,RecWidFac,RecLenFac,BaseMin,WidPow,LenPow,FlPth)
3
{
4
InsPnt=ImportFromCSV(FlPth);
5
InsolationValue=InsPnt[0];
6
InsRefPnt=Point.ByCoordinates(InsPnt[1]/3.28084,InsPnt[2]/3.28084,InsPnt[3]/3.28084);
7
InsRefDir=Vector.ByCoordinates(InsPnt[4]/3.28084,InsPnt[5]/3.28084,InsPnt[6]/3.28084);
8
//Filter points based on Z coordinate
9
MaskZ=(InsRefPnt.Z)>BaseMin;
10
InsValBas=List.FilterByBoolMask(InsolationValue,MaskZ)["in"];
11
InsPntBas=List.FilterByBoolMask(InsRefPnt,MaskZ)["in"];
12
InsDirBas=List.FilterByBoolMask(InsRefDir,MaskZ)["in"];
13
//Filtering points based on Insolation Values range
14
Mask=InsValBas>InsMin&&InsValBas<InsMax;
15
InsValFil=List.FilterByBoolMask(InsValBas,Mask)["in"];
16
InsPntFil=List.FilterByBoolMask(InsPntBas,Mask)["in"];
17
InsDirFil=List.FilterByBoolMask(InsDirBas,Mask)["in"];
18
//Rectangular Opening
19
RecBndSin=Rectangle.ByWidthLength(Plane.ByOriginNormal(InsPntFil,InsDirFil),RecWidFac/Math.Pow(InsValFil/100000,WidPow),RecLenFac/Math.Pow(InsValFil/100000,LenPow));
20
RecSurSin=Surface.ByPatch(RecBndSin);
21
RecSldSin=RecSurSin.Thicken(1,true);
22
OpnSldCom=Solid.ByUnion(RecSldSin);
23
return=OpnSldCom;
24
};
Copied!
Walden.zip
4KB
Binary
Last modified 1yr ago
Copy link