Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
cubvh
Commits
532a7608
Commit
532a7608
authored
Dec 03, 2022
by
ashawkey
Browse files
update readme
parent
c5f26a44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
readme.md
readme.md
+15
-12
No files found.
readme.md
View file @
532a7608
...
...
@@ -5,6 +5,9 @@ A CUDA Mesh BVH acceleration toolkit.
### Install
```
python
pip
install
git
+
https
:
//
github
.
com
/
ashawkey
/
cubvh
# or locally
git
clone
https
:
//
github
.
com
/
ashawkey
/
cubvh
cd
cubvh
pip
install
.
...
...
@@ -12,22 +15,11 @@ pip install .
### Usage
Example for a mesh normal renderer:
```
bash
python
test
/renderer.py
# default, show a dodecahedron
python
test
/renderer.py
--mesh
example.ply
# show any mesh file
```
https://user-images.githubusercontent.com/25863658/183238748-7ac82808-6cd3-4bb6-867a-9c22f8e3f7dd.mp4
Example code:
```
python
import
numpy
as
np
import
trimesh
import
torch
import
cubvh
### build BVH from mesh
...
...
@@ -40,6 +32,7 @@ intersections, face_normals, depth = BVH.ray_trace(rays_o, rays_d) # [N, 3], [N,
### query unsigned distance
points
# [N, 3]
# uvw is the barycentric corrdinates of the closest point on the closest face (None if `return_uvw` is False).
distances
,
face_id
,
uvw
=
BVH
.
unsigned_distance
(
points
,
return_uvw
=
True
)
# [N], [N], [N, 3]
### query signed distance (INNER is NEGETIVE!)
...
...
@@ -50,6 +43,16 @@ distances, face_id, uvw = BVH.signed_distance(points, return_uvw=True, mode='ray
```
Example for a mesh normal renderer by
`ray_trace`
:
```
bash
python
test
/renderer.py
# default, show a dodecahedron
python
test
/renderer.py
--mesh
example.ply
# show any mesh file
```
https://user-images.githubusercontent.com/25863658/183238748-7ac82808-6cd3-4bb6-867a-9c22f8e3f7dd.mp4
### Acknowledgement
*
Credits to
[
Thomas Müller
](
https://tom94.net/
)
's amazing
[
tiny-cuda-nn
](
https://github.com/NVlabs/tiny-cuda-nn
)
and
[
instant-ngp
](
https://github.com/NVlabs/instant-ngp
)
!
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment