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
.xpdhttps://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",
"pbrt_filepath": "/pat/to/gogo.pbrt",
"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_filepathInput .xpd file (str)cyhair_filepathInput cyhair .hair file (str)obj_filepathOutout wavefront .obj (str)pbrt_filepathOutout .pbrt (str) (.pbrt will just output all the things ignoring the following)max_segmentsThe maximum number of segments per strand (int)radial_segmentsThe number of radial segments (int)radius_scaleradius scale (float)user_radiusUse user supplied radius. Ifuser_radiusis negative, tubular uses the thicknesses stored in curves data(cyhair only for now). (float)fix_normalMake faces face the specified direction. (float x 3)one_side_planeWhen 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

