readme.md 1.77 KB
Newer Older
fengzch-das's avatar
fengzch-das committed
1
<h1 style="text-align: center;">cubvh</h1>
ashawkey's avatar
init  
ashawkey committed
2

fengzch-das's avatar
fengzch-das committed
3
4
5
# 1 简介
cubvh 是一个CUDA Mesh BVH加速工具包。
# 2 编译安装方式
ashawkey's avatar
init  
ashawkey committed
6

fengzch-das's avatar
fengzch-das committed
7
## 2.1 环境准备
ashawkey's avatar
init  
ashawkey committed
8

fengzch-das's avatar
fengzch-das committed
9
当前组件在下面的环境下已验证编译成功:
ashawkey's avatar
init  
ashawkey committed
10

fengzch-das's avatar
fengzch-das committed
11
12
13
14
|  序号   |    FastPT版本      | Pytorch版本 | DTK版本  |
| :-----: | :---------------: | :---------: | :-----:  |
| 1       | 2.0.1+das.dtk25041|    2.4.1    | dtk25041 |
| 2       | 2.0.1+das.dtk2504 |    2.4.1    | dtk2504  |
15

fengzch-das's avatar
fengzch-das committed
16
17
18
19
20
21
22
## 2.2 编译流程
### 2.2.1 基础环境检查
* 检查当前环境是否安装 DTK,若没有则需要安装 DTK,并确定当前环境下 DTK 的版本;
* 检查当前环境是否安装 Pytorch,若没有则需要安装 Pytorch,并确定当前环境下 Pytorch 的版本是否与 DTK 版本对应;
* 检查当前环境是否安装 FastPT,若没有则需要安装 FastPT,并确定当前环境下 FastPT 的版本是否与 Pytorch 的版本相对应;
### 2.2.2 cubvh 编译流程
* 安装依赖
23
```bash
fengzch-das's avatar
fengzch-das committed
24
pip install wheel
25
```
fengzch-das's avatar
fengzch-das committed
26
27
* 手动下载三方库 eigen 至 third_party 下(`git submodule update --init --recursive` 访问代码仓会失败)
* 执行命令编译组件:
ashawkey's avatar
init  
ashawkey committed
28
```
fengzch-das's avatar
fengzch-das committed
29
30
python setup.py build
python setup.py install
ashawkey's avatar
ashawkey committed
31
```
fengzch-das's avatar
fengzch-das committed
32
33
### 2.2.3 编译 whl 包
可以通过执行下面的命令生成 whl 包:
ashawkey's avatar
ashawkey committed
34
```bash
fengzch-das's avatar
fengzch-das committed
35
36
37
38
python setup.py bdist_wheel # 该指令用于编译whl包,执行该指令时不必执行前两个指令
```
并通过下面的命令安装 cubvh:
```bash
fengzch-das's avatar
fengzch-das committed
39
pip install dist/cubvh-0.1.0-cp310-cp310-linux_x86_64.whl
fengzch-das's avatar
fengzch-das committed
40
41
42
43
44
45
46
47
48
49
50
51
```
# 3 组件测试
执行下面的命令测试组件:
```bash
pip install PyMCubes
pip install scikit-image
pip install kiui
pip install rtree

python test/extract_mesh_watertight.py /path/to/objFile(`.obj``.ply`网格文件路径或目录)
python test/signed_distance.py
python test/unsigned_distance.py --N 100
ashawkey's avatar
ashawkey committed
52
53
```