// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2020 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include #include #include #include TEST_CASE("fit_cubic_bezier: hemicircle", "[igl]") { // Create a hemicircle Eigen::MatrixXd d(101,2); for(int i=0;i cubics; igl::fit_cubic_bezier(d,error,cubics); REQUIRE(cubics.size()>1); REQUIRE(cubics.size()<10); // Generate a dense sampling const Eigen::VectorXd T = Eigen::VectorXd::LinSpaced(1000,0,1); Eigen::MatrixXd X; igl::bezier(cubics,T,X); for(int j=0;j