-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Star file loading adjustments #55
base: main
Are you sure you want to change the base?
Star file loading adjustments #55
Conversation
…into 2D_averages
normal_data, up_data = vectors_data_from_points_data( | ||
point_coordinates=point_coordinates, features_table=features_table | ||
) | ||
if features_table is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case no normal and up-vectors can be read from the star file, we use the normal vector from the mesh and initialize a random up-vector.
@@ -76,3 +153,7 @@ def _load_star_file(self, file_path: Path): | |||
|
|||
self.surface_picker.normal_vectors_layer.edge_color = "purple" | |||
self.surface_picker.up_vectors_layer.edge_color = "orange" | |||
|
|||
self.surface_picker.rotations = features_table[ROTATION] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are necessary to alter the orientations of loaded positions
@@ -65,6 +65,11 @@ def vectors_data_from_points_data( | |||
if len(point_coordinates) == 0: | |||
# if there are no points, there are no vectors | |||
return np.empty((0, 2, 3)), np.empty((0, 2, 3)) | |||
|
|||
# check if the features table is empty | |||
if features_table.empty: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When loading points, this function was called on an empty features table, leading to an error and thus orientation vectors were not loaded properly in Surforama.
I encountered some issues when loading points from star files into Surforama (even those generated in Surforama).
This PR should fix these issues and also add the functionality to load star files that do not contain orientation information.
In this case, the normal vector is computed from the nearest triangle and a perpendicular up-vector is assigned.
Previous issues:
Please find more details in the commented code.
Let me know what you think :)