You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not satisfied with the current handling of this variable:
@staticmethoddefupdate_height(sheet):
""" Update the height of the sheet vertices, based on the geometry specified in the sheet settings: `sheet.settings['geometry']` can be set to - `cylindrical`: the vertex height is measured with respect to the distance to the the axis specified in sheet.settings['height_axis'] (e.g `z`) - `flat`: the vertex height is measured with respect to the position on the axis specified in sheet.settings['height_axis'] - 'spherical': the vertex height is measured with respect to its distance to the coordinate system centers In all the cases, this distance is shifted by an amount of `sheet.vert_df['basal_shift']` """w=sheet.settings['height_axis']
u, v= (cforcinsheet.coordsifc!=w)
ifsheet.settings['geometry'] =='cylindrical':
sheet.vert_df['rho'] =np.hypot(sheet.vert_df[v],
sheet.vert_df[u])
sheet.vert_df['height'] = (sheet.vert_df['rho'] -sheet.vert_df['basal_shift'])
elifsheet.settings['geometry'] =='flat':
sheet.vert_df['rho'] =sheet.vert_df[w]
sheet.vert_df['height'] = (sheet.vert_df[w] -sheet.vert_df['basal_shift'])
elifsheet.settings['geometry'] =='spherical':
sheet.vert_df['rho'] =np.linalg.norm(sheet.vert_df[sheet.coords],
axis=1)
sheet.vert_df['height'] = (sheet.vert_df['rho'] -sheet.vert_df['basal_shift'])
It seems to me a more generic version could be useful by expanding the (height, basal_shift, height_axis) to a pair of 3D vectors, shifting all the vertices.
This might mean subclassing the geometries
The text was updated successfully, but these errors were encountered:
Upon reflection, I am not sure the geometry can be generalized in a meaningful way, as once you added an aribitrary shift vector, you are already close to a "full" 3D cell, in terms of complexity.
I'm not satisfied with the current handling of this variable:
It seems to me a more generic version could be useful by expanding the
(height, basal_shift, height_axis)
to a pair of 3D vectors, shifting all the vertices.This might mean subclassing the geometries
The text was updated successfully, but these errors were encountered: