#pragma once // Optional CGAL Alpha Wrap backend for turning TRELLIS' arbitrary triangle // soup into a closed solid. The public wrapper stays dependency-free: builds // without CGAL compile the same API and report the feature as unavailable. #include #include #include namespace t2print { bool available(); // alpha_ratio and offset_ratio are fractions of the input bounding-box // diagonal (for example 0.01 and 0.01/30). Alpha controls the smallest holes // and cavities the wrap can enter; offset controls how tightly it encloses the // source. Alpha Wrap creates an entirely new surface, so material transfer is // a separate closest-surface projection step (project_pbr below). bool alpha_wrap(const std::vector & source_verts, const std::vector & source_tris, float alpha_ratio, float offset_ratio, std::vector & out_verts, std::vector & out_normals, std::vector & out_tris, std::string & err); // Project query points onto the closest source triangles and barycentrically // interpolate their six-channel per-vertex PBR values. This is the portable // CPU counterpart of upstream's cuBVH texture reprojection. Query/output order // is preserved; query_points contains xyz triples and out_pbr receives six // floats per query. bool project_pbr(const std::vector & source_verts, const std::vector & source_tris, const std::vector & source_pbr, const std::vector & query_points, std::vector & out_pbr, std::string & err); } // namespace t2print