# openvdb_tutorial **Repository Path**: kin-zhang/openvdb_tutorial ## Basic Information - **Project Name**: openvdb_tutorial - **Description**: 简单来源于openvdb官网的一些tutorial文件 可编译运行 - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-28 - **Last Updated**: 2022-09-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README OpenVDB Tutorial --- **所有关于tutorial内置代码均来源于[其官网](https://www.openvdb.org/documentation/doxygen/codeExamples.html)**,此分支仅做收集处理,同时做个人的学习调试使用,以熟悉OpenVDB操作 共同学习,如有使用请注明出处 ## Install OpenVDB 测试平台:Ubuntu 20.04 && 18.04 基本和[此repo很像:TODO](),同时docker也可公用 ## Running ```bash git clone https://gitee.com/kin_zhang/openvdb_tutorial.git cd openvdb_tutorial ``` 主要使用cmake编译,预计window也可使用,只要安装好了OpenVDB ```bash # 编译 mkdir build cd build cmake .. make # 运行 ./hello_world ``` ## problems and error 官方的几个错误点: 1. grid是指针 所以网页中这行需要被修改 ```cpp openvdb::Metadata::Ptr metadata = grid["center"]; // error openvdb::Metadata::Ptr metadata = (*grid)["center"]; // correct ``` 2. 没有大写的Vec3S 是小写的 ```cpp openvdb::Vec3S v = static_cast(*metadata).value(); // error openvdb::math::Vec3s v = static_cast(*metadata).value(); // correct ``` 3. Point iterator 部分中 一开始声明的是openvdb::openvdb::Vec3f 但是后面读取写成了float,改前面float无用,因为float是unrecongised type 能编译不能运行 ```cpp using PositionAttribute = openvdb::points::TypedAttributeArray>; openvdb::points::AttributeHandle handle(array); // error openvdb::points::AttributeWriteHandle handle(array); // AttributeHandle correct ``` 4. 指针传参等 ```cpp // correct auto leafIter = pointTree->cbeginLeaf(); openvdb::tree::LeafManager leafManager(*pointTree); ``` ## Reference 1. OpenVDB 官方网址:[https://www.openvdb.org/documentation/doxygen/codeExamples.html](https://www.openvdb.org/documentation/doxygen/codeExamples.html) 2.