Skip to content

Commit

Permalink
fix get item of vector
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumiz committed May 13, 2024
1 parent 07441fd commit 4f9660c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 25 deletions.
4 changes: 2 additions & 2 deletions docs/Transform.html

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/Vector.html
Original file line number Diff line number Diff line change
Expand Up @@ -7848,13 +7848,13 @@ <h1 id="Vector">Vector<a class="anchor-link" href="#Vector">¶</a></h1><p><stron
<div class="jp-OutputArea-child jp-OutputArea-executeResult">
<div class="jp-OutputPrompt jp-OutputArea-prompt">Out[18]:</div>
<div class="jp-RenderedText jp-OutputArea-output jp-OutputArea-executeResult" data-mime-type="text/plain" tabindex="0">
<pre>Vector4([[[0.43522198, 0.8870544 , 0.0858049 , 0.87264433],
[0.16758575, 0.94632808, 0.17111682, 0.41698722],
[0.24503889, 0.70614785, 0.61126227, 0.00773757]],
<pre>Vector4([[[0.10675625, 0.08583802, 0.1820884 , 0.65494822],
[0.09319502, 0.22052917, 0.73529261, 0.14431438],
[0.94082476, 0.01850599, 0.75349839, 0.05633584]],

[[0.5002637 , 0.59727515, 0.99903601, 0.58771682],
[0.63292408, 0.68664677, 0.7816926 , 0.64184115],
[0.67400973, 0.92165774, 0.69120305, 0.80209634]]])</pre>
[[0.53637026, 0.06550456, 0.24711105, 0.39999381],
[0.662172 , 0.63460787, 0.04817298, 0.86471273],
[0.02101857, 0.67291809, 0.28591493, 0.42406049]]])</pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -9378,16 +9378,16 @@ <h1 id="Vector">Vector<a class="anchor-link" href="#Vector">¶</a></h1><p><stron
<div class="jp-OutputArea-child jp-OutputArea-executeResult">
<div class="jp-OutputPrompt jp-OutputArea-prompt">Out[31]:</div>
<div class="jp-RenderedText jp-OutputArea-output jp-OutputArea-executeResult" data-mime-type="text/plain" tabindex="0">
<pre>Vector([[ 7.54544306e+00, -5.62736177e+00, -1.41883481e+00, 2.23000000e+02, 1.22393358e+09],
[ 2.94651890e+00, 1.82195938e+00, -1.88261151e+00, 1.89000000e+02, 1.22393358e+09],
[-9.15337849e+00, -6.28484917e+00, 2.31183663e-01, 1.64000000e+02, 1.22393358e+09],
[ 9.91535759e+00, 2.42344074e+01, -4.97848868e-01, 2.02000000e+02, 1.22393358e+09],
[-8.97213364e+00, -7.28060341e+00, 5.55622935e-01, 1.99000000e+02, 1.22393358e+09],
[-6.23529053e+00, -8.72525200e-03, -1.82161903e+00, 1.01000000e+02, 1.22393358e+09],
[-5.66597879e-01, 1.35883617e+01, -2.74452066e+00, 1.84000000e+02, 1.22393358e+09],
[ 2.33960037e+01, 7.69551373e+00, -1.47684979e+00, 2.02000000e+02, 1.22393358e+09],
[-6.87461329e+00, 3.01385427e+00, -1.73129582e+00, 1.91000000e+02, 1.22393358e+09],
[ 9.72363949e+00, 1.22141151e+01, -3.18952948e-01, 1.71000000e+02, 1.22393358e+09]])</pre>
<pre>Vector([[ 1.16843948e+01, -1.06306839e+00, -1.94857335e+00, 1.03000000e+02, 1.22393358e+09],
[ 8.41303635e+00, -4.50904465e+00, -1.81988895e+00, 1.85000000e+02, 1.22393358e+09],
[ 6.36166000e+00, -7.03226948e+00, -9.32307005e-01, 1.32000000e+02, 1.22393358e+09],
[ 4.11986685e+00, 1.85701776e+00, -1.89008522e+00, 1.04000000e+02, 1.22393358e+09],
[ 3.74107265e+00, 1.66697464e+01, 1.12015598e-01, 1.42000000e+02, 1.22393358e+09],
[-2.82750494e-04, -7.52030277e+00, 3.94696355e-01, 1.44000000e+02, 1.22393358e+09],
[-4.88368225e+00, 7.48510242e-01, -1.83321249e+00, 1.02000000e+02, 1.22393358e+09],
[ 1.90957050e+01, -7.39084601e-01, -1.94567561e+00, 1.11000000e+02, 1.22393358e+09],
[-5.36140911e-02, -6.33624840e+00, -8.85523319e-01, 2.33000000e+02, 1.22393358e+09],
[-9.66018391e+00, 3.03745613e+01, -1.81837058e+00, 1.90000000e+02, 1.22393358e+09]])</pre>
</div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions docs/Vector3.html

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion py3d/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ def __imatmul__(self, value) -> Vector:

def __getitem__(self, keys) -> Vector:
if hasattr(self, "columns") and type(keys[0]) is str:
i = [self.columns.index(key) for key in keys]
if type(keys) is str:
i = self.columns.index(keys)
else:
i = [self.columns.index(key) for key in keys]
return self[..., i]
else:
return super().__getitem__(keys)
Expand Down

0 comments on commit 4f9660c

Please sign in to comment.