Esempio n. 1
0
def test_tutorial_1():
    IDF.setiddname("C:/EnergyPlusV9-1-0/Energy+.idd", testing=True)
    idf = IDF("C:/EnergyPlusV9-1-0/ExampleFiles/Minimal.idf")
    idf.epw = "USA_CO_Golden-NREL.724666_TMY3.epw"
    idf.add_block(name="Boring hut",
                  coordinates=[(10, 0), (10, 10), (0, 10), (0, 0)],
                  height=3.5)
    idf.intersect_match()
    idf.set_wwr(0.6, construction="Project External Window")
    idf.set_default_constructions()
    idf.to_obj("tests/tutorial/boring_hut.obj")
    idf.run(output_directory="tests/tutorial")
Esempio n. 2
0
                    'Not all subsurfaces on wall "{name}" have the same construction'
                    .format(name=wall.Name))
            construction = constructions[0]
        # remove all subsurfaces
        for ss in wall_subsurfaces:
            idf.removeidfobject(ss)

        for i in wwr_zones.keys():
            if i in wall.Zone_Name:
                name = i
                wwr = wwr_zones[name]

        if not wwr:
            print("error in adding windows")
            return

        coords = window_vertices_given_wall(wall, wwr)
        window = idf.newidfobject("FENESTRATIONSURFACE:DETAILED",
                                  Name="%s window" % wall.Name,
                                  Surface_Type="Window",
                                  Construction_Name=construction or "",
                                  Building_Surface_Name=wall.Name,
                                  View_Factor_to_Ground="autocalculate")
        window.setcoords(coords, ggr)


idf.set_default_constructions()
custom_wwr(wwr_zones, construction="Project External Window")
idf.to_obj('test2.obj')

idf.run()
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: https://www.empa.ch/web/s313
#
from geomeppy import IDF  # install geomeppy in your environment with pip install geomeppy
from pathlib import Path
import os

if __name__ == "__main__":
    # this script converts a IDF file to a 3d geometry you can view e.g. in an online viewer
    # useful to check your building footprints are as you expect and to check how cesar-p creates the building geometry incl adjacencies, neighbours and windows
    IDF.setiddname("C:/EnergyPlusV9-3-0/Energy+.idd"
                   )  # make sure to set IDD matching your IDF
    base = os.path.dirname(__file__) / Path("..") / Path(
        "simple_example") / Path("results") / Path("example") / Path(
            "idfs")  # run the basic example prior to running this script
    idf = IDF(str(base / Path("fid_1.idf")))
    dst = str(base / Path("fid_1.obj"))
    idf.to_obj(fname=dst)
    print(
        f"building 3D object has been saved to {dst}. ZIP the .obj an .mtl file and upload to www.creators3d.com/online-viewer to visualize."
    )
Esempio n. 4
0
for i in range(len(block_srfs)):
    for j in shading_block:
        ad = (populate_adjacencies(block_srfs[i], j))
        if ad:
            adj_walls.append(block_srfs[i])
            break

m = 0
for i in range(len(windows)):
    a = windows[i]
    for b in adj_walls:
        if b.Name in a.Name:
            idf.popidfobject("FENESTRATIONSURFACE:DETAILED", i - m)
            m += 1
            break

print("- Made Windows")
#######################################################################################################################
# Outputs

# idf.printidf()
idf.to_obj(
    r"C:\Users\Coroush\Desktop\git-noumena\bcn-energy\result2\test-zones.obj")
print("- Exported OBJ")
# idf.view_model()
idf.saveas(
    r"C:\Users\Coroush\Desktop\git-noumena\bcn-energy\result2\test-zones.idf")
idf.run(
    expandobjects=True,
    output_directory=r"C:\Users\Coroush\Desktop\git-noumena\bcn-energy\result2"
)