Skip to content

Commit

Permalink
read_txt (#131)
Browse files Browse the repository at this point in the history
* read_txt

* update docs
  • Loading branch information
Tumiz committed Apr 2, 2024
1 parent d4c2e58 commit 70549ad
Show file tree
Hide file tree
Showing 8 changed files with 10,675 additions and 96 deletions.
20 changes: 10 additions & 10 deletions docs/Rotation.html

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions docs/Transform.html

Large diffs are not rendered by default.

114 changes: 79 additions & 35 deletions docs/Vector.html

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions docs/Vector3.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions py3d/doc/Vector.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,23 @@
"]).unique()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Read a txt file storing poses"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import py3d\n",
"py3d.read_txt(\"poses.txt\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
10,514 changes: 10,514 additions & 0 deletions py3d/doc/poses.txt

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion py3d/py3d/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def read_csv(path) -> Vector:
return numpy.loadtxt(path, delimiter=',').view(Vector)


def read_txt(path, delimiter=' ') -> Vector:
return numpy.loadtxt(path, delimiter=delimiter).view(Vector)


def read_npy(path) -> Vector:
return numpy.load(path).view(Vector)

Expand Down Expand Up @@ -364,7 +368,7 @@ def fillna(self, value):
return self

def unique(self, axis=-2) -> Vector:
return numpy.unique(self, axis=axis)
return numpy.unique(self, axis=axis).view(Vector)

def to_pcd(self, path, fields=""):
w = self.shape[-1]
Expand Down

0 comments on commit 70549ad

Please sign in to comment.