Пример #1
0
def test_face_rotation():

    h5store = 'small_hexagonal.hf5'
    datasets = load_datasets(h5store, data_names=['face', 'vert', 'edge'])
    specs = config.geometry.sheet_spec()

    sheet = Sheet('emin', datasets, specs)
    sgeom.update_all(sheet)
    face = 17
    normal = sheet.edge_df[sheet.edge_df['face'] == face][sheet.ncoords].mean()
    rot = sgeom.face_rotation(sheet, face, 0)
    rotated = np.dot(rot, normal)
    np.testing.assert_allclose(rotated[:2], np.zeros(2), atol=1e-7)
Пример #2
0
def test_face_rotation():

    h5store = os.path.join(stores_dir, "small_hexagonal.hf5")
    datasets = load_datasets(h5store, data_names=["face", "vert", "edge"])
    specs = config.geometry.cylindrical_sheet()

    sheet = Sheet("emin", datasets, specs)
    sgeom.update_all(sheet)
    face = 17
    normal = sheet.edge_df[sheet.edge_df["face"] == face][sheet.ncoords].mean()
    rot = sgeom.face_rotation(sheet, face, 0)
    rotated = np.dot(rot, normal)
    np.testing.assert_allclose(rotated[:2], np.zeros(2), atol=1e-7)