Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
University of Southern California Dissertations and Theses
/
SolCAD: Three-dimensional spatial design tool to generate solar envelope
(USC Thesis Other)
SolCAD: Three-dimensional spatial design tool to generate solar envelope
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
SOLCAD: 3D SPATIAL DESIGN TOOL TO GENERATE SOLAR ENVELOPE by Manu Juyal A Thesis Presented to the FACULTY OF THE SCHOOL OF ARCHITECTURE UNIVERSITY OF SOUTHERN CALIFORNIA In Partial Fulfillment of the Requirements for the Degree MASTER OF BUILDING SCIENCE May 2002 Copyright 2002 Manu Juyal Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. UMI Number: 1414824 UMI UMI Microform 1414824 Copyright 2003 by ProQuest Information and Learning Company. All rights reserved. This microform edition is protected against unauthorized copying under Title 17, United States Code. ProQuest Information and Learning Com pany 300 North Zeeb Road P.O. Box 1346 Ann Arbor, Ml 4 81 06 -1 34 6 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. U N IV E R S IT Y O F S O U T H E R N C A L IF O R N IA T H E G R A D U A T E S C H O O L U N IV E R S IT Y P A RK LOS A N G E L E S . C A L IF O R N IA 90007 This thesis, w ritten by MAMO under the direction of h}.&. Thesis Committee, and approved by a ll its members, has been pre sented to and accepted by the D ean of The G raduate School, in p a rtia l fu lfillm en t of the requirements fo r the degree of Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. ACKNOWLEDGEMENTS I am highly thankful to Professor Ralph L. Knowles, for making me understand the concept of solar envelope in the best way possible and for his willingness to help me whenever and where possible with his invaluable suggestions. It has been a great pleasure to work under his guidance and a great honor to work on his concept of solar envelope. Professor Marc Schiler, as a teacher for making our foundations strong in environmental studies and inspiring us to look beyond the architecture into other areas of studies and to try to integrate the knowledge in architecture, as a program director, for providing us with a conducive academic environment in the MBS program and as a person for his humbleness, modesty and forgiveness. Prof. Karen Kensek, for her invaluable suggestions during my thesis. Without her devotion and sincerity, this thesis would be impossible. She has guided me throughout my thesis and tried to make my thesis better in every possible way. No words of thanks will be enough for Prof. G.G. Schierle, whose timely and constructive helps during different stages of my thesis have kept my spirits alive throughout. I admire him for his willingness to share his knowledge with me. Finally, I will like to thank Prof. Asish Law for his unconditional help when it was needed the most. He was always willing to take some time out for solving my problems, despite his busy schedule between work and teaching. - Manu Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. TABLE OF CONTENTS iii ACKNOWLEDGEMENTS....................................................................... ii LIST OF FIGURES.................................................................................. v ABSTRACT............................................................................................. viii 1. INTRODUCTION.............................................................................. 1 1.1 Hypothesis............................................................................... 3 1.2 Program Objective.................................................................. 3 2. SOLAR ENVELOPE CONCEPTS.................................................. 5 2.1 Solar Envelope........................................................................ 5 2.2 Solar Path................................................................................ 6 2.3 Solar Access Variables and Calculations............................. 7 2.3.1 Latitude......................................................................... 7 2.3.2 Solar Altitude................................................................ 8 2.3.3 Solar Azimuth (bearing angle).................................... 10 2.3.4 Julian Day..................................................................... 11 2.3.5 Declination.................................................................... 12 2.3.6 Hour Angle.................................................................... 13 2.3.7 Critical Insolation Period (Cut-off time)......................... 13 2.4 Site Variables............................................................................ 15 2.4.1 Site Shape, Size and Orientation................................. 15 2.4.2 Site Lines..................................................................... 16 2.4.3 Fence Lines................................................................. 16 2.5 Solar Envelope for a specified cut-off time......................... 17 2.6 Composite Solar Envelope................................................... 18 3. COMPUTATIONAL METHODS FOR SOLAR ENVELOPES 19 3.1 Solar Envelope Algorithms..................................................... 19 3.1.1 Solid Geometry Method................................................. 19 3.1.2 Surface Geometry Method........................................... 22 3.2 Existing Tools and Methods.................................................. 25 3.2.1 Physical Method............................................................ 25 3.2.2 SolVelope..................................................................... 26 3.2.3 CalcSolar...................................................................... 26 3.3 CAD Files Structure................................................................. 28 3.3.1 DXF Files...................................................................... 28 3.3.2 Structure of DXF file..................................................... 28 3.3.3 Entities.......................................................................... 30 3.4 Geometric Algorithms............................................................ 31 3.4.1 Line-Line Clipping for Grid Layout................................ 32 3.4.2 Line-Line Clipping for Solar Envelope........................... 33 3.5 Parametric Equations............................................................. 34 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. IV 3.5.1 Line-Line Intersection................................................... 34 3.5.2 Plane-Line Intersection................................................ 36 3.6 Hexadecimal Counting System............................................ 37 3.5.1 Converting Hexadecimal number to Decimal number... 38 3.5.2 Converting Decimal number to Hexadecimal number... 39 4. PROGRAM DESIGN....................................................................... 40 4.1 Programming Language...................................................... 40 4.2 Program Structure................................................................ 41 4.2.1 Class SiteLine............................................................. 42 4.2.2 Class FenceLine.......................................................... 45 4.2.3 Class SunPosition........................................................ 46 4.2.4 Class Point3D.............................................................. 48 4.2.5 Class SolarEnvelope................................................... 49 5. HOW TO RUN SOLCAD................................................................. 52 5.1 Working in AutoCAD............................................................. 53 5.2 Working in SolCAD............................................................... 54 5.3 How to view the solar envelope........................................... 58 6. FUTURE IMPROVEMENTS............................................................ 59 6.1 Improvements in Graphic User Interface........................... 59 6.2 Improvements in Implementation of Solar Envelope Concept 61 6.3 Improvements in Data Structure of the Program............... 63 7. CONCLUSIONS.............................................................................. 65 7.1 Advantages........................................................................... 66 7.2 Disadvantages....................................................................... 66 8. BIBLIOGRAPHY............................................................................. 68 9. APPENDICES....................................................................................... 70 9.1 Program Code........................................................................ 70 9.2 Sample Sites.......................................................................... 114 9.3 Input Conditions.................................................................... 115 9.3.1 Rectangular Sites.............................................................. 115 9.3.2 Complex Geomterical Sites............................................... 116 9.4 Output...................................................................................... 117 9.4.1 Rectangular site without fence conditions......................... 117 9.4.2 Rectangular site with varying fence heights...................... 119 9.4.3 Complex site without fence conditions.............................. 121 9.4.4 Complex site with fence line on neighboring properties.... 123 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. V LIST OF FIGURES Figures 2-1: Solar envelope.............................................................................. 5 Figures 2-2: Daily Solar path ( Mazria, 1979).................................................... 6 Figures 2-3: Monthly Solar path ( Mazria,1979)................................................ 7 Figures 2-4: Latutude Map of the USA (Mazria, 1979)...................................... 8 Figures 2-5: Solar Altitude ( Mazria, 1979 )....................................................... 9 Figures 2-6: Solar Azimuth( Mazria, 1979 )....................................................... 10 Figures 2-7: Declination is the earth axis tilt relative to sun’s position............... 11 Figures 2-8: Morning and late afternoon solar angles........................................ 12 Figures 2-9: Effect of cut-off time on a building volume...................................... 13 Figures 2-10: Site variables( Yeh, 1992, p.6)................................................... 14 Figures 2-11 :Site and fence lines for a rectangular site.................................... 15 Figures 2-12:Site and fence lines for irregular site..............................................16 Figures 2-13:Fence lines outside the site............................................................16 Figures 2-14:Yearly limits of an envelope........................................................... 18 Figures 2-15:Composite envelope using yearly limits.........................................18 Figures 3-1 :Sample site and two end moments(Stasinopoulos,20001)........... 20 Figures 3-2:Directions of solar rays at 9.00AM and 3.00PM...............................20 Figures 3-3:Solids for 9.00AM and 3.00PM(Stasinopoulus,20001).................. 21 Figures 3-4:Final solar envelope(Stasinopoulus,20001)................................. 21 Figures 3-5:Definition of site by straight line segments(Knowles,1981) 22 Figures 3-6:Superimposition of grid on site(Knowles,1981)............................. 23 Figures 3-7:Vertical lines at each grid intersection point.................................... 23 Figures 3-8:Vertical heights at 9.00AM(Knowles,1981)................................... 24 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. Figures 3-9:Vertical heights at 10.00AM (Knowles, 1981)...................................24 Figures 3-10:Vertical heights at 11.00AM (Knowles, 1981).................................24 Figures 3-11 :Solar envelope for winter solstice.(Knowles, 1981)........................25 Figures 3-12:Mesh displayed by Solstice............................................................26 Figures 3-13:Mesh displayed by Calcsolar in Autocad.......................................27 Figures 3-14:Grid layout before clipping............................................................. 32 Figures 3-15:Grid layout after clipping ............................................................ 32 Figures 3-16:Vertical lines before clipping.......................................................... 33 Figures 3-17:Clipping at 11.00AM.......................................................................34 Figures 3-18:Intersection of two line.................................................................. 35 Figures 3-19:Intersection of a line and a plane...................................................36 Figures 4-1 Program structures chart.................................................................41 Figures 4-2:SiteLine class structure..................................................................42 Figures 4-3:FenceLine class structure............................................................... 45 Figures 4-4:SunPosition class structure............................................................. 46 Figures 4-5:Point3d class structure.....................................................................48 Figures 4-6:SolarEnvelope class structure..........................................................49 Figures 5-1:Flow chart for single day envelope in SolCAD.................................52 Figures 5-2: Flow chart for composite envelope in SolCAD.................................53 Figures 5-3:Main screen with control options..................................................... 54 Figures 5-4:Main screen with help menu............................................................55 Figures 5-5:lnput dialog box for single day envelope.........................................56 Figures 5-6:lnput dialog box for composite envelope.........................................57 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. vii Figures 5-7: Final display screen........................................................................ 57 Figures 5-8: Using AutoCAD to view the results................................................. 58 Figures 9-1: Rectangular sample site.................................................................. 114 Figures 9-2: Irregular sample site.......................................................................114 Figures 9-3:Rectangular site without fence conditions....................................... 115 Figures 9-4:Rectangular site with varying fence heights......................................115 Figures 9-5:Complex geometrical site without fence conditions........................ 116 Figures 9-6:Complex geometrical site with fence line on neighboring Properties..........................................................................................116 Figures 9-7:Summer Solstice (June,21)...............................................................117 Figures 9-8:Equinox (Sept, 21)............................................................................ 117 Figures 9-9:Winter Solstice (Dec, 21).................................................................. 118 Figures 9-10:Composite envelope..................................................................... 118 Figures 9-11 :Summer Solstice (Dec, 21)........................................................... 119 Figures 9-12:Equinox (Sept,21)......................................................................... 119 Figures 9-13:Winter Solstice (Dec,21)................................................................. 120 Figures 9-14:Composite envelope..................................................................... 120 Figures 9-15:Summer solstice (June, 21)...........................................................121 Figures 9-16:Equinox (Sept, 21)........................................................................ 121 Figures 9-17:Winter Solstice (Dec, 21).............................................................. 122 Figures 9-18:Composite envelope.................................................................... 122 Figures 9-19:Summer solstice (June, 21).......................................................... 123 Figures 9-20:Equinox (Sept, 21)........................................................................ 123 Figures 9-21 :Winter Solstice (Dec, 21).............................................................. 124 Figures 9-22:Composite envelope...................................................................... 124 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. viii ABSTRACT The objective of this thesis is to develop a 3D spatial design tool to construct a solar envelope over a given site based on various design parameters. This program intends to generate an envelope over a site of any shape, size and orientation, for different boundary conditions of shadow lines. The program has a user friendly Graphical User Interface (GUI) that allows easy input and shows the results as three-dimensional graphical output. Due to its ease of use and ability to calculate a wide range of solutions it is hope that this tool will help further the use of the solar envelope as a design and zoning tool. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 1 1 INTRODUCTION “The sun is fundamental to all life. It is the source of our vision, our warmth, our energy and the rhythm of our lives. Its movements inform our perceptions of time and space and our scale in the universe The sun’s rhythm is recognized in all natural processes. It appears in our behavior and in our feelings about the world around us. When our environment pulses in natural time, we seem to know and understand it. When we are isolated from natural recurrence, when we cannot feel natural tempos, we lose contact with a basis of our perceptions To use the sun, one must have access to it. To have access to sun there must be a public recognition of the right to solar access. Access can be achieved by the private design or developmental initiatives, but a commitment expressed as public policy best assures access on an equitable, comprehensive and long term basis” (Knowles, 1981). A solar access zoning policy may be evolved by modifying the existing zoning laws in accordance with the solar envelope design. For the solar access policy to be fair and unambiguous, there must be a balance between the right to develop a property and the right of access to the sun. If the building height and shape can be controlled, an appropriate amount of sunlight in the city for a particular time and space can be insured. San Francisco, for example, safe guards specific open spaces form over shadowing by limiting the heights of adjacent new construction. San Francisco adopted proposition K in 1981, which does not allow new shadow on public open space. New York has over the years, continually uograded its set back restrictions to provide daylight around tall buildings (Noble, Kensek). Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 2 Solar access has recently come into focus as a topic of discussion in the United States because more and more we are looking at the sun as a source of energy. Solar Access has therefore become a legitimate area of public policy. Its main objective is to regulate the conditions when neighbors may be allowed to shadow one another (Knowles, 1981, p.6). There should be a constant honest effort on part of the architects and planners to make sure that the building does not infringe the solar rights of adjacent properties. To address these issues Professor Ralph L. Knowles developed and tested the concept of solar envelope over the period 1976-1993. The solar envelope helps conserve energy and improve the quality of life by guaranteeing access to sunlight during certain period of a day. It can be used to give the guidelines to control building height and shape so that an appropriate amount of sunlight in the city for a particular time period can be insured. He has been testing this concept in upper division design studios at the School of Architecture at the University of Southern California. The results of his research have been published in Energy and Form, Solar Energy, Building and the Law, and Sun Rhythm and Form. All calculations in USC design studios have been done manually. Students calculate solar altitude and azimuth to graphically generate the solar envelope. Physical models are built to assist them in their solar design. Using the physical models and sun-simulating machine, they could actually see the effect of the sun’s movement on their building and on the neighborhood. The entire process of constructing the solar envelope manually can become very time-consuming and complicated for a site with hybrid geometric shape. As a result they do not have enough opportunity and willingness left to explore other useful issues related to Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. solar envelopes. Even for most practicing architects, this process would be too long and time consuming. To be effective as a zoning instrument for urban solar-access, the solar envelope needs a computer tool for quick calculations and visualization. The most important step in this direction will be to develop a CAD tool which can not only check the validity of a given design but can also provide guidelines or suggestions to the designer for further amendments of a design. Past attempts to develop such a tool have not been entirely successful due to their inability to include some desirable spatial and temporal constraints on the envelope’s size and shape. There are various factors, most important being the inability to generate the envelope for a complex geometrical shape and for varying shadow conditions at boundaries. There was also a need for compatibility with CAD programs such as AutoCAD so that the drawing data can be exchanged between the two. The past programs allowed the analysis of one set of data but failed to compare different set of data 1.1 HYPOTHESIS “A new program will enhance the ability to handle more envelope conditions without overly burdening the user and thus discouraging planning and architectural applications." 1.2 PROGRAM OBJECTIVE The solar envelope technique is widely accepted and acknowledged but due to its complexity it needs an expertise in the understanding of basic geography and Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. descriptive geometry. Moreover, the process of constructing a solar envelope manually using physical models can sometimes be very tedious and time consuming especially for the site with a complex geometry. Furthermore, it does not allow the comparison of different time periods, based on weather and sun availability. The development of SolCAD is a step in the direction of making this process simpler for users, both experts and beginners. With the use of SolCAD the construction of solar envelopes can be completed in a few minutes against doing it manually where it can take days and weeks to construct an accurate envelope. SolCAD is compatible with the most widely used CAD tool, AutoCAD. It can also compare the data for different time periods and for different boundary and shadow conditions. The purpose of this tool is not to undermine the importance of manual method of generating the envelope but to complement it with its quick calculating abilities. SolCAD by its interactivity and quick calculations will make the process of generating solar envelopes fast and accurate. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 2 SOLAR ENVELOPE CONCEPTS 5 2.1 SOLAR ENVELOPE A Solar Envelope can be conceived as an imaginary surface covering a site like a roof based on the edge conditions of the site. The slope of its facets is adjusted so as to avoid shading of the surroundings during certain periods of the day. (Stasinopoulos, 2001). The envelope is therefore defined by the passage of time as well as by the constraints of property. Figure 2-1: Solar envelope The solar envelope is a space-time construct. Its spatial limits are defined by the parameters of land parcel size, shape, orientation, topography, latitude and urban context. It also depends on the time or the period of the time for which it is designed. Its time limits are defined by the hours of each day and the season for which solar access is provided to the land parcel (Knowles, 1981, p.2). Its time limits are defined by the movement of the sun from one celestial region to other. The positions of the sun during this movement can be defined by its altitude and Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 6 azimuth. Solar altitude and azimuth are defined by latitude of the place, month and day of the year. The subsequent section describes variables needed to calculate the solar altitude and azimuth in detail. 2.2 SOLAR PATH The path of the earth around the sun influences solar access and thus the solar envelope. As the earth orbits around the sun, it rotates on its axis that extends from the North Pole to the South Pole every 24 hours. The axis is tilted 23.47° from the vertical to the plane of the earth's orbit around the sun. This movement of earth around the sun causes the sun to "rise" and "set". This “apparent” movement of the sun around the earth for different time period plays an important role in constructing a solar envelope. This movement is defined by the daily path, from east in the morning and west in evening (Figure 2-2), and by seasonal path, from south in the winter to north in the summer (Figure 2-3). Figure 2-2: Daily solar path (Mazria, 1979) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 7 Figure 2-3: Monthly solar path (Mazria, 1979) 2.3 SOLAR ACCESS VARIABLES AND CALCULATIONS The relative position of the sun over a place on the earth depends on the latitude of the place, time of the day, day and month. The time of the day can be defined by cut-off times. A start time and an end time define cut-off time boundaries. This time period of a day is also called critical insolation period of that day. The solar envelope need to be defined for the critical insolation period or cut off time. Given these criteria the julian day, angle of declination and hour angle can be calculated. Using these values the position of sun at a given time can be defined in terms of solar altitude and solar azimuth angles at that particular time. 2.3.1 Latitude The Latitude is the angular distance measured along a meridian from the equator, North or South, to a point on the earth's surface. Any location towards the North is considered having positive latitude and towards the South as negative Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 8 latitude. The North and the South poles are +90 and -90 respectively. Latitude values are important as they define the relationships with the sun (Figure 2-4) m rm Figure 2-4: Latitude Map of the USA (Mazria, 1979) 2.3.2 Solar Altitude The solar altitude is the vertical angle between the horizontal and the line connecting to the sun. At sunset/sunrise altitude is 0 and is 90 degrees when the sun is at the zenith. The altitude relates to the latitude of the site, the declination angle and the hour angle (Figure 2-5). Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 9 W Figure 2-5: Solar Altitude (Mazria, 1979) Following is the implementation of solar altitude calculation in SolCAD, sin(Alt) = cos(Lat)*cos(Decl) *cos(HAngle) + sin(Lat) *sin(Dec) where, Alt = Altitude Lat = Latitude Decl = Declination Hangle = Hour Angle The equation was implemented in this program in the following way, decl_r = Radians(23.45 * sin(Radians(datevalue + 284) * 360/365)); hAngle = Radians(15 * (12 - (hour))); sinaltr = cos(lat_r)* cos(decl_r)* cos(hAngle)+ sin(lat_r)* sin(decl_r); cos_alt_r = sqrt(1-(sin_alt_r *sin_alt_r)); altitude_r = atan((sin_alt_r)/(cos_alt_r)); altitude_d = toDegrees(altitude_r); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 2.3.3 Solar Azimuth (bearing angle) The azimuth angle is the angle within the horizontal plane measured from true South or North. The azimuth, when in reference to the South is usually called the bearing. If the sun is East of South, the Bearing is positive, else the bearing is negative (Figure 2-6). s Figure 2-6: Solar Azimuth (Mazria, 1979) Following is the implementation of solar azimuth calculation in SolCAD, x_azm = sin(hour_R) * cos(decl_R) y_azm = -cos(hour_R)*cos(decl_R)*sin(lat_R))+(cos(lat_R)*sin(decl_R) azimuth= atan(x_azm/y_azm) degrees where, Azm = Azimuth Decl = Declination HAngle = Hour angle x_azm = x component of azimuth Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. y_azm = y component of azimuth The equation was implemented in this program in the following way: decl_r = Radians(23.45 * sin(Radians(datevalue + 284) * 360/365)); hAngle = Radians(15 * (12 - (hour))); xazim = .sin(hAngle)* cos(decl_r); yazim = ((-(cos(hAngle))* cos(decl_r)* sin(lat_r))+(cos(lat_r)* sin(decl_r))); azimuth_r = atan(xazim/yazim); azimuth_d = Degrees(azimuth_r); 2.3.4 Julian day Julian date is the number of days from the first day of the year. January 1 has a Julian Day of 1 and December 31 has a Julian day of 365, except in leap years when it has a Julian Day of 366. The following piece of code represents the method to calculate julian day in SolCAD. Each case represents a month from January to December: monthjndex = m; datejndex = d; case 1: j_day = datejndex; break; case 2: j_day = 31 + datejndex; break; case 3: j_day = 59 + datejndex; break; case 4: j_day = 90 + datejndex; break; case 5: j_day = 120 + datejndex; break; case 6: j_day =151+ datejndex; break; case 7: j_day = 181 + datejndex; break; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 12 case 8: j_day = 212 + datejndex; break; case 9: j_day = 243 + datejndex; break; case 10: j_day = 273 + datejndex; break; case 11: j_day = 304 + datejndex; break; case 12: j_day = 334 + datejndex; break; 2.3.5 Declination The angle between the earth-sun line and the equatorial plane is called the declination angle (Figure 2-7). Declination changes with the date and is independent of the location. The declination is maximum (23.45 °) on the summer/winter solstice and 0 on the equinoxes. The declination for a particular day can be represented by the formula: 23.45 * sin(( j_day_value+284) * 360/365) where, j_day_value = Julian day value of the day March June' December September Figure 2-7: Declination is the earth axis tilt relative to sun’s position (Mazria, 1979) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 13 2.3.6 Hour angle The Hour Angle is the angular distance that the earth rotates in a day. It is equal to 15 degrees multiplied by the number of hours from local solar noon. This is based on the nominal time, 24 hours, required for the earth to rotate once i.e. 360 degrees. Values east of due south, morning values are positive; and values west of due south, evening values are negative. The Hour Angle can be defined by Hour Angle = 15 * (12 - hour) Where, hour is the current hour of the day. 2.3.7 Critical Insolation Period (Cut-off time) Cut off time defines the boundaries of the critical insolation period. A critical insolation period is the time period of a day when there is a maximum exposure of the sun at a given place. Cut off time is the start and end time of the critical insolation period. The selection of the cut off time depends on the latitude of the place. For example, the cut-off time of Los Angeles is 10:00AM to 2:00PM in winters and about 9:00 AM to 3:00 PM in summers. However, the cut-off time for Los Angeles will be different from that for New Delhi. Three hours of critical insolation in New Delhi might be adequate instead of four hours in Los Angeles. The cut-off time is a flexible variable when quality of life is a major concern. Comfort zone of people in different locations varies with latitude and local climate. The noon sun might be very desirable in Oregon, but not very welcomed in India. In addition personal preference is also an influential factor. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 14 Once useful periods of solar access are defined, it is important to consider their effect on the geometry of the solar envelope .The longer the period of solar access, the more volumetrically constrained the envelope. This is because the sun’s angle defines the slopes of the envelope. Early morning and late afternoon sun angles are relatively low, while in midday angles are steeper, at all the seasons of the year. Hence, on a daily basis progressively increasing the hours of solar access will set cutoff times that provide progressively less and less building volume under the envelope (Knowles, 1981, p.61). Determining what cut-off times might be used, then, will depend not only on desired inslolation but also on how much building volume is required to accommodate development needs (Knowles, 1981, p.61). A.M. P.M. Figure 2-8: Morning and late afternoon solar angles Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 15 Figure 2-9: Effect of cut-off time on a building volume 2.4 SITE VARIABLES This section describes the spatial constraints of the solar envelope. 2.4.1 Site shape, size and orientation The shape of a site is defined by its geometry, such as square, rectangular, concave polygon, convex polygon etc. The size of the site depends on the dimensions of its sides. Orientation is the angle of rotation of the site from north (Figure 2-10, Figure 2-11, Figure 2-12, Figure 2-13,) surrounding s tre e t • M ■ o < y in site length © Figure 2-10: Site variables (Yeh, 1992, p.6) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 16 2.4.2 Site lines Site lines can be surrounding streets, legal property lines, or any other constraints chosen for the definition of the sites (Figure 2-10, Figure 2-11). SolCAD examines every kind of polygonal shape. It allows shadow s on the surrounding street and adjacent properties. 2.4.3 Fence lines Shadow conditions in SolCAD are defined by fence lines (Figure 2-11, Figure 2-12, Fifgure 2-13). Shadow condition is used to respond to the neighbors of a solar envelope. A site can have different shadow conditions at the boundaries both in terms of height and position of fence lines. SolCAD takes care of these varying boundary conditions. Fence Figure 2-11: Site and fence lines for a rectangular site Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 17 Fence Site line Figure 2-12: Site and fence lines for irregular site Fence Site line Figure 2-13: Fence lines outside the site 2.5 SOLAR ENVELOPE FOR A SPECIFIED CUT-OFF TIME This calculates the solar envelope for a single day. The solar envelope in such a case is defined by the latitude, month, date, start time and end time. It can be for different boundary conditions as specified by the designer or planner. Solar envelope heights are calculated for the different position of sun between the start time and end time. In end the resulting solar envelope has the lowest height at each point on the site, which will satisfy the shadow conditions. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 18 2.6 COMPOSITE SOLAR ENVELOPE For a given set of cut-off times the height of a solar envelope is generally the lowest during the winter solstice, i.e, Dec 21, because the altitude of the sun is the lowest for this period. For the convenience of the designers, SolCAD compares the envelope heights for equinox (Sept21), summer solstice (June 21) and winter solstice (Dec 21) and takes the minimum height at each point on the site for a composite envelope. Figure 2-14: Yearly limits of an envelope Summer W inter Figure 2-15: Composite envelope using yearly limits Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 19 3 COMPUTATIONAL METHODS FOR SOLAR ENVELOPE This section describes the commonly used algorithms, existing tools and methods, and the other issues related to the computational methods of generating solar envelope such as CAD file structure, clipping algorithms, number systems etc. 3.1 SOLAR ENVELOPE ALGORITHMS Two methods for constructing solar envelopes are: 1. Solid Geometry 2. Surface Geometry SolCAD uses the surface geometry method to construct the envelope because it identifies every object to consist of a number of planes or lines. As a result, clipping is faster and more accurate in surfaces than in solids. However, for better understanding of the process of constructing the envelope the basic algorithms behind both methods are discussed below. 3.1.1 Solid Geometry Method The example illustrated here refers to a plot where the maximum permitted building height is H. 1. Two end moments are determined on the sites. These end moments refer to the direction of the sun at start and end times of the solar envelope (Figure. 3-1). Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 20 Figure 3-1: Sample site and two end moments (Stasinopoulos, 20001) 2. Having established the two end moments of insolation, both directions of solar rays are set according to solar azimuth & altitude for the given latitude, day of the year and hour. That data can be obtained through the sun path diagram (Figure. 3-2). Figure 3-2: Directions of solar rays at 9:00AM and 3:00PM (Stasinopoulos, 20001) 3. Two solids are drawn for each position of the sun (9:00AM and 3:00 PM), by extruding the solids in the direction of the sun (Figure. 3-3). Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 21 Figure 3-3: Directions of solar rays at 9:00AM and 3:00PM (Stasinopoulos, 20001) 4. The solar envelope is the intersection of the three solids constructed in the previous steps (Figure. 3-4). Figure 3-4: Final solar envelope (Stasinopoulos, 20001) The shadows of all points within the solar envelope move inside the plot during the selected time period. Because, during that time, the sun moves at Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 22 higher altitude than on the end moments, therefore shadows approach the southern side. 3.1.2 Surface Geometry The site is drawn by a series of straight-line segments with its vertices defined in 3D cartesian or polar coordinate systems. The endpoints of each line segment are defined in terms of x, y, and z coordinates in the space (Figure. 3-5). This allows the site to follow any topography A Figure 3-5: Definition of site by straight line segments (Knowles, 1981) 1. A rectangular grid is superimposed on the site. The grid should be contained with in the site (Figure 3-6). It can be in any orientation and as fine as desired for definition. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 23 Figure 3-6: Superimposition of grid on site (Knowles, 1981) 2. From each grid intersection long vertical lines are draw (Figure 4-7). Figure 3-7: Vertical lines at each grid intersection point. (Knowles, 1981) 3. The sun position is calculated for different times in a given period. A plane is drawn between two consecutive vertices of the site and the position of sun at the given time. The portion of lines above the plane is clipped. This process is repeated with every edge of the site. The result is a matrix of elevation values, each of which touches the envelope at some instant of specified times. This process is repeated for the different times in the specified period (Figure. 4-8), (Figure. 4-9), (Figure. 4-10). Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 24 Figure 3-8: Vertical heights at 9:00AM. (Knowles, 1981) Figure 3-9: Vertical heights at 10:00AM. (Knowles, 1981) Figure 3-10: Vertical heights at 11:00AM. (Knowles, 1981) At the end, the final shape is set by the shortest height attained for each vertical line. Endpoints of these lines can be joined with each other to draw the envelope (Figure. 4-11). The accuracy of the envelope depends on the fineness of the grid. A greater degree of precision can be achieved by making the grid dense. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 25 Figure 3-11: Solar envelope for winter solstice. (Knowles, 1981) 3.2 EXISTING TOOLS AND METHODS This section describes the physical method and the CAD tools for generating solar envelope. 3.2.1 Physical Method So far the most commonly used method to design the envelope at USC and other design schools is by building physical models. The physical method of generating solar envelopes uses descriptive geometry, hand calculator, protractors and physical models. Students calculate solar altitude and azimuth to physically generate the solar envelope. Physical models are built to assist the solar design. Using physical models and a sun-simulating machine, they could actually visualize the effect of the sun’s movement on a building and neighborhood. The entire process of constructing the solar envelope manually is very time-consuming. As a result students do not have enough opportunity and time left to explore other useful issues related to the solar envelope. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 26 3.2.2 SolVelope SolVelope is a computer based tool to generate solar envelope developed in 1992 by Uen-Fang Patricia Yeh as her thesis for the Master of Building Science degree at USC. This program allows users to test the envelope for different latitude, times and dates, site size and orientation and neighboring site conditions such as streets, parks and the adjacent buildings. However, this tool is limited to only rectangular flat sites; Gives ambiguous results for the corner conditions; and also lacks compatability with the existing CAD tools. Figure 3-12: Mesh displayed by SolVelope 3.2.3 CalcSolar CalcSolar program was written in AutoLisp by Karen Kensek at the University of Southern California to resolve some of the computing issues raised by SolVelope. CalcSolar uses the geometric modeling and graphics engine of AutoCAD. The site data and shadow constraints are drawn in AutoCAD, and the program is run integrally. The main advantage of this program is its interactivity. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. This is by far the most The use of AutoCAD engine has allowed this program to use its interactivity and graphical features. However, it is also limited to rectangular sites. Inspite of this shortcoming, CalcSolar is a big jump from SolVelope. i_ _ _ _ _ _ _ _ _ _ . M.A « — i • j Figure 3-13: Mesh displayed by CalcSolar in AutoCAD Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 3.3 CAD FILES STRUCTURE This section discusses the structure of DXF files, the most commonly used graphics information file. It describes the sections of a DXF file structure essential to read and write a DXF file. 3.3.1 DXF files Drawing Interchange Format (DXF) files enable the interchange of drawings between AutoCAD and other programs. DXF files can be either ASCII or binary formats. Because ASCII DXF files are more common than the binary format, SolCAD uses ASCII DXF files for reading data from AutoCAD. DXF files contain a complete description of the AutoCAD drawing. Because much of the data in an AutoCAD drawing does not have an equivalent object type in other programs, the Drawing Interchange Binary (DXB) file format is provided, which creates a simpler geometric description of the drawing (Autodesk, http://www.autodesk.com/techpubs/autocad/acadr14/dxf/) 3.3.2 Structure of DXF file Essentially a DXF file is composed of pairs of codes and associated values. The codes, known as group codes, indicate the type of value that follows. Using these group code and value pairs, a DXF file is organized into sections, which are composed of records, which in turn are composed of a group code and a data item. Each group code and value are on their own line in the DXF file. Each section starts with a group code 0 followed by the string, SECTION. This is followed by a group code 2 and a string indicating the name of the section Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 29 (for example, HEADER). Each section is composed of group codes and values that define its elements. A section ends with a 0 followed by the string ENDSEC. The overall organization of a DXF file is as follows: HEADER section. General information about the drawing is found in this section. It consists of an AutoCAD database version number and a number of system variables. Each parameter contains a variable name and its associated value. CLASSES section. Holds the information for application-defined classes, whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. A class definition is permanently fixed in class hierarchy. TABLES section. This section contains definitions for the following symbol tables. APPID (application identification table) BLOCK_RECORD (block reference table) DIMSTYLE (dimension style table) LAYER (layer table) LTYPE (linetype table) STYLE (text style table) UCS (User Coordinate System table) VIEW (view table) VPORT (viewport configuration table) BLOCKS section. Contains block definition and drawing entities that make up each block reference in the drawing. ENTITIES section. This section contains the graphical objects (entities) in the drawing, including block references (insert entities). Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 30 OBJECTS section. Contains the non-graphical objects in the drawing. All objects that are not entities or symbol table records or symbol tables are stored in this section. Examples of entries in the OBJECTS section are dictionaries that contain mline styles and groups. (Autodesk, http://www.autodesk.com/ techpubs/ autocad/acad r14/dxf/) 3.3.3 Entities Section The Entitities section contains the information about geometrical objects like lines, polylines, Arcs, 3DFACE. This section has all the data that needs to be extracted from DXF files for SolCAD program. The given example shown in (Table 4-1) the sample DXF file showing the details of 3D Polylines. Each instance of Polyline represents a polyline followed by the x, y, z values of its start end points. Each element of the entity section has a unique Hexadecimal number. This number should not be used twice. Care should be taken while writing the data to DXF file that these numbers are not used twice. In the header section is a keyword called HANDSEED, followed by a number, which represents the highest hexadecimal number used. This number is great significance for the subsequent numbering of new elements. The following is an example of the ENTITIES section of a DXF file: 0 SECTION 2 ENTITIES \ Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 31 0 <entity type> 5 <handle> 330 <pointer to owner> 100 AcDbEntity 8 <layer> 100 AcDb<classname> <data> 0 ENDSEC 3.4 GEOMETRIC ALGORITHMS The algorithm used in SolCAD takes its basics from Parametric Line Clipping algorithm, Cohen-Sutherland polygon clipping algorithm and Scanline Algorithm. The new clipping algorithm developed is the combination of these algorithms, tailored to get the desired results. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 32 3.4.1 Line-Line clipping for grid layout A rectangular grid was placed over the site. The boundaries of this grid extend from leftmost, right most, bottom and topmost vertices of the site. Using parametric equations of line, intersection points of gridlines with site edges were calculated. A series of small tests were done using odd parity rule, to ascertain which part of line is to accepted and rejected. All the points to left and right of the edges were rejected. As a result portions of line between the two endpoints and the points of intersection of that line with the site were rejected and rest was accepted. This gives rectangular grid layout contained with in the site boundaries. Figure 3-14: Grid layout before clipping Figure 3-15: Grid layout after clipping Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 33 3.4.2 Line - Plane clipping for solar envelope A plane was drawn between the edge of the site and the position of the sun at a particular point. Sufficiently long vertical lines are drawn from each grid point. Using the parametric equations of plane and line, the intersection point of each line with the plane is calculated. The part of a line above the plane is discarded and the point of intersection becomes the new end point of the line. If a line doesn’t intersect with the plane its start and end points are retained. This process is repeated for all the edges and for a given start time. After completing the clipping for all edges for start time, same process is repeated for the all the hours between start and end time, with end time inclusive. In the end we have the lowest height of the envelope at each point on the site. Sequential recording of the heights is very essential for the further calculations involving the heights of the envelope at the grid intersection points (Figure 4-14, Figure 4-15). Figure 3-16: Vertical lines before clipping Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 34 Figure 3-17: Clipping at 11:00 AM 3.5 PARAMETRIC EQUATIONS 3.5.1 Line-Line intersection The parametric equations of the lines are Pa = P1 + ua (P2 - P1) (Figure 4-12) Pb = P3 + ub (P4 - P3) (Figure 4-12) Solving for the point where Pa = Pb gives the following two equations in two unknowns (ua and ub ) x1 + ua (x2 - x1) = x3 + ub (x4 - x3) and yi + ua (y2 - y1) = y3 + ub (y4 - y3) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 35 P2 line b line a P4 Figure 3-18: Intersection of two lines Solving gives the following expressions for ua and ub < x4 - x3)(y 1 - y 3 ) - (y4 - y 3 )(x l - x3) ua (y 4 - y3)(x2 - x l ) - (x4 - x3)(y2 - y l ) (x2 - x l X y 1 - y 3 ) - (y2 - y l ) ( x l - x3) ub " (y 4 . y3)(x2 - x l ) - (x4 - x3)(y2 - y l ) Substituting either of the above equations into the corresponding equation for the line gives the intersection point. For example the intersection point (x,y) is x = x1 + ua (x2 - x1) y = y1 +ua(y2-y1) Note: The denominators are the same. If the denominator above is 0 then the two lines are parallel. If the denominator and numerator are 0 then the two lines are coincident. The equations above apply to lines, if the intersection of line segments is required then it is only necessary to test if ua and ub lie between 0 and 1. Whichever one lies within that range then the corresponding line segment contains Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 36 the intersection point. If both lie within the range of 0 to 1 then the intersection point is within both line segments. 3.5.2 Plane-Line Intersection The equation of a plane (points P are on the plane with normal N and point P3 on the plane) can be written as N dot (P - P3) = 0 (Figure 4-13) The equation of the line (points P on the line passing through points P1 and P2) can be written as P = P1 + u (P2 - P1) (Figure 4-13) intersection P2 Figure 3-19: Intersection of a line and a plane The intersection of these two occurs when N dot (P1 + u (P2 - P1)) = N dot P3 Solving for u gives _ (x4 - x 3 )(y l - y 3 ) - (y4 - y 3 )(x l - x3) ua - (y 4 _ y3)(x2 - x l ) - (x4 - x3)(y2 - y l ) (x2 - x l X y l - y 3 ) - (y2 - y l ) ( x l - x3) ub (y 4 - y3)(x2 - x l ) - (x4 - x3)(y2 - y l ) Note Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. If the denominator is 0 then the normal to the plane is perpendicular to the line. Thus the line is either parallel to the plane and there are no solutions or the line is on the plane in which case there are an infinite number of solutions. If it is necessary to determine the intersection of the line segment between P1 and P2 then just check that u is between 0 and 1. A plane can also be represented by the equation, A x + By + C z + D = 0, where all points (x,y,z) lie on the plane. Substituting in the equation of the line through points P1 (x1,y1,z1) and P2 (x2,y2,z2) P = P1 + u (P2 - P1) gives A (x1 + u (x2 - x1)) + B (y1 + u (y2 - y1)) + C (z1 + u (z2 - z1)) + D = 0 Solving for u _________A x l + B y 1 + C z 1 + D_________ U = A (x l - x2) + B (y l - y 2 ) + C (z l - z2) Note The denominator is 0 then the normal to the plane is perpendicular to the line. Thus the line is either parallel to the plane and there are no solutions or the line is on the plane in which case are infinite solutions. If it is necessary to determine the intersection of the line segment between P1 and P2 then just check that u is between 0 and 1. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 38 3.6 HEXADECIMAL COUNTING SYSTEM The hexadecimal counting system is a base 16 system. Sixteen possible numbers may represent each digit or slot. Hexadecimal uses the first ten numbers of the decimal system: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The number 10 has two digits so in hexadecimal the letter A represents it. The B represents number 11, C number 12, D number 13, E number 14 and F number 15. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 2 A etc. (Permadi, htto://www.permadi.com/tutorial/numHexToDec/index.html) 3.6.1 Converting Hexadecimal number to Decimal number Steps: (Table 4-2) - Get the last digit of the hex number,call this digit the currentDigit. - Make a variable, let's call it power. Set the value to 0. - Multiply the current digit with (16A power), store the result. - Increment power by 1. - Set the the currentDigit to the previous digit of the hex number. - Repeat step 3 until all digits have been multiplied. - Sum the result of step 3 to get the answer number. Counting the number of digits takes extra time, and one might count wrongly. If one does not remember what a particular value of a power-of-16, it's easy to calculate it from the previous multiplier. For instance, if one does not Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 39 remember what the value of 16A 3 is, then just multiply the value of 16A 2 (which one likely already has if one started backward) with 16. 3.6.2 Converting Decimal to Hexadecimal Steps: - Divide the decimal by 16. - Write down the remainder (in hex). - Divide the result by 16. - Repeat step 2 and 3 until result is 0. - The hex value is the digit sequence of the remainders from the last to first. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 40 4 PROGRAM DESIGN This section describes the overall structure of the program. 4.1 PROGRAMMING LANGUAGE The program is written in Java programming language and has used Java3D library for graphics display. SolCAD is developed using Java because, Java is platform independent. Java programs are compiled to a byte code format that can be read and run by interpreters on many platforms including Windows 95, Windows NT, and Solaris 2.3 and later. Java is Object-Oriented. Almost everything in Java is a class, a method or an object. Only the most basic primitive operations and data types (int, for, while, etc.) are at a sub-object level. Java is considered to be a safe language. Java code can be executed in an environment that prohibits it from introducing viruses, deleting or modifying files, or otherwise performing data destroying and computer crashing operations. Java is inherently multi-threaded. A single Java program can have many different things processing independently and continuously. Java3D is a 3D scene-graph-based graphics programming API for the Java language. Using Java3D library developers can easily incorporate high-quality, scalable, platform-independent 3D graphics into Java. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 4.2 PROGRAM STRUCTURE The program has been organized into the following classes: 41 C O ( /) ( /) LL Figure 4-1: Program structure chart Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 42 4.2.1 Class SiteLine: The siteLine class defines the properties of the site e.g. site coordinates, slopes etc. from Dxf files. It declares and defines the functions to read the information about the site from Dxf files, to draw grid, to arrange grid points, to calculate envelope height and to generate the envelope. PACKAGE THESIS SiteLine Dxf R eaderQ _ This function reads the Dxf file. CreateSiteGraphQ This functions draws the site from the Dxf file. CreateGridBoundQ This function calculates the boundaries of the site grid. DrawGri d ( ) This function calculates and draws a grid within the site. GetGridPointsQ This function calculates grid intersection points and stores them in the objects of Point3D Class. ArrangeGridPointsQ This function arranges the grid intersection points. CalcM eshPointsQ This function calculates Intersection of imaginary lines from each grid intersection Draw Mesh Points ( ) This function draws the Mesh. Figure 4-2: SiteLine class structure 4.2.1.1 Function DxfReaderS() This function reads the Dxf file and parses it to extract the relevant information such as the x, y and z coordinates of the site vertices. It then stores Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 43 this information into an object, points, of another class Point3D. This object is declared globally so that it can be used whenever and wherever necessary. 4.2.1.2 Function CreateSiteGraph() This function draws the site from the information extracted in the above function. A series of lines, defining the edges of the site are drawn between each vertices stored in the object points and is displayed on the screen. 4.2.1.3 Function CreateGridBound() This function calculates the boundaries of the site grid. It also calculates the intersection points of the grid line with the site boundaries using clipping algorithm. All data is stored in an object of DxfPoint class called pointgBound. 4.2.1.4 Function DrawGrid() Using the data for grid points in pointgBound, this function draws a grid with in the site. 4.2.1.5 Function GetGridPoints() This function calculates grid intersection points and stores them in the objects of Point3D class. It stores grid intersection points in vertical direction in the object pointgAIIVMin and in horizontal direction in pointgAIIHMin. It also instantiates two more objects, pointgAIIVMax and pointgAIIHMax, for recording intersection points in vertical and in horizontal directions. These objects will later be used for storing the maximum height of the envelope at each grid intersection point. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 44 4.2.1.6 Function ArrangeGridPoints() This function arranges the grid intersection points first in an increasing order of x-values and then groups the all points with same y-value. It then arranges each group in a row in the increasing order of y-values. 4.2.1.7 Function CalcMeshPoints() This function calculates intersection of imaginary lines from each grid intersection points and plane defined by consecutive edges of site and sun position for a given time period. It stores the highest point of the line in pointgAIIVMax and pointgAIIHMax. At every iteration the x and y values of the vertices in pointgAIIVMax and pointgAIIHMax is updated. In the end vertical height at each grid point is the maximum height of the envelope over that point. 4.2.1.8 Function CompareMeshPoints() This function compares height of the envelope at every grid intersection point for different set of Data and records the minimum for every grid intersection point. 4.2.1.9 Function DrawMesh() This function draws the mesh connecting the all the maximum height of the envelope at each grid intersection point and displays it on the screen. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 45 4.2.2 Class FenceLine The FenceLine class defines the properties of the fence (shadow line) e.g. coordinates, slopes etc. from Dxf files. It declares and defines the functions to read the information about the shadow fence from a Dxf file, to draw the fence and to generate the envelope. PACKAGE THESIS FenceLine D xfR eaderF() This function reads and parsed the Dxf file. 7 ~ I “ ~ I This function draws the fence line from the createFenceG raph() information extracted in the DxfReaderF(). Figure 4-3: FenceLine class structure 4.2.2.1 Function DxfReaderF() This function reads the Dxf file and parses it to extract the relevant information such as the x, y and z coordinates of the site vertices. It then stores this information into an object, pointf, of class DxfPoint. This object is declared globally so that it can be used whenever and wherever necessary. 4.2.2.2 Function CreateFenceGraph() This function draws the fence line from the information extracted in the above function. A series of lines, defining the edges of the fence are drawn between each vertices stored in the object pointf and is displayed on the screen. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 4.2.3 Class SunPosition This class declares and defines the function to calculate solar altitude and azimuth. PACKAGE This function calculates the Julian date This function calculates the altitude of the sun This function calculates the azimuth of the sun Based on Solar azimuth and altitude the X coordinate forsun's current position Is calculated Based on solar azimuth and altitude the Y coordinate for Sun's current location is calculated Based on solar azimuth and altitude the Z coordinate for Sun's current location is calculated. SunPosition SolZposQ JulianD ate() SolYpos() SolXposQ THESIS Figure 4-4: SunPosition class structure 4.2.3.1 Function JulianDate() This function calculates the Julian date 4.2.3.2 Function SolAltitude() This function calculates the altitude of the sun for a given time. 4.2.3.3 Function SolAzimuth() This function calculates the azimuth of the sun for a given time. 4.2.3.4 Function SolXpos() Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 47 Based on solar azimuth and altitude the x coordinate for sun’s current location is calculated. Following equation has been used to get the x-value, x = sundist*sin(Radians(solAzimuth()))*cos(Radians(solAltitude())) where, x = x-value sundist = distance of the sun = 10000000000000.0 approx. solAzimuth = azimuth in degrees solAltitude = altitude in degrees 4.2.3.5 Function SolYpos() Based on the solar altitude and azimuth the y coordinate for sun’s current location is calculated. Following equation has been used to get the y-value, y = sundist*.cos(Radians(solAzimuth()))*cos(Radians(solAltitude())); where, y = y-value sundist = distance of the sun = 10000000000000.0 approx. solAzimuth = azimuth in degrees solAltitude = altitude in degrees 4.2.3.6 Function SolZpos() Based on solar altitude the z coordinate for sun’s current location is calculated Following equation has been used to get the y-value, z = sundist*sin(Radians(solAltitude())) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 48 where, y = y-value sundist = distance of the sun = 10000000000000.0 approx. solAzimuth = azimuth in degrees solAltitude = altitude in degrees 4.2.4 Class Points3d This class stores the information about x, y, z coordinates of a point in the space. GetPoints ( ) SetPoints ( ) Points3d THESIS PACKAGE This function assigns the X ,Y ,Z values of a point to an object of Point3d class. This function returns an object of Point3d class. Figure 4-5: Point3d class structure 4.2.4.1 Function SetPoints() This function assigns the x,y,z values of a point to an object of Point3D class. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 49 4.2.4.2 Function GetPoints() This function returns an object of Point3d class with x, y, z coordinates. 4.2.5 Class SolarEnvelope This is the main class of SolCAD. It instantiates the objects of other classes in its member functions. The member functions of the called classes are used to perform certain operations and to display the final result. PACKAGE THESIS Main function is the default function in main class. This function displaysthe final output on the screen graphicaly. This function divides the original DXF file into two parts and save them into two separate files. This function writes the information into a file and saves in DXF format This compares the data of two files. This gets the irteger value of a number stored in string format This function converts a hexadecimal number into a decimal number. This function gets the hexadecimal value of a number. DivideData ( ) WritetoFile ( ) GetDecimal ( ) C onvertToN um ber() C om pareD ata() GetHexDecimal ( ) M a in () Display ( ) Figure 4-6: SolarEnvelope class structure 4.2.5.1 Function main() This function is the heart of program. Main function is a default function in the main class (SolarEnvelope in SolCAD) of any programming language. The Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 50 compiler reads only the main function of a program to compile the program. The main function is linked to the rest of the program via various class objects and functions. 4.2.5.2 Function DisplayGraph() This function displays the final output on the screen graphically. I takes the data from SiteLine class to represent it graphically. 4.2.5.3 Function DivideData() This function divides the original Dxf File into two parts and stores them separately in two files namely Beginning.txt and Rest.txt. One part has information until the beginning of the ENTITIES section and the other has information about the rest of the file. 4.2.5.4 Function WriteToFile() This function writes the information into a file and saves in DXF or DWG format. This function opens or creates the file to be written. If the file already exists, it over writes the existing file and if not then it creates a new file. First it writes all the information from Beginning.txt to this file, then it adds the new information to this file and in the last it adds the data from Rest.txt to this file. 4.2.5.5 Function CompareData() It compares the data of the two files. It parses the entire file and compares the height envelope at each grid intersection point on site from both sets of data. It then writes the lowest height of envelope over that point. This function can be extended for three or more file also. 4.2.5.6 Function ConvertToNumber() Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 51 It gets the integer value of a number stored in string format. While reading from a file all the numbers read are in the string format. String values cannot be used in number format unless they are converted to number format. So, it is essential to convert all the relevant numbers, converted to string format, back into the decimal format. 4.2.5.7 Function GetDecimal() This function converts a hexadecimal number into a decimal number. To read the values of the HANDSEED, and to figure out the next available value of the handler it is necessary to convert hexadecimal numbers into decimal numbers. 4.2.5.8 Function GetHexDecimal() This function gets the hexadecimal value of a number. This function is particularly useful and repeatedly invoked while saving the data into a file to write all the Hexadecimal numbers, converted to decimal number, back into hexadecimal numbers. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 52 5 HOW TO RUN SOLCAD This section is a step-by-step documentation of how to use SolCAD. It discusses the preparation of preliminary drawings in AutoCAD, importing it into SolCAD and exporting back data to DXF format. FILE MENU INPUT LATITUDE SELECT START & END SolCAD SELECT THE MONTH & DAY INPUT MAX PERM. HEIGHT SAVE THE FILE IN DXF FORMAT SINGLE DAY ENVELOPE SELECT THE DESIRED FILE OPEN SAVED FILE AutoCAD DRAW THE SITE AND FENCE LINES AutoCAD SPECIFY THE NAME OF THE FILE TO BE SAVED SAVE AS SAVE THE FILE NAME AND DISPLAY THE RESULT D IS P LA Y AM P SAVE Figure 5-1: Flow chart for single day envelope in SolCAD Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 53 S A V E FILE 1 S A V E FILE 2 S A V E SELECT FILE 1 SELEC T FILE 2 SolCAD SIN G LE D A Y EN VELO PE C O M PO SITE E N VE LO P E SIN G LE D A Y EN VE LO P E SELECT F ILE N A M E TO BE S A V E D AS OPEN SA VE D FILE AutoCAD Figure 5-2: Flow chart for composite envelope in SolCAD 5.1 WORKING IN AUTOCAD On a new AutoCAD drawing create new layer called SITE or Site or site choose any color and keep line to be continuous type. On menu bar click “Draw” button and choose 3Dpolyline option from the drop down menu. Draw the site boundaries with appropriate x, y , z-coordinates with z = 0.0. The site is to be drawn starting from the vertex with the minimum y -coordinate. Care should in taking north direction. On AutoCAD screen the north will always point up. Create another layer and name it FENCE, Fence or fence. Choose any color and keep linetype as continuous. On menu bar click “Draw” button and choose 3Dpolyline option from the drop down menu. Draw the fence boundaries with appropriate x, y, z coordinates. Draw each site boundary as a single 3D polyline. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 54 Draw two empty layers and name them Envelope and Grid. Though the user can use any name he wants for these two layers but for the sample program we will use these names for layers, (if this step is skipped. SolCAD will automatically save new data into separate layers) Save the drawing first as a .DWG file and then save it as .DXF file, using Save as or Export. 5.2 WORKING IN SOLCAD The control menu (Figure 5-1) has three items, “Single Day Envelope”, “Composite Envelope”, and “Exit”. The first option lets user generate the envelope for a given day, second lets the generation of composite envelope and the third allows user to exit the program. Figure 5-3: Main screen with control options Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 55 The help menu (Figure 5-2) has two items, “About”, “Help Topics”. The first option shows the information about current version and legal information about the software while the second contains the documentation of SolCAD. SolCAD Control [lio ^ l Figure 5-4: Main screen with help menu For a single day envelope: - Select “Single Day Envelope” from control menu. - A pop-up window will appear (Figure 5-3). - Select the name of the DXF file to run. - Select the input for the month, day, start time and end time for which the envelope is desired. - Fill the inputs for the latitude of the place, start time, end time, grid size and the maximum permissible height for the site. The north latitudes have positive values while the south latitudes have negative values. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 56 - Give the name under which the output needs to be saved. Each file should have the extension .Dxf. - Press “Display and Save” to display the solar envelope and to save the result in DXF format. S t M H * • - --------------------------- -- .------------- E tfw w H M N t h r --------------------------------- Month J— y « | w 1....................... CH on lone Stanlkno 1 8 End I m M a w •1 _. - -— —.... ... — - - I LWioto i< . . Is . iGcMSba i| Mox.Ho&t Sow - -................... .............. i Figure 5-5: Input dialog box for single day envelope For Composite Envelope: - To generate the Composite Envelope, the envelopes for all the conditions to be compared should be run individually using single day envelope and results are saved in separate DXF files. - Select “Composite Envelope” from control menu - In the pop-up window that appears (Figure 5-4), select the name of the files to be compared. - Press “Save as” button to select the name of the file to save. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 57 - Select “ Save “ button to save the output as DXF file. Care should taken to give the extension .Dxf after the file name. Select hast I lie hr M hie Fi r st F ito ' Select Second I ilc Second File Se c o n d H e 1 I same te | j sum Figure 5-6: Input dialog box for composite envelope Though SolCAD displays the result on its graphic screen (Figure 5-5) it is highly recommended for the better interactivity that the results be viewed by opening the saved files in AutoCAD or any other CAD program supporting DXF file formats Figure 5-7: Final display screen Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 58 5.3 HOW TO VIEW THE SOLAR ENVELOPE To use the results in design and analysis, it is recommended to open the saved DXF or DWG files in AutoCAD or any other CAD tool supporting DXF file format. Open the AutoCAD program and select the DXF or DWG file to view. Site lines, fence line, grid lines and solar envelope will appear in different layers. Change the color of the layers appropriately for better viewing of the envelope. Select different views and camera angles to see the solar envelope. SE Isometric SW Isometric View ' 4 NE teofnetric View NW isom etric View Figure 5-8: Using AutoCAD to view the results Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 59 6 FUTURE IMPROVEMENTS There are some areas that need improvement for SolCAD to become the CAD tool of choice for designers and planners. 6.1 IMPROVEMENTS IN GRAPHIC USER INTERFACE Challenge It has been a constant effort to make SolCAD a complete drawing and analysis tool. However, currently SolCAD doesn’t allow the user to draw the site and boundary inside the program. To add this feature would be a major improvement. Not only will it increase the usability of the program but will also make many tasks that are very complicated by importing DXF files. Solution New classes specifying the drawing methods for geometric objects like lines, polylines, circles etc can be added using various 2D and 3D drawing algorithms. As the user draws these objects they can be recorded and stored. This information can then be used for drawing grid, mesh etc. Challenge There should be some provision for the user to select the latitude interactively using world map. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 60 Solution Use JPanel component from Java swing menu. Give the world map as its background image. Divide the panel into latitudes and longitudes. Using MouseActionListener class, read the clicked point on the panel. This clicked point should be recorded as the latitude value. Challenge Proper error messages should appear, in case of wrong input. There should be on-screen help to guide the user through the entire process of solar envelope generation. All instructions regarding the usage should be provided on the screen. Solution More time and understanding about designing and programming GUIs is needed for this purpose. GUI coding is vulnerable to various bugging problems. Great care should be taken to create GUI. As far as possible lightweight GUI components should be used from the Java Library. Challenge There can be a provision for calculation and animation for the interstitium space. An interstitium can be defined as an intervening space between the summer and winter solstice but not restricted to the characterstic of either solstice. Solution Once interstitium space has been defined. Generating animation can be done very easily using Java3D graphics utility functions Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 61 6.2 IMPROVMENTS IN IMPLEMENTATION OF SOLAR ENVELOPE Challenge The current program reads a generalized slope without intervening variations in the slope of the site. Future addition in this direction can be to make it read a complex topography. Solution One solution for this problem is to have drawing facility inside the native program itself and let the user draw the topography. The program will store the information about the elevations at various points in the site. Another solution is to draw the information about topography in AutoCAD (Topographic maps are available for most projects) and then read this information in SOLCAD. Before generating the drawing for the site, interpolation must be done to find out the height of the intermediate points in the site. This solution is more practical, since topography is often predefined. Challenge Though the program has been structured in such a way that it can even take internal courtyards into consideration while generating the envelope but due to time constraints, its implementation could not be done. It will be a very useful feature in the program. Solution For implementation some changes need to be made in the way a DXF file is read and data is stored. In AutoCAD courtyard boundaries should be drawn in a Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 62 separate layer and SolCAD reads and stores the information about courtyard in a separate object of Point3D class. While overlaying the grid, it should be first clipped against the site boundaries and then the resulting grid lines are stored in an appropriate data structure. Each grid line is then clipped against courtyard boundaries using odd- parity rule discussed in previous sections. While performing the clipping operation to calculate the height of the solar envelope the courtyard boundaries should be considered to be one of the boundaries of the site Challenge So far, all the CAD tools for solar envelope perform intersection operation while clipping the vertical spikes for generating the mesh. It would be very useful if the difference operation between the heights of envelopes at different points on the site for two different conditions can also be implemented. This can give increase and decrease in the height of the envelope. Solution The implementation is very simple. While comparing the heights at different points on the site, instead of checking for inequality, the heights of the one envelope may be subtracted from the corresponding heights of the other envelope. For the better visualization of the result, both the spike and mesh may be generated. Spikes can be used to give the vertical height, while mesh will give the shape. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 63 The other improvements can be to implement and display the envelope in form of a solid, to implement different time constraints for each fence line. 6.3 IMPROVEMENTS IN DATA STRUCTURE OF THE PROGRAM Challenge The program should be able to share the data with related programs like DOE, SOLSHADE and SHADOW. This will widen the scope of its application and will give the user more options. Solution The file formats of the above mentioned programs must be read and understood very clearly. A proper data structure should be created to read the information from files saved in the above formats. The output should be written in the file formats of the above programs. Challenge SolCAD implements run-time memory allocation by providing dynamic arrays to store the data. However, memory leakage during runtime sometimes causes the slowdown of graphics display. An adequate run time memory allocation need to be provided. Solution Java has a multithreading and serialization class. This classes are very useful to implement as they allow the proper serialization of events. To use Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 64 these classes one must have a proper understanding of the data structures in Java. Other improvements can be to implement functionality where user can query a point to find out the factors contributing to its minimum height. There should be some method or function to detect if the input DXF file is properly drawn. In case of any error a message should be displayed instead of showing the wrong results. There can be some provision to include different number systems to work on and also to include conversion system for numbers. Final graphical display can be made to show a detailed chart showing the user inputs and conditions. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 65 7 CONCLUSIONS Energy conservation is an urgent matter while environmentalism is a common issue today. The solar envelope not only protects the solar rights of adjacent buildings but also determines the shape of the building. It helps in designing environmentally responsive buildings to improve living conditions. There is a need of a tool for accurate calculation and for quick generation of solar envelopes. This was the objective to develop SolCAD. SolCAD is a 3D spatial design tool for architects, designers, building services engineers and planners. It is suitable for initial stages of building design process to determine the shape of the building even before the design has been conceptualized. It provides design as well as the zoning guidelines in terms of an envelope around the site so that if a building confirms to the shape of solar envelope or remains within the envelope, it will not infringe on the solar rights of the neighboring properties. SolCAD gives the user more options and flexibility for generating solar envelopes. It makes up for the deficiencies in past programs. Its compatibility with AutoCAD, is going to further increase its usability. SolCAD gives the spike representation of an envelope against the mesh representation. The spike representation is best suited if the main aim is to get the height of the envelope at a desired point. This kind of representation is helpful in tracking down any point in the site very quickly. However, for the better graphical representation of the shape of an envelope, mesh is preferred. In the mesh form locating a point is cumbersome as one has to traverse through other points on the Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 66 mesh before the desired point. The spike representation can be made to show the shape of the envelope by keeping the spikes as close as possible. Hopefully, CAD tools like SolCAD and and SolVelope will promote the concept of Solar Envelope to conserve non-renewable sources of energy. 7.1 ADVANTAGES This section dicusses the features in SolCAD which are new for constructing solar envelopes. - The most important feature of SolCAD is its ability to read and write DXF files. This has made it compatibile with AutoCAD and FormZ. - SolCAD can analyze sites with different polygonal shapes - SolCAD can analyze sites with generalized slopes. - SolCAD can read the fence lines with varying height conditions both inside the site, over the site lines and outside the site lines. - The time SolCAD takes to give the output is much less than any other CAD tool of same kind 7.2 DISADVANTAGES This section discusses the features not implemented in SolCAD. - SolCAD is not designed to read intervening variations in the site slope. SolCAD is not designed to read internal courtyards. However with some minor modifications it can be made to do so. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 67 8 BIBLIOGRAPHY BOOKS Barrileaux, Jon., 2002, 3D User Interface with Java 3D, Manning Publication Co. Foley, James D.; van Dam, Andries; Feiner, Steven K.; Huges, John F ., 1996, Computer Graphics: Principles and Practice, Second Edition in C, Addison Wesley. Kensek, Karen M; Knowles, Ralph L., 1997, Solar Access Zoning: Computer Generation of the Solar Envelope, The ACSA Southwest Regional Meeting, Albuquerque, New Mexico Knowles, Ralph L., 1974, Energy and Form / An Ecological Approach to Urban Growth, Cambridge , Massachusetts, The MIT Press. Knowles, Ralph L; Kensek, Karen M„ 2000, THE INTERSTITIUM : A Design Strategy for Seasonal Solar Envelopes, Abstract: ASES Solar Strategy for Seasonal Envelopes. Knowles, Ralph L., 1981, Sun Rhythm Form, Cambridge , Massachusetts, The MIT Press. Mazria, Edward., 1979 , The Passive Solar Energy Book, Expanded Professional Edition, Emmaus, Pennsylvania, Rodale Press. Noble, Douglas; Kensek, Karen M.. Solar Access in Architecture: The Computer as a Transformational technology in Solar Envelope Development Schildt, Herbert., 2001, The Complete Reference JavaTM 2, Fourth Edition, McGraw-Hill. Schiler, Marc; Yeh Ueng-Fang., 1993, Solvelope: An Interactive Computer Program for Defining and Drawing Solar Envelopes, Proceedings of the American Solar Energy Society Conference Sowiral, Henry; Rushforth, Kevin; Deering, Michael., 2000, The Java 3DTM API Specification, Second Edition, Addison Wesley. Yeh, Uen-Fang., 1992, Computer Aided Solar Envelope Design, USC Master’s Thesis, Los Angeles, CA INTERNET ADDRESSES, WEBSITES Documentation of DXF file formats by Autodesk Inc. [Online], Available a t: http://www.autodesk.com/techpubs/autocad/acadr14/dxf/, [2001, Sept. 14] Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 68 Dan, Sunday. 2001 [Online], Parametric equations of lines and planes. Calculating line-line and line-plane intersection, Available a t: http://geometryalgorithms com/Archive/algorithm_0104/algorithm_0104.htm, [2001, Oct. 24] Jain, Archit. 1997 [Online], Online solar position calculator and VRML builder, Available at: http://www.usc.edu/dept/architecture/ mbs/ tools/ vrsolar/ Help/ solar_concepts.html, [2001, July 28] Permadi, F. 2001, Oct. [Online], Number conversion systems and methods, Available a t: http://www.permadi.com /tutorial/numHexToDec/index.html, [2002, Jan. 20] Stasinopoulos, Thanos N. 2001, July 3 [Online], Solar Envelope, A construction method using AutoCAD 2000, Available at :http://www.ntua.gr/ arch/geometry/tns/solenvelope/, [2001, August 2]. Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 9 APPENDIX 9.1 PROGRAM CODE SitsLins******************** * Title: SolCAD * Description: This main class of solarEnvelope * This class is the entry point for * the program * Copyright: Copyright (c) 2002 * Institute: University of Southern California * @author Manu Juyal * @version 1.0 * / package thesis; import java.io .*; import java.util.*; import java.io.File.*; import java.lang.Math.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.media.j3d.*; import javax.vecmath.*; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils. behaviors, mouse.*; public class solarEnvelope { public solarEnvelope() { } public static void main(String[] args) { solarEnvelope solarEnvelopel = new solarEnvelope(); Graphicslnterface gui = new Graphicslnterface(); } public static void displayGraph(String inData, int month, int day, double lat, int start, int end, double size) { // usual Swing frames, use a control frame to put // the GUI and a display frame for java3d displays. If we don't do // this the display canvas covers the Swing components JFrame displayFrame = new JFrame( "Display Fram e"); displayFrame.setSize( 1000, 750); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 70 Container displayPane = displayFrame.getContentPane(); Canvas3D canvas = new Canvas3D( null); displayPane.add( canvas); // utilities to build all the superstructures and viewing // info with reasonable defaults. // This puts the viewpoint on the z axis and can display // objects that fit in a sphere of radius ~ 0.8 centered at the // origin. Anything beyond that gets clipped. SimpleUniverse univ = new SimpleUniverse( canvas ); univ.getViewingPlatform( ).setNominalViewingTransform(); TransformGroup vpt = univ.getViewingPlatform().getViewPlatformTransform(); // Create a BranchGroup to serve as root for the scene, by using // our method createSceneGraph, and add it to the simple universe FenceLine fl = new FenceLine(); SiteLine si = new SiteLine(); BranchGroup scenel = fl.createFenceGraph(inData); BranchGroup scene2 = sl.createSiteGraph(inData); BranchGroup scene3 = sl.DrawGrid(size); BranchGroup scene4 = si.DrawMesh(month,day,lat,start,end); univ.addBranchGraph( scenel ); // Defined below univ.addBranchGraph( scen e2); univ.addBranchGraph( scene3); univ.addBranchGraph( scene4); controlFrame.addWindowListener(new WindowAdapter() { // This defines an un-named instance of a local (inner) listener // class that extends // WindowAdapter and overrides the windowClosing method with public void windowClosing(WindowEvent e) { // The event e is ignored System.exit( 0 ); } // End of windowClosing } // End of inner class definition ); // End of 'add' call controlFrame.show(); displayFrame.show(); } // End displayFenceGraph*/ ^ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // This function divides the file into two parts for saving the file public static void DivideData(String inData) throws IOException{ File fToRead = new File(inData); File fbegin = new FilefBeginning.txt"); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 71 File frest = new FilefRest.txt"); FileOutputStream fW_1 = new FileOutputStream(fbegin); FileOutputStream fW_2 = new FileOutputStream(frest); FileReader fR_1 = new FileReader(fToRead); BufferedReader br = new BufferedReader(fR_1); StreamTokenizer st = new StreamTokenizer(br); st.eollsSignificant(true); st.wordChars(' boolean firstPart = true; boolean restPart = false; boolean exit = false; while(true) { if (exit) break; String tempstrl = br.readLine(); if(st.ttype == StreamTokenizer.TT_EOF) { exit = true; } else { if(firstPart==true) { PrintStream pbegin = new PrintStream(fW_1); pbegin.println(tempstr1); if(tempstr1 .equals("ENTITIES")) { firstPart = false; tempstrl = br.readLine(); } } if(firstPart==false) { PrintStream prest = new PrintStream(fW_2); prest.println(tempstr1); if(tempstr1 .equalsfEOF")) { break; } } } } br.close(); } Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 72 ^*************************************************************************** // This function gives the decimal value of the Hexadecimal number public static int GetDecimal(String str){ int len = str.length(); char preChar = ' char currChar = ' String newStr =" double power = len-1; int decNum = 0; double currNum = 0; int Num = 0; for(int i=0; i<len; i++) { currChar = str.charAt(i); switch(currChar) { case 'O': Num = 0; break; case T : Num = 1; break; case '2': Num = 2; break; case '3': Num = 3; break; case '4': Num = 4; break; case '5': Num = 5; break; case '6': Num = 6; break; case '7': Num = 7; break; case '8': Num = 8; break; case '9': Num = 9; break; case 'A': Num = 10; break; case 'B': Num = 11; break; case 'C': Num = 12; break; case 'D': Num = 13; break; case 'E': Num = 14; break; case 'F': Num = 15; break; } currNum = Num*(Math.pow(16.0, power)); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. decNum +=currNum; power--; } return decNum; } ^ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // This gets the hexadecimal value of the decimal number public static String GetHexDecimal(int num){ int remainder; int div = (int)num /16; String preChar = ""; String currChar = ""; String hexDec = ""; while(div!=0) { remainder = num % 16 switch(remainder) { case 0: currChar = "0"; break; case 1: currChar = "1"; break; case 2: currChar = "2"; break; case 3: currChar = "3"; break; case 4: currChar = "4"; break; case 5: currChar = "5"; break; case 6: currChar = "6"; break; case 7: currChar = "7"; break; case 8: currChar = "8"; break; case 9: currChar = "9"; break; case 10: currChar = "A"; break; case 11: currChar = "B"; break; case 12: currChar = "C"; break; case 13: currChar = "D"; break; case 14: currChar = "E"; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 74 break; case 15: currChar = "F"; break; } num = div; div = (int)num /16; hexDec = preChar + currChar; preChar = hexDec; remainder = num % 16; switch(remainder) { case 0: currChar = "0"; break; case 1: currChar = "1"; break; case 2: currChar = "2"; break; case 3: currChar = "3"; break; case 4: currChar = "4"; break; case 5: currChar = "5"; break; case 6: currChar = "6"; break; case 7: currChar = "7''; break; case 8: currChar = "8"; break; case 9: currChar = "9"; break; case 10: currChar = "A"; break; case 11: currChar = "B"; break; case 12: currChar = "C"; break; case 13: currChar = "D"; break; case 14: currChar = "E"; break; case 15: currChar = "F"; break; } hexDec = preChar + currChar; String handseed = ""; for(int i = hexDec.length()-1; i>=0; i--) { handseed += hexDec.charAt(i); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 75 } } return handseed; ****************************************************************************** This function saves the file * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * public static void WriteToFile(String filename) throws IOException{ SiteLine sLine = new SiteLine(); File fBegin = new FilefBeginning.txt"); File fRest = new File("Rest.txt"); File fFinal = new File(filename); FileOutputStream fW_1 = new FileOutputStream(fFinal); // FileOutputStream fW_2 = new FileOutputStream(fRest); FileReader fR_1 = new FileReader(fBegin); FileReader fR_2 = new FileReader(fRest); BufferedReader br1 = new BufferedReader(fR_1); Buffered Reader br2 = new Buffered Reader(fR_2); StreamTokenizer st1 = new StreamTokenizer(brl); StreamTokenizer st2 = new StreamTokenizer(br2); st1 .eollsSignificant(true); st1 .wordChars(' st2.eollsSignificant(true); st2.wordChars(' boolean firstPart = true; boolean secondPart = false; boolean restPart = false; boolean exit = false; boolean done = false; int handseed = 0; while(ldone) { if (done) break; if(st1 .ttype == StreamTokenizer.TT_EOF) { firstPart= false; } String tem pstrl; PrintStream pfinal = new PrintStream(fW_1); while(firstPart==true && secondPart==false && restPart==false) { tempstrl = br1 .readLine(); pfinal.println(tempstr1); if(tempstr1.equals(M $HANDSEED'')) { Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 76 tempstrl = br1 .readLine(); pfinal.println(tempstr1); tempstrl = br1 .readl_ine(); String hexHseed = tem pstrl; handseed = GetDecimal(hexHseed); pfinal.println(tempstr1); } if(tempstr1 .equals("ENTITIES")) { firstPart = false; secondPart = true; restPart = false; } if(firstPart==false && secondPart==true && restPart==false) { handseed = handseed +100; for(int k=0; k<sLine.gnormpointsHMaxSize; k++) { String Hseed = GetHexDecimal(handseed); double x1 = sLine.pointgAIIHMin[k].x; double y1 = sLine.pointgAIIHMin[k].y; double z1 = sLine.pointgAIIHMin[k].z; double x2 = sLine.pointgAIIHMax[k].x; double y2 = sl_ine.pointgAIIHMax[k].y; double z2 = sl_ine.pointgAIIHMax[k].z; pf nal.pr n ln(0); pf nal.pr n ln("LINE"); pf nal.pr n ln(5); pf nal.pr n In(handseed); pf nal.pr n ln(330); pf nal.pr n ln(2); pf nal.pr n ln(100); pf nal.pr n ln("AcDbEntity"); pf nal.pr n ln(8); pf nal.pr n InfEnvelope"); pf nal.pr n ln(100); pf nal.pr n InfAcDbLine"); pf nal.pr n ln(10) pf nal.pr n In(x1) pf nal.pr n ln(20) pf nal.pr n In(y1) pf nal.pr n ln(30) pf nal.pr n In(z1) pf nal.pr n ln(11) pf nal.pr n In(x2) pf nal.pr n ln(21) pf nal.pr n In(y2) pf nal.pr n ln(31) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. pfinal. println(z2); handseed++; } for(int k=0; k<sLine.gnormpointsVMaxSize; k++) { II String Hseed = GetHexDecimal(handseed); double x1 = sLine.pointgAIIVMin[k].x; double y1 = sLine.pointgAIIVMinfkj.y; double z1 = sLine.pointgAIIVMin[k].z; double x2 = sl_ine.pointgAIIVMax[k].x; double y2 = sLine.pointgAIIVMax[k].y; double z2 = sLine.pointgAIIVMax[k].z; pfinal.pr n ln(0); pfinal.pr n ln("LINE"); pfinal.pr n ln(5); pfinal.pr n In(handseed); pfinal.pr n ln(330); pfinal.pr n ln(2); pfinal.pr n ln(100); pfinal.pr n ln("AcDbEntity"); pfinal.pr n ln(8); pfinal.pr n ln("Envelope"); pfinal.pr n ln(100); pfinal.pr n ln("AcDbLine"); pfinal.pr n ln(10) pfinal.pr n In(x1) pfinal.pr n ln(20) pfinal.pr n In(y1) pfinal.pr n ln(30) pfinal.pr n In(z1) pfinal.pr n ln(11) pfinal.pr n In(x2) pfinal.pr n ln(21) pfinal.pr n In(y2) pfinal.pr n ln(31) pfinal.pr n In(z2) handseed++; for(int k=0; k<sLine.numPoints; k++) { String Hseed = GetHexDecimal(handseed); double x1 = sLine.points[k].x; double y1 = sLine.points[k].y; double z1 = sLine.points[k].z; double x2 = sLine.pointsMax[k].x; double y2 = sLine.pointsMax[k].y; double z2 = sLine.pointsMax[k].z; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 78 pfinal.pr n ln(0); pfinal.pr n ln("LINE"); pfinal.pr n ln(5); pfinal.pr n In(handseed); pfinal.pr n ln(330); pfinal.pr n ln(2); pfinal.pr n ln(100); pfinal.pr n ln("AcDbEntity"); pfinal.pr n ln(8); pfinal.pr n ln("Envelope"); pfinal.pr n ln(100); pfinal.pr n ln("AcDbLine"); pfinal.pr n ln(10); pfinal.pr n In(x1); pfinal.pr n ln(20); pfinal.pr n in (yi); pfinal.pr n ln(30); pfinal.pr n In(z1); pfinal.pr n ln(11); pfinal.pr n In(x2); pfinal.pr n ln(21); pfinal.pr n In(y2); pfinal.pr n ln(31); pfinal.pr n In(z2); handseed++; } for(int k=0; k<sLine.gvPointSize; k+=2) { String Hseed = GetHexDecimal(handseed); double x1 = sLine.pointgv[k].x; double y1 = sLine.pointgv[k].y; double z1 = sLine.pointgv[k].z; double x2 = sLine.pointgv[k+1].x; double y2 = sLine.pointgv[k+1].y; double z2 = sLine.pointgv[k+1].z; pf Pf pf Pf Pf Pf Pf Pf Pf Pf pf pf Pf Pf nal.prin nal.prin nal.prin nal.prin nal.pri nal.pr nal.pr nal.pr nal.pr nal.pr nal nal nal. nal pfinal n n n n n n n n n in prin l.pr l.pr l.pr l.pr InC'LINE"); ln(5); In(handseed); ln(330); ln(2); ln(100); ln("AcDbEntity"); ln(8); ln("Grid"); ln(100); ln("AcDbLine"); ln(10); In(x1) ln(20) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. ^ pf pf pf pf pf pf pf pf pf na na na na na na na na na l.pr l.pr l.pr l.pr l.pr l.pr l.pr l.pr l.pr ntln(y1) ntln(30) ntln(z1) ntln(11) ntln(x2) ntln(21) ntln(y2) ntln(31) ntln(z2) handseed++; } for(int k=0; k<sLine.ghPointSize; k+=2) { II String Hseed = GetHexDecimal(handseed); double x1 = sLine.pointgh[k].x; double y1 = sLine.pointgh[k].y; double z1 = sLine.pointgh[k].z; double x2 = sLine.pointgh[k+1].x; double y2 = sLine.pointgh[k+1].y; double z2 = sLine.pointgh[k+1].z; pfinal.pr n \ - / > pfinal.pr n InfLINE"); pfinal.pr n ln(5); pfinal.pr n In(handseed); pfinal.pr n ln(330); pfinal.pr n ln(2); pfinal.pr n ln(100); pfinal.pr n ln("AcDbEntity"); pfinal.pr n ln(8); pfinal.pr n ln("Grid"); pfinal.pr n ln(100); pfinal.pr n ln("AcDbLine”); pfinal.pr n ln(10); pfinal.pr n In(x1); pfinal.pr n ln(20); pfinal.pr n in(yi); pfinal.pr n ln(30); pfinal.pr n In(z1); pfinal.pr n ln(11); pfinal.pr n In(x2); pfinal.pr n ln(21); pfinal.pr n In(y2); pfinal.pr n ln(31); pfinal.pr n In(z2); handseed++; firstPart = false; secondPart = false; restPart = true; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. ^ 80 } String tempstr2; while(firstPart==false && secondPart==false && restPart==true) { tempstr2 = br2.readLine(); pfinal.println(tempstr2); if(tempstr2.equals("EOF")) { firstPart = false; secondPart = false; restPart = false; done = true; } } } br1 ,close(); br2.close(); }//End of fileToWrite(); // This function compares the two files and gives the optimum height at each // gridpoint y y * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * public static void CompareData(String inFile_1, String inFile_2, String outFile) throws IOException{ File fBegin = new File(inFile_1); File fRest = new File(inFile_2); File fCompare = new File(outFile); FileOutputStream fW_1 = new FileOutputStream(fCompare); FileReader fR_1 = new FileReader(fBegin); FileReader fR_2 = new FileReader(fRest); Buffered Reader br1 = new BufferedReader(fR_1); Buffered Reader br2 = new BufferedReader(fR_2); StreamTokenizer st1 = new StreamTokenizer(brl); StreamTokenizer st2 = new StreamTokenizer(br2); st1 .eollsSignificant(true); st1 ,wordChars(' st2.eollsSignificant(true); st2.wordChars(' boolean firstFile = true; boolean secondFile = true; boolean flagLine = false; boolean flagZ = false; boolean exit = false; boolean done = false; int countF = 0; int countL = 0; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 81 while(ldone) { if (done) break; String tem pstrl; String tempstr2; PrintStream pCompare = new PrintStream(fW_1); while(firstFile==true && secondFile==true) { countF++; System.out.println("FOR FILE " + countF); tempstrl = br1 .readLine(); tempstr2 = br2.readLine(); pCompare.println(tempstr1); if(tempstr1.equals("LINE") && tempstr2.equals("LINE")) { countL++; System.out.println("FOR LINE " + countL); flagLine = true; while(flagLine == true) { tempstrl = br1 ,readLine(); tempstr2 = br2.readLine(); pCompare.println(tempstr1); if(tempstr1.equals(,,31,,)&&tempstr2.equals("31")) { flagZ=true; while(flagZ==true) { tempstrl = br1 .readLine(); tempstr2 = br2.readLine(); double z_val_1 = ConvertToNumber(tempstrl); double z_val_2 = ConvertToNumber(tempstr2); if(z_val_1 <z_val_2) {pCompare.println(z_val_1);} else {pCompare.println(z_val_2);} flagZ=false; flagLine=false; } } } } Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. if(tempstr1.equals("E0F")&&tempstr2.equals("E0F,,)) { done = true; firstFile = false; second File = false; } } } br1 .close(); br2.close(); // This function converts a tring in to a number n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * public static double ConvertToNumber(String str) { int length = str.length(); int decim aljndex = str.indexOf('.'); double num1 = 0; double num2 = 0; double b = (length-1 )-decimal_index; for(int i=0; i<decimal_index; i++) { char chr_1 = str.charAt(i); num1 = (num1*10) + ((int)(chr_1) - 48);//); } for(int i=decimal_index+1; idength; i++) { char chr_2 = str.charAt(i); num2 = (num2*10)+((int)(chr_2)-48); } double num = num1+((num2)/Math.pow(10,b)); return(num); } } ^ * * * * * * * * * * * * * * * * * * * * * * ^ LA33 * Title: SolCAD * Description: This class reads the information about * the site from the DXF file and creates a * data structure for that. It then performs * the clipping operation to generate the envelope * Copyright: Copyright (c) 2001 * Company: University of Southern California * @author Manu Juyal * @version 1.0 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 83 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ^ package thesis; import java.io.*; import java.util.*; import java.util.Arrays; import java.io.File.*; import java.math.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.media.j3d.*; import javax.vecmath.*; import javax.vecmath.Vector3d; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.behaviors.mouse.*; public class SiteLine { static Vector vpoints = new Vector(); static Vector vpointsMax = new Vector(); static Vector ghpoints = new Vector(); static Vector gvpoints = new Vector(); static Vector gboundpoints = new Vector(); static Vector gnormpointsHMin = new Vector(); static Vector gnormpointsHMax = new Vector(); static Vector gnormpointsVMin = new Vector(); static Vector gnormpointsVMax = new Vector(); static int gvPointSize; static int ghPointSize; static int gnormpointsHMinSize; static int gnormpointsHMaxSize; static int gnormpointsVMinSize; static int gnormpointsVMaxSize; static DxfPointQpoints = new DxfPoint[20j; static DxfPoint[|pointsMax = new DxfPoint[20]; static int endlDs = 0; static int numPoints; static double t = 0.0; static double u = 0.0; static double Max = 1000.0; static double minX; static double minY; static double maxX; static double maxY; public SiteLineQ { Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 84 } // Read DXF data for the site line //************************************************************************** public static void dxfReaderS(BufferedReader reader) throws IOException{ StreamTokenizer st = new StreamTokenizer(reader); st.eollsSignificant(true); st.wordChars(' boolean exit = false; boolean startPoly = false; boolean startVertex = false; boolean startSite = false; boolean startFence = false; double x; double y; double z; while(true){ if (exit) break; st.nextToken(); if(st.ttype == StreamTokenizer.TT_EOF){ exit = true; } else if(st.ttype == StreamTokenizer.TT_WORD){ if(st. sval. equalsfPO L YLIN E")){ startPoly = true; } else if(st.sval.equals("VERTEX")||st.sval.equals("Vertex") ||st.sval.equals("vertex")){ startVertex = true; startSite = false; } else if(st.sval.equals("SITE")||st.sval.equals(,,Site,,) | |st.sval .equals("site”)){ startSite = true; startFence = false; } else if (st.sval.equals("SEQEND")){ startPoly = false; startVertex = false; } } else if (st.ttype == StreamTokenizer.TT NUMBER && startPoly && Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 85 startVertex && startSite){ if (st.nval == 10){ if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == Stream Tokenizer.TTNUM BER); x = st.nval; if (st.nextToken() == Stream Tokenizer.TTEOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TTJMUMBER); y = st.nval; if (st.nextToken() == StreamTokenizer.TTJEOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); z = st.nval; DxfPoint tempPsI = new DxfPoint(x,y,z); DxfPoint tempPs2 = new DxfPoint(x,y,z); vpoints.addElement(tempPs1); vpointsMax.addElement(tempPs2); endlDs++; } } } // End of while loop numPoints = vpoints.size(); for (int i=0; i<numPoints; i++){ points[i] = (DxfPoint) vpoints.elementAt(i); pointsMax[i] = (DxfPoint) vpointsMax.elementAt(i); } } // end of DxfReaderS * it************************************************************************* Draw the DXF Data on to the screen **************************************************************************** public static BranchGroup createSiteGraph() { BranchGroup branch = new BranchGroup(); try { Point3dQ vertices = new Point3d[numPoints]; for (int i=0 ; i<numPoints; i++){ vertices[i] = new Point3d(points[i].x, points[i].y, points[i].z); } int vertexcount = vertices.length; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 86 into vertexlndices = new int[numPoints+1]; for (int j=0; j<=numPoints; j++){ ifG != numPoints){ vertexlndices [j] = j; } else{vertexlndices 0] = 0;} } int indicescount = vertexlndices.length; into stripLengths = {(numPoints+1)}; IndexedLineStripArray lines = new lndexedLineStripArray(vertexcount, GeometryArray.COORDINATES, indicescount, stripLengths); iines.setCoordinates(0, vertices); lines.setCoordinatelndices(0, vertexlndices); Transform3D transform = newTransform3D(); transform.set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotate = newTransformGroup(transform); TransformGroup objZoom = new TransformGroup(); TransformGroup objTranslate = newTransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZoom.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZoom.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objTranslate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslate.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shape = new Shape3D(lines); branch.addChild(objRotate); objRotate.addChild(shape); MouseRotate myMouseRotate = new MouseRotate(); myMouseRotate.setTransformGroup(obj Rotate); myMouseRotate.setSchedulingBounds(new BoundingSphere()); branch.addChild(myMouseRotate); MouseZoom myMouseZoom = new MouseZoom(); myMouseZoom .setT ransformGroup(objRotate); myMouseZoom.setSchedulingBounds(new BoundingSphere()); branch.addChild(myMouseZoom); MouseTranslate myMouseTranslate = new MouseTranslate(); myMouseT ranslate.setT ransformGroup(objRotate); myMouseTranslate.setSchedulingBounds(new BoundingSphere()); branch.addChild(myMouseTranslate); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 87 branch.compileO; } catch (Exception e){ e.printStackT race(); } return branch; } // end of CreateSiteGraph * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Calculate Grid Intersection Point ******************************************************************************** public static void CalcGridPoint(double GridSize, String inFile) { try { File f1 = new File(inFile); FileReader fr = new FileReader(f 1); Buffered Reader br = new BufferedReader(fr); dxfReaderS(br); br.close(); }catch(Exception e){ e.printStackTrace(); } Vector pointsNew = new Vector(); Vector pointsmaxNew = new Vector(); Point3dQ vertices = new Point3d[numPoints]; for (int i=0 ; i<numPoints; i++) { vertices[i] = new Point3d(points[i].x, points[i].y, points[i].z); } int vertexCount = vertices.length; double Xmin = points[0].x; double Xmax = points[0].x; double Ymin = points[0].y; double Ymax = points[0].y; double temp =0; for (int i=0; i<vertexCount-1; i++) { if (points[i+1].x < Xmin) Xmin = points[i+1].x; } for (int i=0; i<vertexCount-1; i++) { if (points[i+1].x > Xmax) Xm ax = points[i+1].x; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 88 } for (int i=0; i<vertexCount-1; i++) { if (points[i+1].y < Ymin) Ymin = points[i+1].y; } for (int i=0; i<vertexCount-1; i++) { if (points[i+1].y > Ymax) Ymax = points[i+1].y; } for (int i=0; i<numPoints; i++) { if(points[i].y == Ymin) { double xTemp, yTemp,zTemp; for(int j=0; j<numPoints; j++) { if(i==numPoints-1) { xTemp = points[i].x; yTemp = points[ij.y; zTemp = points[i].z; DxfPoint tempi = new DxfPoint(xTemp, yTemp, zTemp); DxfPoint temp2 = new DxfPoint(xTemp, yTemp, zTemp); pointsNew.addElement(temp1); pointsmaxNew.addElement(temp2); i=0; } else { xTemp = points[i].x; yTemp = points[i].y; zTemp = points[i].z; DxfPoint tem pi = new DxfPoint(xTemp, yTemp, zTemp); DxfPoint temp2 = new DxfPoint(xTemp, yTemp, zTemp); pointsNew.addElement(temp1); pointsmaxNew.addElement(temp2); i++; } } break; } minX= Xmin; minY= Ymin; maxX= Xmax; maxY= Ymax; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 89 for(int i=0; i<pointsNew.size(); i++) { points[i]= (DxfPoint)pointsNew.elementAt(i); pointsMax[i]= (DxfPoint)pointsmaxNew.elementAt(i); } boolean islntersect = false; double yCord = Ymin; double iY = yCord; double xCord = Xmin; double iX = xCord; int N = 10; double diflY = GridSize; double diffX = GridSize; System.out.println("Grid lin e"+ diffY); System.out.println("Grid LineX" + diffX ); yCord = yCord + diffY; xCord = xCord + diffX; double xGh =0.0, yGh=0.0, zGh=0.0; double xGv =0.0, yGv=0.0, zGv=0.0; while(iY < Ymax-diffY) { for( int i=0; i<(vertexCount); i++) { if (i==vertexCount-1) { islntersect = lfHGridSitelntersect(points[i].x, points[0].x, Xmin, Xmax,points[i].y, points[0].y, yCord, yCord); if (is Intersect &&(points[i].yl=points[0].y)) { xGh = points[i].x+t*((points[0].x)-(points[i],x)); yGh = points[i].y+t*((points[0].y)-(points[i].y)); zGh = points[ij.z+t*((points[0].z)-(points[i].z)); DxfPoint tempPgh = new DxfPoint(xGh, yGh, zGh); ghpoints.addElement(tempPgh); } } else { islntersect = lfHGridSitelntersect(points[i].x, points[i+1].x, Xmin, Xmax,points[i].y, points[i+1].y, yCord, yCord); if(islntersect&&(points[i].y!=points[i+1].y)) { xGh = points[i].x+t*((points[i+1].x)-(points[i].x)); yGh = points[i].y+t*((points[i+1].y)-(points[i].y)); zGh = points[i].z+t*((points[i+1].z)-(points[i].z)); DxfPoint tempPgh = new DxfPoint(xGh, yGh, zGh); ghpoints.addElement(tempPgh); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 90 } } } yCord = yCord+diffY; iY = iY + diffY; }// End of while ghPointSize = ghpoints.size(); while(iX < Xmax-diffX) { for( int i=0; i<(vertexCount); i++) { if (i==vertexCount-1) { islntersect = lfVGridSitelntersect(points[i].x, points[0].x, xCord, xCord, points[i].y, points[0].y, Ymin, Ymax); if(islntersect && (points[0].x!=points[1].x)) { xGv = points[i].x+t*((points[0].x)-(points[i].x)); yGv = points[i].y+t*((points[0].y)-(points[i].y)); zGv = points[i].z+t*((points[0].z)-(points[i].z)); DxfPoint tempPgv = new DxfPoint(xGv,yGv,zGv); gvpoints.addElement(tempPgv); } } else { islntersect = lfVGridSitelntersect(points[i].x, points[i+1].x, xCord, xCord, points[i].y, points[i+1].y, Ymin, Ymax); if(islntersect&&(points[i] .x!=points[i+1 ] .x)) { xGv = points[i].x+t*((points[i+1].x)-(points[i].x)); yGv = points[i].y+t*((points[i+1].y)-(points[i].y)); zGv = points[i].z+t*((points[i+1].z)-(points[i].z)); DxfPoint tempPgv = new DxfPoint(xGv,yGv,zGv); gvpoints.addElement(tempPgv); } } } xCord = xCord+diffX; iX = iX + diffX; }//End of While loop gvPointSize = gvpoints.size(); } public static BranchGroup DrawGrid() { System.out.println("SIZE "+ghPointSize); System.out.println("SIZEV H +gvPointSize); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 91 DxfPoint[|pointgh = new DxfPoint[ghpoints.size()]; for (int j=0; j<ghPointSize; j++) { pointgh[j] = (DxfPoint) ghpoints.elementAt(j); } DxfPointOpointgv = new DxfPoint[gvpoints.size()]; for (int j=0; j<gvPointSize; j++) { pointgv[j] = (DxfPoint) gvpoints.elementAt(j); } Color3f red = new Color3f(1 .Of, O.Of, O.Of); Color3f green = new Color3f(0.0f, 1 .Of, O.Of); Color3f blue = new Color3f(0.0f, O.Of, 1 .Of); BranchGroup branchl = new BranchGroup(); try { for(int k=0; k<ghPointSize; k+=2) { Point3d vO = new Point3d( pointgh[k].x, pointgh[k].y, pointgh[k].z); Point3d v1 = new Point3d( pointgh[k+1].x, pointgh[k+1].y, pointgh[k+1].z); LineArray line = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3); iine.setCoordinate(0, vO); // First point line.setCoordinate(1, v1); // Second point line.setColor(0, blue); line.setColor(1, blue); Transform3D transform 1 = new Transform3D(); transforml .set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotatel = new TransformGroup(transforml); TransformGroup objZooml = newTransformGroup(); TransformGroup objTranslatel = newTransformGroup(); objRotatel .setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotatel .setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZooml.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZooml.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objTranslatel .setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslatel .setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shapel = new Shape3D(line); branchl .addChild(objRotate1); objRotatel .addChild(shape1); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 92 MouseRotate myMouseRotatel = new MouseRotate(); myMouseRotatel .setTransformGroup(objRotate1); myMouseRotatel ,setSchedulingBounds(new BoundingSphereO); branchl .addChild(myMouseRotate1); MouseZoom myMouseZooml = new MouseZoom(); myMouseZooml .setTransformGroup(objRotate1); myMouseZooml .setSchedulingBounds(new BoundingSphereO); branchl .addChild(myMouseZooml); MouseTranslate myMouseTranslatel = new MouseTranslate(); myMouseTranslatel .setTransformGroup(objRotate1); myMouseTranslatel .setSchedulingBounds(new BoundingSphereO); branchl .addChild(myMouseTranslate1); }// end of for horiz. lines for(int k=0; k<gvPointSize; k+=2) { Point3d v2 = new Point3d(pointgv[k].x, pointgv[k].y, pointgv[k].z); Point3d v3 = new Point3d(pointgv[k+1].x, pointgv[k+1].y, pointgv[k+1].z); LineArray linel = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3); linel .setCoordinate(0, v2); // First point linel .setCoordinate(1, v3); // Second point linel .setColor(0, blue); linel ,setColor(1, blue); Transform3D transform2 = newTransform3D(); transform2.set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotate2 = newTransformGroup(transform2); TransformGroup objZoom2 = new TransformGroup(); TransformGroup objTranslate2 = newTransformGroup(); objRotate2.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate2.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZoom2.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZoom2.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objTranslate2.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslate2.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shape2 = new Shape3D(line1); branchl ,addChild(objRotate2); objRotate2.addChild(shape2); MouseRotate myMouseRotate2 = new MouseRotate(); myMouseRotate2.setTransformGroup(objRotate2); myMouseRotate2.setSchedulingBounds(new BoundingSphereO); branchl. addChild(myMouseRotate2); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 93 MouseZoom myMouseZoom2 = new MouseZoom(); myMouseZoom2.setTransformGroup(objRotate2); myMouseZoom2.setSchedulingBounds(new BoundingSphereO); branchl .addChild(myMouseZoom2); MouseTranslate myMouseTranslate2 = new MouseTranslate(); myMouseTranslate2.setTransformGroup(objRotate2); myMouseTranslate2.setSchedulingBounds(new BoundingSphereO); branchl.addChild(myMouseTranslate2); } branchl.compile(); } catch(Exception e){ e.printStackT race(); } return branchl; } // end of DrawDrid public static boolean lfHGridSitelntersect(double x1, double x2, double x3, double x4, double y1, double y2, double y3, double y4) { double numerator = 0.0; numerator = (x4-x3)*(y1-y3)-(y4-y3)*(x1-x3); double denominator = 1.0; denominator = (y4-y3)*(x2-x1 )-(x4-x3)*(y2-y1); t = numerator / denominator; if (denominator !=0.0 && t>0 && t<=1 &&(y1 !=y2)) return true; else return false; } public static boolean lfVGridSitelntersect(double x1, double x2, double x3, double x4, double y1, double y2, double y3, double y4) { double numerator = 0.0; numerator = (x4-x3)*(y1-y3)-(y4-y3)*(x1-x3); double denominator = 1.0; denominator = (y4-y3)*(x2-x1 )-(x4-x3)*(y2-y1); t = numerator / denominator; if (denominator !=0.0 && t>0 && t<=1 &&(x1 I=x2)) return true; else return false; } Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 94 public static boolean lflntersect(double x1, double x2, double x3, double x4, double y1, double y2, double y3, double y4) { double numerator = 0.0; numerator = (x4-x3)*(y1-y3)-(y4-y3)*(x1-x3); double denominator = 1.0; denominator = (y4-y3)*(x2-x1 )-(x4-x3)*(y2-y1); t = numerator / denominator; if (denominator !=0.0 && t>=0 && t<=1) return true; else return false; } public static void GetGridPoints(double GridSize, String inFile) { double xGnorm =0.0, yGnorm=0.0, zGnorm=0.0; CalcGridPoint(GridSize, inFile); DxfPoint[|pointgh = new DxfPoint[ghpoints.size()]; DxfPointOpointgv = new DxfPoint[gvpoints.size()]; for (int j=0; j<ghPointSize; j++) { pointghD] = (DxfPoint) ghpoints.elementAt(j); } for (int j=0; j<gvPointSize; j++) { pointgv[j] = (DxfPoint) gvpoints.elementAt(j); } boolean islntersect; try { for(int i=0; i<ghPointSize; i+=2) { for(int j=0; j<gvPointSize; j+=2) { islntersect = lflntersect(pointgh[i].x,pointgh[i+1].x, pointgv[j].x,pointgv[j+1].x, pointgh[i].y,pointgh[i+1].y, pointgv[j].y,pointgv[j+1].y); if(islntersect==true) { xGnorm = pointgh[i].x+t*((pointgh[i+1].x)-(pointgh[i].x)); yGnorm = pointgh[ij.y+t*((pointgh[i+1].y)-(pointgh[i].y)); zGnorm = pointgh[i].z+t*((pointgh[i+1].z)-(pointgh[ij.z)); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 95 DxfPoint tempPgnormH = new DxfPoint(xGnorm,yGnorm,zGnorm); DxfPoint tempPgnormHmax = new DxfPoint(xGnorm,yGnorm,zGnorm); DxfPoint tempPgnormV = new DxfPoint(xGnorm,yGnorm,zGnorm); DxfPoint tempPgnormVmax = new DxfPoint(xGnorm,yGnorm,zGnorm); gnormpointsHMin.addElement(tempPgnormH); gnormpointsHMax.addElement(tempPgnormHmax); } } } }catch(Exception e){ e.printStackT race(); } } Arranging the Grid Points in the order public static void ArrangeGridPoints(double GridSize, String inFile) { GetGridPoints( GridSize, inFile); DxfPoint[|pointgh = new DxfPoint[ghpoints.size()]; for (int j=0; j<ghPointSize; j++) { pointgh[j] = (DxfPoint) ghpoints.elementAt(j); } for(int i =0; i<ghPointSize; i++) { DxfPoint tempPgnorm = new DxfPoint((pointgh[i].x) ,(pointgh[i].y), (pointgh[i].z)); gnormpointsHMin.addElement(tempPgnorm); } gnormpointsHMinSize = gnormpointsHMin.size(); DxfPoint[|pointgAIIHMin = new DxfPoint[gnormpointsHMinSize]; for(int j =0; j<gnormpointsHMinSize; j++) { pointgAIIHMinQ] = (DxfPoint)gnormpointsHMin.elementAt(j); } for(int k=0; k<gnormpointsHMinSize; k++) { for(int j = 0; j<gnormpointsHMinSize; j++) { if((pointgAIIHMin[k].x > pointgAIIHMin[j].x)&& (pointgAIIHMin[k].y==pointgAIIHMin[j].y)) { DxfPoint temp = pointgAIIHMin[k]; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. pointgAIIHMin[k] = pointgAIIHMin[j]; for(int i =k; i>j; i--) { pointgAII HM in[i] = pointgAIIHMin[i-1 ]; } pointgAIIHMin[j] = temp; break; } } } for(int j = 0; j<gnormpointsHMinSize; j++) { for (int k=0; k<gnormpointsHMinSize; k++) { if((pointgAIIHMin[j].x < pointgAIIHMin[k].x)&& (pointgAIIHMin[j].y==pointgAIIHMin[k].y)) { DxfPoint temp = pointgAIIHMin[j]; pointgAIIHMin[j] = pointgAIIHMin[k]; pointgAIIHMin[k] = temp; } } } gnormpointsHMin.removeAIIEIementsO; for(int j =0; j<gnormpointsHMinSize; j++) { gnormpointsHMin.addElement(pointgAIIHMin[j]); } DxfPointQpointgv = new DxfPoint[gvpoints.size()]; for (int j=0; j<gvPointSize; j++) { pointgv[j] = (DxfPoint) gvpoints.elementAt(j); } for(int i =0; i<gvPointSize; i++) { DxfPoint tempPgnorm = new DxfPoint((pointgv[i].x),(pointgv[i].y) ,(pointgv[i].z)); gnormpointsVMin.addElement(tempPgnorm); } gnormpointsVMinSize = gnormpointsVMin.size(); DxfPointQ pointgAIIVMin = new DxfPoint[gnormpointsVMinSize]; for(int j =0; j<gnormpointsVMinSize; j++) { Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 97 pointgAIIVMin[j] = (DxfPoint)gnormpointsVMin.elementAt(j); } for(int i =0; i<ghPointSize; i++) { DxfPoint tempPgnorm = new DxfPoint((pointgh[i].x),(pointgh[i].y), (pointgh[i].z)); gnormpointsHMax.addElement(tempPgnorm); } gnormpointsHMaxSize = gnormpointsHMax.size(); DxfPointQ pointgAIIHMax = new DxfPoint[gnormpointsHMaxSize]; for(int j =0; j<gnormpointsHMaxSize; j++) { pointgAIIHMax[j] = (DxfPoint)gnormpointsHMax.elementAt(j); } for(int k=0; k<gnormpointsHMaxSize; k++) { for(int j = 0; j<gnormpointsHMaxSize; j++) { if((pointgAIIHMax[k].x > pointgAIIHMax[j].x)&& (pointgAIIHMax[k].y==pointgAIIHMax[j].y)) { DxfPoint temp = pointgAIIHMax[k]; pointgAIIHMax[k] = pointgAIIHMaxjj]; for(int i =k; i>j; i~) { pointgAIIHMax[i] = pointgAIIHMax[i-1]; } pointgAIIHMaxG] = temp; break; } } } for(int j = 0; j<gnormpointsHMaxSize; j++) { for (int k=0; k<gnormpointsHMaxSize; k++) { if((pointgAIIHMax[j].x < pointgAIIHMax[k].x)&& (pointgAIIHMaxG].y==pointgAIIHMax[k].y)) { DxfPoint temp = pointgAIIHMaxQ]; pointgAIIHMaxG] = pointgAIIHMax[k]; pointgAIIHMax[k] = temp; } } } gnormpointsHMax.removeAIIEIementsO; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 98 for(int j =0; j<gnormpointsHMaxSize; j++) { gnormpointsHMax.addElement(pointgAIIHMax[j]); } for(int i =0; i<gvPointSize; i++) { gnormpointsVMax.addElement(gnormpointsVMin.elementAt(i)); } gnormpointsVMaxSize = gnormpointsVMax.size(); DxfPointQ pointgAIIVMax = new DxfPoint[gnormpointsVMaxSize]; for(int j =0; j<gnormpointsVMaxSize; j++) { pointgAIIVMax[j] = (DxfPoint)gnormpointsVMax.elementAt(j); } } Calculate the mesh points public static void CalcMeshPoints(int m, int d, double I, int tim e l, int time2, double GridSize, String inFile, FenceLine fLine) { ArrangeGridPoints(GridSize, inFile); DxfPointOpointgAIIHMin = new DxfPoint[gnormpointsHMinSize]; for(int j =0; j<gnormpointsHMinSize; j++) { pointgAIIHMin[j] = (DxfPoint)gnormpointsHMin.elementAt(j); } DxfPointQpointgAIIHMax = new DxfPoint[gnormpointsHMaxSize]; for(int j =0; j<gnormpointsHMaxSize; j++) { pointgAIIHMax[j] = (DxfPoint)gnormpointsHMax.elementAt(j); } DxfPoint|]pointgAIIVMin = new DxfPoint[gnormpointsVMinSize]; for(int j =0; j<gnormpointsVMaxSize; j++) { pointgAIIVMinp] = (DxfPoint)gnormpointsVMin.elementAt(j); } DxfPoint[|pointgAIIVMax = new DxfPoint[gnormpointsVMaxSize]; for(int j =0; j<gnormpointsVMinSize; j++) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 99 { pointgAIIVMaxO] = (DxfPoint)gnormpointsVMax.elementAt(j); } for(int k=0; k<gnormpointsHMaxSize; k++) { pointgAIIHMax[k].z = 1000.0; } for(int k=0; k<gnormpointsVMaxSize; k++) { pointgAIIVMax[k].z= 1000.0; } for(int k=0; k<numPoints; k++) { pointsMax[k].z = 1000.0; } for(int k=0; k<gnormpointsHMaxSize; k++) { pointgAIIHMax[k].x = FormatDecimal(pointgAIIHMax[k].x); pointgAIIHMax[k].y = FormatDecimal(pointgAIIHMax[k].y); pointgAIIHMin[k].x = FormatDecimal(pointgAIIHMin[k].x); pointgAIIHMin[k].y = FormatDecimal(pointgAIIHMin[k].y); } for(int k=0; k<gnormpointsVMaxSize; k++) { pointgAIIVMax[k].x = FormatDecimal(pointgAIIVMax[k].x); pointgAIIVMax[k].y = FormatDecimal(pointgAIIVMax[k].y); pointgAIIVMin[k].x = FormatDecimal(pointgAIIVMin[k].x); pointgAIIVMin[k].y = FormatDecimal(pointgAIIVMin[k].y); } for(int k=0; k<numPoints; k++) { points[k].x = FormatDecimal(points[k].x); points[k].y = FormatDecimal(points[k].y); pointsMax[k].x = FormatDecimal(pointsMax[k].x); pointsMax[kj.y = FormatDecimal(pointsMax[kj.y); } int count = 0; int month = m; int day = d; double lat = I; int startTime = tim e l; int endTime = time2; for(int i=startTime; i<=endTime; i++) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. { SunLoc newSunPos = new SunLoc(month, day, lat, i); double sunX = -(newSunPos.solXPos()); double sunY = -(newSunPos.solYPos()); double sunZ = newSunPos.solZPos(); for(int j =0; j<fLine.endlDf; j+=2) { double x1, y1, z1 , x2, y2, z2; x1 = fLine.pointf[j].x; y1 = fLine.pointfO].y; z1 = fLine.pointf[j].z; x2 = fLine.pointf[j+1].x; y2 = fl_ine.pointf[j+1].y; z2 = fl_ine.pointf[j+1].z; double A = y1 *(z2 - sunZ) + y2*(sunZ - z1) + sunY*(z1 - z2); double B = z1*(x2 - sunX) + z2*(sunX - x1) + sunZ*(x1 - x2); double C = x1*(y2 - sunY) + x2*(sunY - y1) + sunX*(y1 - y2); double D = x1*(sunY*z2 - y2*sunZ) + x2*(y1*sunZ - sunY*z1) + sunX*(y2*z1 -y1*z2); for( int k=0; k<gnormpointsHMinSize; k++) { boolean LPIntersect; double x3 = pointgAIIHMin[k].x; double y3 = pointgAIIHMin[k].y; double z3 = pointgAIIHMinfkj.z; double x4 = pointgAIIHMax[k].x; double y4 = pointgAIIHMax[k].y; double z4 = pointgAIIHMax[k].z; LPIntersect = lsLinePllnt(A, B, C, D, x3, y3,z3, x4, y4, z4); double zO = z3 + u*((pointgAIIHMax[k].z)-z3); if ((LPIntersect==true )&&((z0>=z2)||(z0>=z1))) { pointgAIIHMax[k].z = zO; } // end of ifLoop } // end of first FOR loop for( int k=0; k<gnormpointsVMinSize; k++) { boolean LPIntersect; double x3 = pointgAIIVMin[k].x; double y3 = pointgAIIVMin[k].y; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 101 double z3 = pointgAIIVMin[k].z; double x4 = pointgAIIVMax[k].x; double y4 = pointgAIIVMax[kj.y; double z4 = pointgAIIVMax[k].z; LPIntersect = lsLinePllnt(A, B, C, D, x3, y3,z3, x4, y4, z4); double zO = z3 + u*((pointgAIIVMax[k].z)-z3); if ((LPIntersect==true )&&((z0>=z2)||(z0>=z1))) { pointgAIIVMax[k].z = zO; } // end of ifLoop } // end of Second FOR loop for( int k =0; k<numPoints; k++) { boolean LPIntersect; double x3 = points[k].x; double y3 = points[k].y; double z3 = points[k].z; double x4 = pointsMax[k].x; double y4 = pointsMax[k].y; double z4 = pointsMaxfkj.z; LPIntersect = lsLinePllnt(A, B, C, D, x3, y3,z3, x4, y4, z4); double zO = z3 + u*((pointsMax[k].z)-z3); if ((LPIntersect==true )&&((z0>=z2)||(z0>=z1))) { pointsMax[k].z = zO; } // end of ifLoop }//end 3rd For Loop } } gnormpointsHMax.removeAIIEIements(); for(int j =0; j<gnormpointsHMaxSize; j++) { gnormpointsHMax.addElement(pointgAIIHMax[j]); } gnormpointsVMax.removeAIIEIementsO; for(int j =0; j<gnormpointsVMaxSize; j++) { gnormpointsVMax.addElement(pointgAIIVMax[j]); } } Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 102 public static boolean lsLinePllnt(doubie A,double B,double C,double D, double x1 .double y1 .double z1 .double x2, double y2,double z2) { double numerator = A*x1 +B*y1 +C*z1 +D; double denominator = A*(x1 - x2) + B*(y1 - y2) + C*(z1 - z2); u = numerator / denominator; if(u>=0 && u<=1 && (denominator!=0.0)) { return true; } else { return false; } } public static double FormatDecimal(double num) { double temp = num*10000.0; int templnt = (int)temp; double finalNum = templnt/10000.0; return finalNum; } public static boolean lfOnLine(double x, double y2, double z) { double y1 = 0.0; FenceLine fLine = new FenceLine(); for( int i=0; i<(numPoints); i++) { if( i == (numPoints-1)) { y1 = ((((fLine.pointf[0].y)-(fLine.pointf[i-1].y))/ ((fLine.pointf[0].x)-(fl_ine.pointf[i-1].x))) *(x - (fLine.pointf[i-1].x)))+ (fLine.pointf[i-1].y); } else { y1 = ((((fLine.pointf[i+1].y)-(fLine.pointf[i].y))/ ((fLine.pointf[i+1].x)-(fLine.pointf[i].x)))* (x - (fLine.pointf[i].x))) + (fLine.pointf[i].y); } } return false; } public static BranchGroup DrawMesh(){ DxfPointOpointgAIIHMin = new DxfPoint[gnormpointsHMinSize]; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 103 for(int j =0; j<gnormpointsHMinSize; j++) { pointgAIIHMinU] = (DxfPoint)gnormpointsHMin.elementAt(j); } DxfPointOpointgAIIHMax = new DxfPoint[gnormpointsHMaxSize]; for(int j =0; j<gnormpointsHMaxSize; j++) { pointgAIIHMax[j] = (DxfPoint)gnormpointsHMax.elementAt(j); } DxfPointQpointgAIIVMin = new DxfPoint[gnormpointsVMinSize]; for(int j =0; j<gnormpointsVMaxSize; j++) { pointgAIIVMin[j] = (DxfPoint)gnormpointsVMin.elementAt(j); } DxfPoint[|pointgAIIVMax = new DxfPoint[gnormpointsVMaxSize]; for(int j =0; j<gnormpointsVMinSize; j++) { pointgAIIVMax[j] = (DxfPoint)gnormpointsVMax.elementAt(j); } Color3f red = new Color3f(1 .Of, O.Of, O.Of); Color3f green = new Color3f(0.0f, 1 .Of, O.Of); Color3f blue = new Color3f(0.0f, O.Of, 1 .Of); for(int k=0; k<gnormpointsHMaxSize; k++) pointgAIIHMax[k].z = FormatDecimal(pointgAIIHMax[k].z); or(int k=0; k<gnormpointsVMaxSize; k++) pointgAIIVMax[k].z = FormatDecimal(pointgAIIVMax[k].z); for(int k=0; k<numPoints; k++) pointsMax[k].z = FormatDecimal(pointsMax[k].z); } vpoints.removeAIIEIementsO; vpointsMax.removeAIIEIements(); ghpoints.removeAIIEIements(); gvpoints.removeAIIEIements(); gboundpoints.removeAIIEIements(); gnormpointsHMax.removeAIIEIementsO; gnormpointsVMax.removeAIIEIements(); gnormpointsHMin.removeAIIEIements(); gnormpointsVMin.removeAIIEIements(); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 104 BranchGroup branchl = new BranchGroup(); try { for(int k=0; k<gnormpointsHMaxSize; k++) { Point3d vO = new Point3d(pointgAIIHMin[k].x, pointgAIIHMin[k].y, pointgAIIHMin[k].z); Point3d v1 = new Point3d(pointgAIIHMax[k].x, pointgAIIHMax[k].y, pointgAIIHMax[k].z); LineArray linel = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3); line1.setCoordinate(0, vO); // First point linel.setCoordinate(1, v1); // Second point linel.setColor(0, red); linel .setColor(1, red); Transform3D transform 1 = new Transform3D(); transform 1.set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotatel = newTransformGroup(transforml); TransformGroup objZooml = new TransformGroup(); TransformGroup objTranslatel = newTransformGroup(); objRotatel. setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotatel ,setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZooml. setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZoom 1 .setCapability(T ransformGroup.ALLOW_TRANSFORM_READ); objTranslatel ,setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslatel .setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shapel = new Shape3D(line1); branchl .addChild(objRotate1); objRotatel .addChild(shape1); MouseRotate myMouseRotatel = new MouseRotate(); myMouseRotatel ,setTransformGroup(objRotate1); myMouseRotatel .setSchedulingBounds(new BoundingSphereO); branchl ,addChild(myMouseRotate1); MouseZoom myMouseZooml = new MouseZoom(); myMouseZooml ,setTransformGroup(objRotate1); myMouseZooml .setSchedulingBounds(new BoundingSphereO); branchl .addChild(myMouseZoom1); MouseTranslate myMouseTranslatel = new MouseTranslate(); myMouseTranslatel ,setTransformGroup(objRotate1); myMouseTranslatel ,setSchedulingBounds(new BoundingSphereO); branchl. addChild(myMouseTranslatel); }//End of for loop for H for(int k=0; k<gnormpointsVMaxSize; k++) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 105 { Point3d v2 = new Point3d(pointgAIIVMin[k].x, pointgAIIVMin[k].y, pointgAIIVMin[k].z); Point3d v3 = new Point3d(pointgAIIVMax[k].x, pointgAIIVMax[k].y, pointgAIIVMax[k].z); LineArray Iine3 = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3); line3.setCoordinate(0, v2); // First point line3.setCoordinate(1, v3); // Second point line3.setColor(0, red); line3.setColor(1, red); Transform3D transform3 = new Transform3D(); transform3.set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotate3 = newTransformGroup(transform3); TransformGroup objZoom3 = new TransformGroup(); TransformGroup objTranslate3 = newTransformGroup(); objRotate3.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate3.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZoom3.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZoom3.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objTranslate3.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslate3.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shape3 = new Shape3D(line3); branchl .addChild(objRotate3); objRotate3.addChild(shape3); MouseRotate myMouseRotate3 = new MouseRotate(); myMouseRotate3.setTransformGroup(objRotate3); myMouseRotate3.setSchedulingBounds(new BoundingSphereO); branchl.addChild(myMouseRotate3); MouseZoom myMouseZoom3 = new MouseZoom(); myMouseZoom3.setTransformGroup(objRotate3); myMouseZoom3.setSchedulingBounds(new BoundingSphereO); branchl ,addChild(myMouseZoom3); MouseTranslate myMouseTranslate3 = new MouseTranslate(); myMouseTranslate3.setTransformGroup(objRotate3); myMouseT ranslate3.setSchedulingBounds(new BoundingSphereO); branch 1.addChild(myMouseTranslate3); } for(int k=0; k<numPoints; k++) { Point3d vO = new Point3d(points[k].x, points[k].y, points[k].z); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 106 Point3d v1 = new Point3d(pointsMax[k].x, pointsMax[k].y, pointsMax[k].z); LineArray Iine3 = new LineArray(2, LineArray.COORDINATES | LineArray.COLOR_3); line3.setCoordinate(0, vO); // First point line3.setCoordinate(1, v1); // Second point line3.setColor(0, green); line3.setColor(1, green); Transform3D transform3 = new Transform3D(); transform3.set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotate3 = newTransformGroup(transform3); TransformGroup objZoom3 = new TransformGroup(); TransformGroup objTranslate3 = newTransformGroup(); objRotate3.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate3.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZoom3.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZoom3.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objTranslate3.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslate3.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shape3 = new Shape3D(line3); branchl .addChild(objRotate3); objRotate3.addChild(shape3); MouseRotate myMouseRotate3 = new MouseRotate(); myMouseRotate3.setTransformGroup(objRotate3); myMouseRotate3.setSchedulingBounds(new BoundingSphereO); branchl. addChild(myMouseRotate3); MouseZoom myMouseZoom3 = new MouseZoom(); myMouseZoom3.setTransformGroup(objRotate3); myMouseZoom3.setSchedulingBounds(new BoundingSphereO); branchl ,addChild(myMouseZoom3); MouseTranslate myMouseTranslate3 = new MouseTranslate(); myMouseTranslate3.setTransformGroup(objRotate3); myMouseTranslate3.setSchedulingBounds(new BoundingSphereO); branchl.addChild(myMouseTranslate3); } branch l.compileO; •} catch(Exception e){ e.printStackTrace(); } return branchl; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 107 } } y * * * * * * * * * * * * * * * * * * * * * * Q LA§§ * Title: SolCAD * Description: This class reads the information about * the fence line and creates a data structure * for that * Institute: University of Southern California * @author Manu Juyal * @version 1.0 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * j package thesis; import java.io.*; import java.util.*; import java.io.File import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.media.j3d.*; import javax.vecmath.*; import com.sun.j3d.utils. universe.*; import com.sun.j3d.utils.behaviors.mouse.*; public class FenceLine { static Vector vpointf = new Vector(); static DxfPointfl pointf = new DxfPoint[100]; static int endlDf = 0; static int num Pointf; public FenceLine() { } ****************************************************************************** This function reads DXF data for the fence * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * public static void dxfReaderF(BufferedReader reader) throws IOException{ StreamTokenizer st = new StreamTokenizer(reader); st.eollsSignificant(true); st.wordCharsC boolean exit = false; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 108 boolean startPoly = false; boolean startVertex = false; boolean startFence = false; boolean startAcDb = false; double x; double y; double z; while(true){ if (exit) break; st.nextToken(); // read next token if(st.ttype == StreamTokenizer.TT_EOF){ exit = true; System .out. printlnfEnd ID is •'+ endlDf); } else if(st.ttype == StreamTokenizer.TT_WORD){ if(st.sval.equals("POLYLINE")){ // if token is polyline startPoly = true; } else if(st.sval.equals("VERTEX")){ // if token is vertex startVertex = true; } else if(st.sval.equals("FENCE")||st.sval.equals("Fence")|| st.sval.equals("fence")){ // if token is fence startFence = true; } else if(st.sval.equals("SITE")||st.sval.equals(,,Site'')|| st.sval.equals("site")){ // if token is site startFence = false; } else if(st.sval.equals("AcDb3dPolylineVertex")){ startAcDb = true; } else if (st.sval.equals("SEQEND")){ // if token is seqend startPoly = false; startVertex = false; startAcDb = false; startFence = false; } } else if (st.ttype == StreamTokenizer.TT_NUMBER && startPoly && startVertex && startFence && startAcDb) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 109 { if (st.nval == 10){ if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); x = st.nval; if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); y = st.nval; if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); if (st.nextToken() == StreamTokenizer.TT_EOL); if (st.nextToken() == StreamTokenizer.TT_NUMBER); z = st.nval; DxfPoint tempPf = new DxfPoint(x,y,z); vpointf .add Element(tempPf); endlDf++; } } } // End of while loop int numPointf = vpointf.size(); for (int i=0; i<numPointf; i++){ pointffi] = (DxfPoint) vpointf.elementAt(i); } } // end of dxfReaderF ^**************************************************************************** // This function draws DXF data for the fence on the screen public static BranchGroup createFenceGraph(String inFile) { Color3f red = new Color3f(1 .Of, O.Of, O.Of); Color3f green = new Color3f(0.0f, 1 .Of, O.Of); Color3f blue = new Color3f(0.0f, O.Of, 1 .Of); BranchGroup branch = new BranchGroup(); try { File f1 = new File(inFile); FileReader fr = new FileReader(inFile); Buffered Reader br = new BufferedReader(fr); dxfReaderF(br); br.close(); Point3d[| vertices = new Point3d[endlDf]; Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 110 for (int i=0 ; i<endlDf; i++){ vertices[i] = new Point3d(pointf[i].x, pointf[i].y, pointf[i].z); } int vertexcount = vertices.length; System.out.println(vertexcount); for(int k=0 ; k<vertexcount; k+=2) { Point3d vO = new Point3d(pointf[k].x, pointf[k].y, pointf[k].z); Point3d v1 = new Point3d(pointf[k+1].x,pointf[k+1].y, pointf[k+1].z); LineArray lines = new LineArray(2,LineArray.COORDINATES| LineArray.COLOR_3); lines.setCoordinate(0, vO); // First point lines.setCoordinate(1, v1); // Second point lines.setColor(0, red); lines.setColor(1, red); Transform3D transform = newTransform3D(); transform.set(0.1, new Vector3d(-1.0, -1.0, 0.0)); TransformGroup objRotate = new TransformGroup(transform); TransformGroup objZoom = new TransformGroup(); TransformGroup objTranslate = newTransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objZoom.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objZoom.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objTranslate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTranslate.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); Shape3D shape = new Shape3D(lines); branch.addChild(objRotate); objRotate.addChild(shape); MouseRotate myMouseRotate = new MouseRotate(); myMouseRotate.setTransformGroup(objRotate); myMouseRotate.setSchedulingBounds(new BoundingSphereO); branch.addChild(myMouseRotate); MouseZoom myMouseZoom = new MouseZoom(); myMouseZoom.setTransformGroup(objRotate); myMouseZoom.setSchedulingBounds(new BoundingSphereO); branch.addChild(myMouseZoom); MouseTranslate myMouseTranslate = new MouseTranslate(); myMouseTranslate.setTransformGroup(obj Rotate); myMouseTranslate.setSchedulingBounds(new BoundingSphereO); Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 111 branch.addChild(myMouseTranslate); } branch.compile(); } catch(Exception e){ e.printStackTrace(); } return branch; } // end of createFenceGraph } * Title: SolCAD * Description: This class stores the information About * sun's position during for the desireed time * Institute: University of Southern California * @author Manu Juyal * @version 1.0 package thesis; import java.awt.*; import java.math.*; import java.text.NumberFormat; public class SunPosition { double lat_r; int m onthjndex, datejndex, j_day, hour; public SunPosition() // default constructor { m onthjndex = 12; datejn dex = 21; lat_r = Math.toRadians(34); hour =10; } public SunLoc(int m, int d, double lat, int h)//constructor { m onthjndex = m; // month (1 -12) datejn dex = d; // day (1 - 31) lat r = Math.toRadians(lat); // latitude of the place hour = h; // hour of the day } //**************************************************************************** // This function calculates the Julian day //**************************************************************************** public double julian_date() Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 112 { switch(month_index) { case 1: j_day = datejndex; break; case 2: j_day = 31 + datejndex; break; case 3: j_day = 59 + datejndex; break; case 4: j_day = 90 + datejndex; break; case 5: j_day = 120 + datejndex; break; case 6: j_day = 151 + datejndex; break; case 7: j_day = 181 + datejndex; break; case 8: j_day = 212 + datejndex; break; case 9: j_day = 243 + datejndex; break; case 10: j_day = 273 + datejndex; break; case 11: j_day = 304 + datejndex; break; case 12: j_day = 334 + datejndex; break; } return (j_day); } // This function calculates the solar altitude U * * * * * * r * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * public double solAltitude() { double decl_r, alt_r, azm_r, hAngle; double datevalue = julian_date(); decl r = Math.toRadians(23.45 * Math.sin(Math.toRadians(datevalue + 284) * 360/365)); hAngle = Math.toRadians(15 * (12 - (hour)));/*hour is the time of the day*/ double sin alt r, cos_alt_r, altitude_r, altitude_d; sin_alt_r = Math.cos(lat_r)*Math.cos(decl_r)*Math.cos(hAngle)+ Math.sin(lat_r)*Math.sin(decl_r); cosaltr = Math.sqrt(1-(sin_alt_r *sin_alt_r)); altitude_r = Math.atan((sin_alt_r)/(cos_alt_r)); altituded = Math.toDegrees(altituder); return altitude_d; **************************************************************************** This function calculates the solar azimuth * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * public double solAzimuth() { double decl_r, alt_r, azm_r, hAngle; double datevalue = julian_date(); decl_r = Math.toRadians(23.45 * Math.sin(Math.toRadians(datevalue + 284) * 360/365)); hAngle = Math.toRadians(15 * (12 - (hour)));/*hour is the time of the day*/ Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 113 double xazim, yazim, azimuth_r, azimuth_d; xazim = Math.sin(hAngle)*Math.cos(decl_r); yazim = ((-(Math.cos(hAngle))*Math.cos(decl_r)*Math.sin(lat_r)) + (Math.cos(lat_r)*Math.sin(decl_r))); azimuth_r = Math.atan(xazim/yazim); azimuth_d = Math.toDegrees(azimuth_r); if (azimuth_d<0) { azimuth_d = azimuth_d+360; } return (azimuth_d); y y * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // This function calculates x-position of the sun ^**************************************************************************** public double solXPos() { double sundist = 10000000000000.0; double xsun = sundist*Math.sin(Math.toRadians(solAzimuth()))* Math.cos(Math.toRadians(solAltitude())); return xsun; } ^ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // This function calculates y-positon of the sun ^**************************************************************************** public double solYPos() { double sundist = 10000000000000.0; double ysun = sundist*Math.cos(Math.toRadians(solAzimuth())) *Math.cos(Math.toRadians(solAltitude() )); return( ysun); ^ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // This function calculates z-positon of the sun yy**************************************************************************** public double solZPos() { double sundist = 10000000000000.0; double zsun = sundist*Math.sin(Math.toRadians(solAltitude())); return zsun; } } Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 114 9.2 SAMPLE SITES (150,0,0) Figure 9-1: Rectangular sample site (130,30. Q ) (30,0.0) Figure 9-2: Irregular sample site Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 9.3 INPUT CONDITIONS 9.3.1 Rectangular site 115 Figure 9-3: Rectangular site without fence conditions Fence height = 3.0 m Fence height = 1.8 m Figure 9-4: Rectangular site with varying fence heights Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 9.3.2 Complex geometrical site 116 Figure 9-5: Complex geometrical site without fence conditions Figure 9-6: Complex geometical site with fence line on neighboring properties Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 117 9.4 OUTPUT 9.4.1 Rectangular site without fence conditions SW isometric View SE iscmetric Vew 3 NE Isometnc View, NW isometric View Figure 9-7: Summer solstice (June, 21) SW isometric View SE isometric View 3 NE Isometric View NW isometric View Figure 9-8: Equinox Sept, 21 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 118 SE Isometric View SW Isometric View u NE Isometric View Figure 9-9: Winter solstice Dec, 2 1 9m M • » Mm T < r m * M Itm I M w t a p t a t a Mb a x * * ■ .* >w. «.v. & « r * o ;a e t :> * ? s i*!? .., ■*•••5- d SE Isometric View SW isometric View NW Isometric View NE Isometric View W P “Ji^rFiwr ) n Figure 9-10: Composite envelope Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 9.4.2 Rectangular site with varying fence heights 119 SOUTHEAST ISOMETRIC VIEW NORTHWEST ISOMETRIC Figure 9-11: Summer solstice (June, 21) SOUTHEAST ISOMETRIC VIEW NORTHEAST ISOMETRIC VIEW NORTHWEST ISOMETRIC VIEW Figure 9-12: Equinox (Sept, 21) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 120 b c ' . - . v i ' , - . j - l l " ■ ‘ .-J ,• J> . SOUTHEAST ISOMETRIC VIEW s i ' ? ! • i t ! ? I ; M ' ’ k j p w ' SOUTHWEST ISOMETRIC VIEW M U r I NORTHEAST ISOMETRIC VIEW ' ---------- , ------ C o tu M . j e ?£w io v n id u it -Jtw* w w -tor-w polm* ow««pl6'h*u i«nf5 NORTHWEST ISOMETRIC VIEW S J * ML Figure 9-13: Winter solstice (Dec, 21) C d t -w - k m w t Hml -J *k S r« i Cvmn ***» Iw gi m * -Iffl « l Q *_!'■* ^ '* 2 8 0 « « * < l ' i t , (i •£*Q ?a«i a r t * N n T i > tfl-h »| ^ j l k n»« ------------:>«• | - - *] | - _ J / J - SOUTHEAST ISOMETRIC VIEW I S ' V SOUTHWEST ISOMETRIC VIEW ^ 4 * . 3 f ( NORTHEAST ISOMETRIC VIEW [m 4 » * ■ 'MokUWMl llw ti/ W R a * 'nsri rw* «M *G M -:umb p o w b (hs*p|-H M ir twiKi NORTHWEST ISOMETRIC VIEW ^ | | L U .... ■ ■ ■ ■ ■ .-4.-........................d w, --------- Figure 9-14: Composite envelope Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 121 9.4.3 Complex site without fence conditions Outputs for Casel in section 10.4.1 : ,n*H a t **^7 - r » k . A 32- T « u ltf li» J S ija s fT S 3TT ^ 1 'ii T ^ 3 I J \ \ u Z Z *}!*■** J SE Isometric view SW isometric view NE ISofaetric View NW Isometric View is w f iw y w t w ^ u W osw f 8 »IW O<IV»»«ODB. Figure 9-15:Summer solstice June, 21 s o e e e s : l r: "2 i—+ ~ jr ^ 3" SE Isometric View SW isometric View 8 m NE Isometric View > » N liM aaaBSB NW isometric View S I C Figure 9-16: Equinox Sept, 21 Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 122 SW isometric View NW isometric View NE Isometric View Figure 9-17: Winter solstice Dec, 21 S 3 ™ | F k n « • tmn fa m e ' x * O m i w a a ib 0 > t a w m b i n .isu * t .i -> s.. o . • s’ o m * asr ■ » * i j | . ■ J m ■ ■ — ■ * — BHBB5TT— Z S 3 W m m — ^ SE Isometric View SW Isometric View NW isometric View NE Isometric View v *N “ •S-yeiissiri Figure 9-18: Composite envelope Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 123 9.4.4 Complex site with fence line on neighboring properties SOUTHWEST ISOMETRIC VIEW SOUTHEAST ISOMETRIC VIEW 3 NORTHEAST ISOMETRIC VIEW NORTHWEST ISOMETRIC VIEW Figure 9-19: Summer solstice (June, 21) i n i* M P M h* n*, IN P H * I m a • i * i « • t -w . - s i. i x 3 2 ? • J 0 ]h»jw<> 2JI ■ 7! . ------w *’*' i l l ’ '** 2 i ■ S DUTHEAST^SOMETRIC VIEW ! ' % 1 ^ N ^ SOUTHWEST ISOMETRIC VIEW \ i y : I / # N v ijW ISt | NORTHEAST ISOMETRIC VIEW < X < ^ NORTHWEST ISOMETRIC VIEW *1 ------------ ^ u j u m n i ---------a ----------------: — ------------------; |J Figure 9-20: Equinox (Sept., 21) Reproduced with permission of the copyright owner. Further reproduction prohibited without permission. 124 ECatsm Jffc I* V *» |M M « r»M lull hu [MM« H u ff* V H *m N b n JIB flO«6*4 -;i< . ft 3iF T • » _.u*4 Si* 1 T ]-* _ - ji * + — 2 3 ! —* * * - “ 3 .T SOUTHWEST ISOMETRIC VIEW SOUTHEAST ISOMETRIC VIEW NORTHEAST ISOMETRIC VIEW NORTHWEST ISOMETRIC VIEW IW M M O Bgi Figure 9-21: Winter solstice ( Dec., 21) a lX J iS i JUS : * t W t6 f7 7 ~ 7 i” SOUTHWEST ISOMETRIC VIEW SOIITHFAST ISOMETRIC VIEW NORTHEAST ISOMETRIC VIEW ISOMETRIC VIEW Figure 9-22: Composite envelope Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
Lighting design assessment tool for an elderly living environment
PDF
Reinforced concrete structure design assistant tool for beginners
PDF
Maximizing natural ventilation by design in low-rise residential buildings using wind catchers in the hot arid climate of United Arab Emirates
PDF
Mahoney Tables plus a tool for sketch design recommendations for a building
PDF
Computer aided design and manufacture of membrane structures Fab-CAD
PDF
Sustainable building materials adviser: A Web-based tool for architects
PDF
Wind design of fabric structures: Determination of gust factors for fabric structures
PDF
Underwater farming colonies: A new space for human habitation
PDF
Bracing systems for tall buildings: A comparative study
PDF
A case study comparing measured and simulated acoustical environments: Acoustical improvements of Verle Annis Gallery
PDF
A proposed wood frame system for the Philippines
PDF
Lateral force design (LFD) software for wind and seismic loads per IBC 2003 and ASCE 7-02
PDF
Interactive C++ program to generate plank system lines for timber rib shell structures
PDF
Thermbuilder: A Web-based teaching tool to study thermal processes in buildings
PDF
Natural ventilation in the high-rise buildings for Taipei
PDF
Lateral design analysis: Web application. Design for wind and seismic forces in buildings
PDF
The user's guide to the 1997 Uniform Building Code
PDF
Hebel design analysis program
PDF
Catalyst: A computer-aided teaching tool for stayed and suspended systems
PDF
Variable reverberation in performance spaces: Passive and active acoustic systems
Asset Metadata
Creator
Juyal, Manu
(author)
Core Title
SolCAD: Three-dimensional spatial design tool to generate solar envelope
Degree
Master of Building Science / Master in Biomedical Sciences
Degree Program
Building Science
Publisher
University of Southern California
(original),
University of Southern California. Libraries
(digital)
Tag
Architecture,Energy,OAI-PMH Harvest
Language
English
Contributor
Digitized by ProQuest
(provenance)
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-c16-299053
Unique identifier
UC11341379
Identifier
1414824.pdf (filename),usctheses-c16-299053 (legacy record id)
Legacy Identifier
1414824.pdf
Dmrecord
299053
Document Type
Thesis
Rights
Juyal, Manu
Type
texts
Source
University of Southern California
(contributing entity),
University of Southern California Dissertations and Theses
(collection)
Access Conditions
The author retains rights to his/her dissertation, thesis or other graduate work according to U.S. copyright law. Electronic access is being provided by the USC Libraries in agreement with the au...
Repository Name
University of Southern California Digital Library
Repository Location
USC Digital Library, University of Southern California, University Park Campus, Los Angeles, California 90089, USA