Skip to content

Commit

Permalink
Merge pull request #49 from pariterre/master
Browse files Browse the repository at this point in the history
Fixed a bug when show_markers=False
  • Loading branch information
pariterre authored Feb 11, 2021
2 parents 1e9ddb9 + 382e7ef commit 6b4e62a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 6 additions & 5 deletions bioviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ def _get_data_from_eigen(self, Q=None, compute_kin=True):
def _get_data_from_casadi(self, Q=None, compute_kin=True):
self.data = []
for i in range(self.m.nbSegment()):
nb_vertex = self.m.segment(i).characteristics().mesh().nbVertex()
vertices = np.ndarray((3, nb_vertex, 1))
n_vertex = self.m.segment(i).characteristics().mesh().nbVertex()
vertices = np.ndarray((3, n_vertex, 1))
vertices[:, :, 0] = self.segments[i](Q)
self.data.append(vertices)

Expand Down Expand Up @@ -300,15 +300,15 @@ def __init__(
# Create all the reference to the things to plot
self.nQ = self.model.nbQ()
self.Q = np.zeros(self.nQ)
self.markers = Markers(np.ndarray((3, self.model.nbMarkers(), 1)))
if self.show_markers:
self.Markers = InterfacesCollections.Markers(self.model)
self.global_center_of_mass = Markers(np.ndarray((3, 1, 1)))
self.markers = Markers(np.ndarray((3, self.model.nbMarkers(), 1)))
if self.show_global_center_of_mass:
self.CoM = InterfacesCollections.CoM(self.model)
self.segments_center_of_mass = Markers(np.ndarray((3, self.model.nbSegment(), 1)))
self.global_center_of_mass = Markers(np.ndarray((3, 1, 1)))
if self.show_segments_center_of_mass:
self.CoMbySegment = InterfacesCollections.CoMbySegment(self.model)
self.segments_center_of_mass = Markers(np.ndarray((3, self.model.nbSegment(), 1)))
if self.show_meshes:
self.mesh = []
self.meshPointsInMatrix = InterfacesCollections.MeshPointsInMatrix(self.model)
Expand Down Expand Up @@ -826,3 +826,4 @@ def __set_rt_from_q(self):
for k, rt in enumerate(self.allGlobalJCS.get_data(Q=self.Q, compute_kin=False)):
self.rt[k] = Rototrans(rt)
self.vtk_model.update_rt(self.rt)

8 changes: 7 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# create a dev conda environment with: `make create_env` or `conda env create -f environment.yml`
name: biorbd-viz
name: bioptim
channels:
- conda-forge
dependencies:
- python
- numpy
- matplotlib
- scipy
- pyomeca
- vtk
- pyqt
- pandas
- eigen
- casadi
- rbdl
- biorbd
- packaging
- pytest
- setuptools
10 changes: 10 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
numpy
casadi
pytest
matplotlib
scipy
packaging
setuptools
rbdl=*=*casadi*
biorbd=*=*casadi*
biorviz=*=*casadi*

0 comments on commit 6b4e62a

Please sign in to comment.