コード例 #1
0
def test_zonebounds():
    """py.test for zonebounds"""
    data = ZoneBounds_Data
    dct, bounds = data.dct1, data.bounds1
    result = eplusgeom.zonebounds(dct, "first")
    fresult, fbounds = flatten(result), flatten(bounds)
    for v1, v2 in zip(fresult, fbounds):
        assert almostequals(v1, v2, err=5)
    dct, bounds = data.dct2, data.bounds2
    result = eplusgeom.zonebounds(dct, "first")
    fresult, fbounds = flatten(result), flatten(bounds)
    for v1, v2 in zip(fresult, fbounds):
        assert almostequals(v1, v2, err=5)
コード例 #2
0
def test_lindelength3d():
    """py.test for linelength3d()"""
    lgt = 155
    p1 = (29.7354611812028, 73.6063721969898, -7.105427357601e-15)
    p2 = (77.1440837563596, 198.709264913276, 78.2731674301201)
    result = geometry.linelength3d(p1, p2)
    assert almostequals(result, lgt)
コード例 #3
0
def test_trianglearea3d():
    """py.test for trianglearea3d()"""
    poly = ((234.261130830644, 91.3751730360274, 1.4210854715202e-14), \
            (29.7354611812028, 73.6063721969898, -7.105427357601e-15), \
            (77.1440837563596, 198.709264913276, 78.2731674301201))
    area = 14752.132411125584
    result = geometry.trianglearea3d(poly)
    assert almostequals(result, area)
コード例 #4
0
def test_polygonarea3d():
    """py.test or polygonarea3d()"""
    poly = [[97.952770165533494, -89.688089019337596, 1.23613716318408e-14],
     [-42.113949041963799, -48.668412230783197, 4.3225283531169101e-15],
     [-176.015056172523, 95.487947355641097, 9.98244187111785e-15],
     [-59.700839733667401, 203.52759542159399, 9.98244187111785e-15],
     [193.10639752719001, 28.032400933162201, 2.21573588081702e-14],
     [175.70277016553399, -89.688089019337596, 1.23613716318408e-14]]
    area = 60724.6427925073
    result = geometry.polygonarea3d(poly)
    assert almostequals(result, area)
コード例 #5
0
def test_zonearea():
    """pyltest for zonearea()"""
    dct, area, zone = ZoneArea_Data.dct, ZoneArea_Data.area, ZoneArea_Data.zone
    result = eplusgeom.zonearea(dct, zone)
    assert almostequals(result, area)