Skip to content

Commit

Permalink
Merge pull request #75 from pariterre/master
Browse files Browse the repository at this point in the history
Fixed a bug if no meshes are present
  • Loading branch information
pariterre authored Jun 29, 2022
2 parents 2613b45 + 8cd8f74 commit 4f06df5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bioviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ def __init__(
self.nQ = self.model.nbQ()
self.Q = np.zeros(self.nQ)
self.idx_markers_to_remove = []
self.show_segment_is_on = [False] * self.model.nbSegment()
if self.show_markers:
self.Markers = InterfacesCollections.Markers(self.model)
self.markers = Markers(np.ndarray((3, self.model.nbMarkers(), 1)))
Expand All @@ -467,7 +468,6 @@ def __init__(
self.CoMbySegment = InterfacesCollections.CoMbySegment(self.model)
self.segments_center_of_mass = Markers(np.ndarray((3, self.model.nbSegment(), 1)))
if self.show_meshes:
self.show_segment_is_on = []
self.mesh = []
self.meshPointsInMatrix = InterfacesCollections.MeshPointsInMatrix(self.model)
for i, vertices in enumerate(self.meshPointsInMatrix.get_data(Q=self.Q, compute_kin=False)):
Expand All @@ -477,7 +477,7 @@ def __init__(
else np.ndarray((0, 3), dtype="int32")
)
self.mesh.append(Mesh(vertex=vertices, triangles=triangles.T))
self.show_segment_is_on.append(True)
self.show_segment_is_on[i] = True
if self.show_muscles:
self.model.updateMuscles(self.Q, True)
self.muscles = []
Expand Down

0 comments on commit 4f06df5

Please sign in to comment.