uxarray
uxarray copied to clipboard
Rewrite Geometry Functions With Latest Refractors
Proposed new feature or change:
Summary
As discussed thoroughly in #785, many of the geometry functions were implemented before multiple refactors and changes to data structures, and they have not been updated to align with the current implementation. A rewrite is needed to significantly improve performance.
Affected Geometry Functions
The following geometry functions are in need of a rewrite:
_pole_point_inside_polygonextreme_gca_latitude_insert_pt_in_latlonbox_get_cartesian_face_edge_nodes_get_lonlat_rad_face_edge_nodes
Key Issues
To improve performance, we need to eliminate any unnecessary coordinate conversion calls, such as _xyz_to_lonlat_rad.
One proposed solution is to provide both the latlon_rad and cartesian points in the function call to avoid needing conversions. For example:
def _point_within_gca(pt_latlon,
pt_xyz,
gca_a_latlon,
gca_a_xyz,
gca_b_latlon,
gca_b_xyz,
is_directed=False):
Request
A new API design is required for these geometry functions to address the issues mentioned and enhance performance.
@hongyuchen1030
Should we link this with #1180
Should we link this with #1180
Hmmm so technically we can. But when I was checking the current implementation, lots of the goals here have already been achieved. So I think we can either directly close it or link this with #1180
Closing per @hongyuchen1030 's previous comment here. Can reopen if we need.