C++ port of unity-tubular https://github.com/mattatz/unity-tubular
Currently .xpd curve data is supported.
Assume Catmull-Rom curves.
- cmake
- C++11 compiler(clang recommended)
- Linux 64bit
- macOS
- Windows(Visual Studio 2017 or later)
- Android(will work)
- Xgen
.xpd
https://github.com/syoyo/tinyxpd - CyHair http://www.cemyuksel.com/research/hairmodels/
- Per-CV radius(thickness)
- Photobooth https://people.csail.mit.edu/sparis/publi/2008/siggraphHair/#docs
- Alembic curves?
$ ./bootstrap-clang.sh
$ cd build
$ make
For command prompt or PowerShell, simply run vcsetup.bat
(Use VS2017)
For Git for Windows terminal(mintty bash), run
$ cmd //c vcsetup.bat
Convert curves data to wavefront .obj. Setting is done in config.json
file.
{
"xpd_filepath": "/path/to/hoge.xpd",
"cyhair_filepath": "/path/to/cyhair.hair",
"obj_filepath": "/pat/to/hoge.obj",
"max_segments": 15,
"radial_segments": 3,
"radius_scale": 1.0,
"user_radius": -1.0,
"fix_normal": [
0.0,
0.0,
-1.0
],
"one_side_plane": false
}
Input curves can be speficied either xpd_filepath
or cyhair_filepath
.
xpd_filepath
Input .xpd file (str)cyhair_filepath
Input cyhair .hair file (str)obj_filepath
Outout wavefront .obj (str)max_segments
The maximum number of segments per strand (int)radial_segments
The number of radial segments (int)radius_scale
radius scale (float)user_radius
Use user supplied radius. Ifuser_radius
is negative, tubular uses the thicknesses stored in curves data(cyhair only for now). (float)fix_normal
Make faces face the specified direction. (float x 3)one_side_plane
When radial_segments is 2, use one side planes. (bool)
$ ./tubular-cli /path/to/config.json
- Interactive GUI
- Support more curves format
- Cyhair
- Alembic
- RenderMan RiCurves?
tubular-cpp is licensed under MIT license.
- unity-tubular MIT License
- StaticJSON MIT License
- RapidJSON The 3-Clause BSD License
- TinyXPD MIT License
- tinyobjloader MIT License
- spdlog MIT License