From da4ac4eefd88cad0641077651f1be261efc56449 Mon Sep 17 00:00:00 2001 From: Ashwin Ravichandran Date: Sun, 24 Jul 2016 01:53:18 -0700 Subject: [PATCH 1/5] Math : Added Bezier curve --- src/Magnum/Math/Bezier.h | 117 ++++++++++++++++++++++++++++ src/Magnum/Math/CMakeLists.txt | 1 + src/Magnum/Math/Test/BezierTest.cpp | 80 +++++++++++++++++++ src/Magnum/Math/Test/CMakeLists.txt | 1 + 4 files changed, 199 insertions(+) create mode 100644 src/Magnum/Math/Bezier.h create mode 100644 src/Magnum/Math/Test/BezierTest.cpp diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h new file mode 100644 index 000000000..b3f1bda6a --- /dev/null +++ b/src/Magnum/Math/Bezier.h @@ -0,0 +1,117 @@ +#ifndef Magnum_Math_Bezier_h +#define Magnum_Math_Bezier_h + +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/** @file + * @brief Class @ref Magnum::Math::Bezier + */ + +#include +#include "Vector.h" + +namespace Magnum { namespace Math { + /** + @brief Bezier + @tparam order Order of Bezier curve + @tparam dimensions Dimensions of the control points + @tparam T Underlying data type + + See Bezier Curve. + */ + template class Bezier { + + public: + + /** @brief Construct Bezier curve with the given array of control points */ + explicit Bezier(const std::array, order+1> &points) { + _points = points; + } + + /** + * @brief Divides a Bezier curve into two curves of same order having their own control points. + * De Casteljau's algorithm is used. + * @param t The interpolation factor + * + * @return Array of two Bezier curves of the same order + */ + std::array, 2> subdivide(Float t) const { + auto i_points = calculateIntermediatePoints(t); + std::array, order + 1> left, right; + for(UnsignedInt i=0; i<=order; ++i){ + left[i] = i_points[0][i]; + } + for(UnsignedInt i = 0, j = order; j>=0; --j, ++i){ + right[i] = i_points[i][j]; + } + return {Bezier(left), Bezier(right)}; + } + + /** + * @brief Finds the point in the curve for a given interpolation factor + * De Casteljau's algorithm is used. + * @param t The interpolation factor + */ + Vector lerp (Float t) const { + auto i_points= calculateIntermediatePoints(t); + return i_points[0][order]; + }; + + private: + + /** + * @brief Calculates and returns all intermediate points generated when using De Casteljau's algorithm + * @param t The interpolation factor + * + */ + std::vector>> calculateIntermediatePoints(Float t) const { + const auto n = order + 1; + std::vector>> i_points(n,std::vector>(n)); + for (UnsignedInt i = 0; i < n; ++i) { + i_points[i][0] = _points[i]; + } + for (UnsignedInt r = 1; r < n; ++r) { + for (UnsignedInt i = 0; i < n - r; ++i) { + i_points[i][r] = (1 - t) * i_points[i][r - 1] + t * i_points[i + 1][r - 1]; + } + } + return i_points; + }; + + std::array, order + 1> _points; + }; + + template using QuadraticBezier = Bezier<2, dimensions, T>; + template using CubicBezier = Bezier <3, dimensions, T>; + template using QuadraticBezier2D = QuadraticBezier<2, T>; + template using QuadraticBezier3D = QuadraticBezier<3, T>; + template using CubicBezier2D = CubicBezier<2, T>; + template using CubicBezier3D = CubicBezier<3, T>; + + } + +} +#endif //Magnum_Math_Bezier_h diff --git a/src/Magnum/Math/CMakeLists.txt b/src/Magnum/Math/CMakeLists.txt index a39dca0ab..c0d0990f5 100644 --- a/src/Magnum/Math/CMakeLists.txt +++ b/src/Magnum/Math/CMakeLists.txt @@ -25,6 +25,7 @@ set(MagnumMath_HEADERS Angle.h + Bezier.h BoolVector.h Color.h Complex.h diff --git a/src/Magnum/Math/Test/BezierTest.cpp b/src/Magnum/Math/Test/BezierTest.cpp new file mode 100644 index 000000000..54fd303f2 --- /dev/null +++ b/src/Magnum/Math/Test/BezierTest.cpp @@ -0,0 +1,80 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include +#include "Magnum/Math/Bezier.h" + +namespace Magnum { namespace Math { namespace Test { + + struct BezierTest: Corrade::TestSuite::Tester { + explicit BezierTest(); + + void testQuadratic(); + + void testCubic(); + + }; + + BezierTest::BezierTest() { + addTests({&BezierTest::testQuadratic}); + addTests({&BezierTest::testCubic}); + } + + template + inline T sqr(T t){ return t*t; } + + template + inline T cube(T t){ return t*t*t; } + + + void BezierTest::testQuadratic() { + typedef Math::Vector<2, Float> Vector2; + Vector2 p0(0.0f, 0.0f), p1(10.0f, 15.0f), p2(20.0f, 4.0f); + std::array points = {p0, p1, p2}; + QuadraticBezier2D bezier(points); + for(Float t = 0.0; t <= 1.0f; t += 0.01f) { + Vector2 expected = sqr(1-t)*p0 + 2*(1-t)*t*p1 + sqr(t) *p2; + CORRADE_COMPARE(bezier.lerp(t), expected); + } + } + + void BezierTest::testCubic() { + typedef Math::Vector<2, Float> Vector2; + Vector2 p0(0.0f, 0.0f), p1(10.0f, 15.0f), p2(20.0f, 4.0f), p3(5.0f, -20.0f); + std::array points = {p0, p1, p2, p3}; + CubicBezier2D bezier(points); + for(Float t = 0.0; t <= 1.0f; t += 0.01f) { + Vector2 expected = cube(1-t)*p0 + + 3*sqr(1-t)*t*p1 + + 3*(1-t)*sqr(t) *p2 + + cube(t)*p3; + CORRADE_COMPARE(bezier.lerp(t), expected); + } + } + + + }}} + +CORRADE_TEST_MAIN(Magnum::Math::Test::BezierTest) diff --git a/src/Magnum/Math/Test/CMakeLists.txt b/src/Magnum/Math/Test/CMakeLists.txt index 9eeba4cfb..39fd953fb 100644 --- a/src/Magnum/Math/Test/CMakeLists.txt +++ b/src/Magnum/Math/Test/CMakeLists.txt @@ -43,6 +43,7 @@ corrade_add_test(MathMatrix4Test Matrix4Test.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathSwizzleTest SwizzleTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathUnitTest UnitTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathAngleTest AngleTest.cpp LIBRARIES MagnumMathTestLib) +corrade_add_test(MathBezierTest BezierTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathRangeTest RangeTest.cpp LIBRARIES MagnumMathTestLib) corrade_add_test(MathDualTest DualTest.cpp LIBRARIES MagnumMathTestLib) From 6c420936ff2959eabb18d1bef3f55c05da933bd6 Mon Sep 17 00:00:00 2001 From: Ashwin Ravichandran Date: Sun, 24 Jul 2016 03:11:33 -0700 Subject: [PATCH 2/5] Math : Replaced vector with array in Bezier class and fixed indentation --- src/Magnum/Math/Bezier.h | 7 ++++--- src/Magnum/Math/CMakeLists.txt | 2 +- src/Magnum/Math/Test/BezierTest.cpp | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index b3f1bda6a..c7bbdc19b 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -30,7 +30,7 @@ * @brief Class @ref Magnum::Math::Bezier */ -#include +#include #include "Vector.h" namespace Magnum { namespace Math { @@ -87,9 +87,9 @@ namespace Magnum { namespace Math { * @param t The interpolation factor * */ - std::vector>> calculateIntermediatePoints(Float t) const { + std::array, order + 1>, order + 1> calculateIntermediatePoints(Float t) const { const auto n = order + 1; - std::vector>> i_points(n,std::vector>(n)); + std::array, n>, n> i_points; for (UnsignedInt i = 0; i < n; ++i) { i_points[i][0] = _points[i]; } @@ -115,3 +115,4 @@ namespace Magnum { namespace Math { } #endif //Magnum_Math_Bezier_h + diff --git a/src/Magnum/Math/CMakeLists.txt b/src/Magnum/Math/CMakeLists.txt index c0d0990f5..d6783821f 100644 --- a/src/Magnum/Math/CMakeLists.txt +++ b/src/Magnum/Math/CMakeLists.txt @@ -25,7 +25,7 @@ set(MagnumMath_HEADERS Angle.h - Bezier.h + Bezier.h BoolVector.h Color.h Complex.h diff --git a/src/Magnum/Math/Test/BezierTest.cpp b/src/Magnum/Math/Test/BezierTest.cpp index 54fd303f2..cc2a3f5c0 100644 --- a/src/Magnum/Math/Test/BezierTest.cpp +++ b/src/Magnum/Math/Test/BezierTest.cpp @@ -24,6 +24,7 @@ */ #include +#include #include "Magnum/Math/Bezier.h" namespace Magnum { namespace Math { namespace Test { From 94e08a6e86e81a0bc38ceb21869505f367aaf8d3 Mon Sep 17 00:00:00 2001 From: Ashwin Ravichandran Date: Sun, 31 Jul 2016 06:35:06 -0700 Subject: [PATCH 3/5] Math : Fixed Bezier --- src/Magnum/Math/Bezier.h | 166 ++++++++++++++++------------ src/Magnum/Math/Test/BezierTest.cpp | 100 +++++++++-------- 2 files changed, 146 insertions(+), 120 deletions(-) diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index c7bbdc19b..211c64495 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -6,6 +6,7 @@ Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš + Copyright © 2016 Ashwin Ravichandran Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -33,86 +34,109 @@ #include #include "Vector.h" + namespace Magnum { namespace Math { - /** - @brief Bezier - @tparam order Order of Bezier curve - @tparam dimensions Dimensions of the control points - @tparam T Underlying data type +/** +@brief Bezier +@tparam order Order of Bezier curve +@tparam dimensions Dimensions of the control points +@tparam T Underlying data type - See Bezier Curve. - */ - template class Bezier { +See Bezier Curve. +*/ +template class Bezier { - public: + public: - /** @brief Construct Bezier curve with the given array of control points */ - explicit Bezier(const std::array, order+1> &points) { - _points = points; - } + /** @brief Default constructor */ + constexpr /*implicit*/ Bezier(ZeroInitT = ZeroInit): _points{} {} - /** - * @brief Divides a Bezier curve into two curves of same order having their own control points. - * De Casteljau's algorithm is used. - * @param t The interpolation factor - * - * @return Array of two Bezier curves of the same order - */ - std::array, 2> subdivide(Float t) const { - auto i_points = calculateIntermediatePoints(t); - std::array, order + 1> left, right; - for(UnsignedInt i=0; i<=order; ++i){ - left[i] = i_points[0][i]; - } - for(UnsignedInt i = 0, j = order; j>=0; --j, ++i){ - right[i] = i_points[i][j]; - } - return {Bezier(left), Bezier(right)}; + /** @brief Construct Bezier without initializing the contents */ + explicit Bezier(NoInitT) {} + + /** @brief Construct Bezier curve with the given array of control points */ + template constexpr Bezier(U... u):_points{u...} { + static_assert(sizeof...(U) == order + 1, "Wrong number of arguments"); + } + + /** + * @brief Divides a Bezier curve into two curves of same order having their own control points. + * De Casteljau's algorithm is used. + * @param t The interpolation factor + * + * @return Array of two Bezier curves of the same order + */ + std::array, 2> subdivide(Float t) const { + auto iPoints = calculateIntermediatePoints(t); + Bezier left, right; + for(std::size_t i = 0; i <= order; ++i) { + left[i] = iPoints[0][i]; } + for(std::size_t i = 0, j = order; i <= order; --j, ++i) { + right[i] = iPoints[i][j]; + } + return {left, right}; + } - /** - * @brief Finds the point in the curve for a given interpolation factor - * De Casteljau's algorithm is used. - * @param t The interpolation factor - */ - Vector lerp (Float t) const { - auto i_points= calculateIntermediatePoints(t); - return i_points[0][order]; - }; - - private: - - /** - * @brief Calculates and returns all intermediate points generated when using De Casteljau's algorithm - * @param t The interpolation factor - * - */ - std::array, order + 1>, order + 1> calculateIntermediatePoints(Float t) const { - const auto n = order + 1; - std::array, n>, n> i_points; - for (UnsignedInt i = 0; i < n; ++i) { - i_points[i][0] = _points[i]; - } - for (UnsignedInt r = 1; r < n; ++r) { - for (UnsignedInt i = 0; i < n - r; ++i) { - i_points[i][r] = (1 - t) * i_points[i][r - 1] + t * i_points[i + 1][r - 1]; - } - } - return i_points; - }; + /** + * @brief Finds the point in the curve for a given interpolation factor + * De Casteljau's algorithm is used. + * @param t The interpolation factor + */ + Vector lerp(Float t) const { + auto iPoints = calculateIntermediatePoints(t); + return iPoints[0][order]; + } + + /** + * @brief Control points of Bezier + * @return One-dimensional array of `size` length. + * + * @see @ref operator[]() + */ + Vector*points() {return _points;} + + constexpr const Vector*points() const {return _points;} /**< @overload */ + + /** + * @brief Value at given position + * + * @see @ref points() + */ + Vector&operator[](std::size_t pos) {return _points[pos];} - std::array, order + 1> _points; - }; + constexpr Vector operator[](std::size_t pos) const {return _points[pos];} /**< @overload */ + + private: + + /** + * @brief Calculates and returns all intermediate points generated when using De Casteljau's algorithm + * @param t The interpolation factor + * + */ + std::array, order + 1> calculateIntermediatePoints(Float t) const { + std::array, order + 1> iPoints; + for(std::size_t i = 0; i <= order; ++i) { + iPoints[i][0] = _points[i]; + } + for(std::size_t r = 1; r <= order; ++r) { + for(std::size_t i = 0; i <= order - r; ++i) { + iPoints[i][r] = (1 - t)*iPoints[i][r - 1] + t*iPoints[i + 1][r - 1]; + } + } + return iPoints; + } - template using QuadraticBezier = Bezier<2, dimensions, T>; - template using CubicBezier = Bezier <3, dimensions, T>; - template using QuadraticBezier2D = QuadraticBezier<2, T>; - template using QuadraticBezier3D = QuadraticBezier<3, T>; - template using CubicBezier2D = CubicBezier<2, T>; - template using CubicBezier3D = CubicBezier<3, T>; + Vector _points[order + 1]; +}; - } +template using QuadraticBezier = Bezier<2, dimensions, T>; +template using CubicBezier = Bezier<3, dimensions, T>; +template using QuadraticBezier2D = QuadraticBezier<2, T>; +template using QuadraticBezier3D = QuadraticBezier<3, T>; +template using CubicBezier2D = CubicBezier<2, T>; +template using CubicBezier3D = CubicBezier<3, T>; -} -#endif //Magnum_Math_Bezier_h +}} +#endif diff --git a/src/Magnum/Math/Test/BezierTest.cpp b/src/Magnum/Math/Test/BezierTest.cpp index cc2a3f5c0..da4368f01 100644 --- a/src/Magnum/Math/Test/BezierTest.cpp +++ b/src/Magnum/Math/Test/BezierTest.cpp @@ -3,6 +3,7 @@ Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš + Copyright © 2016 Ashwin Ravichandran Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -24,58 +25,59 @@ */ #include -#include #include "Magnum/Math/Bezier.h" +#include "Magnum/Math/Functions.h" -namespace Magnum { namespace Math { namespace Test { - - struct BezierTest: Corrade::TestSuite::Tester { - explicit BezierTest(); - - void testQuadratic(); - - void testCubic(); - - }; - - BezierTest::BezierTest() { - addTests({&BezierTest::testQuadratic}); - addTests({&BezierTest::testCubic}); - } - - template - inline T sqr(T t){ return t*t; } - - template - inline T cube(T t){ return t*t*t; } - - - void BezierTest::testQuadratic() { - typedef Math::Vector<2, Float> Vector2; - Vector2 p0(0.0f, 0.0f), p1(10.0f, 15.0f), p2(20.0f, 4.0f); - std::array points = {p0, p1, p2}; - QuadraticBezier2D bezier(points); - for(Float t = 0.0; t <= 1.0f; t += 0.01f) { - Vector2 expected = sqr(1-t)*p0 + 2*(1-t)*t*p1 + sqr(t) *p2; - CORRADE_COMPARE(bezier.lerp(t), expected); - } - } - - void BezierTest::testCubic() { - typedef Math::Vector<2, Float> Vector2; - Vector2 p0(0.0f, 0.0f), p1(10.0f, 15.0f), p2(20.0f, 4.0f), p3(5.0f, -20.0f); - std::array points = {p0, p1, p2, p3}; - CubicBezier2D bezier(points); - for(Float t = 0.0; t <= 1.0f; t += 0.01f) { - Vector2 expected = cube(1-t)*p0 - + 3*sqr(1-t)*t*p1 - + 3*(1-t)*sqr(t) *p2 - + cube(t)*p3; - CORRADE_COMPARE(bezier.lerp(t), expected); - } - } +namespace Magnum { namespace Math { namespace Test { - }}} +typedef Math::Vector<2, Float> Vector2; + +struct BezierTest : Corrade::TestSuite::Tester { + explicit BezierTest(); + + void implicitConstructor(); + + void quadratic(); + + void cubic(); +}; + +BezierTest::BezierTest() { + addTests({&BezierTest::implicitConstructor, + &BezierTest::quadratic, + &BezierTest::cubic}); +} + +void BezierTest::implicitConstructor() { + QuadraticBezier2D bezier; + Vector2 zero; + for(int i = 0; i < 3; ++i) { + CORRADE_COMPARE(bezier[i], zero); + } +} + +void BezierTest::quadratic() { + Vector2 p0(0.0f, 0.0f), p1(10.0f, 15.0f), p2(20.0f, 4.0f); + QuadraticBezier2D bezier(p0, p1, p2); + for(Float t = 0.0; t <= 1.0f; t += 0.01f) { + Vector2 expected = Math::pow<2>(1 - t)*p0 + 2*(1 - t)*t*p1 + Math::pow<2>(t)*p2; + CORRADE_COMPARE(bezier.lerp(t), expected); + } +} + +void BezierTest::cubic() { + Vector2 p0(0.0f, 0.0f), p1(10.0f, 15.0f), p2(20.0f, 4.0f), p3(5.0f, -20.0f); + CubicBezier2D bezier(p0, p1, p2, p3); + for(Float t = 0.0; t <= 1.0f; t += 0.01f) { + Vector2 expected = Math::pow<3>(1 - t)*p0 + + 3*Math::pow<2>(1 - t)*t*p1 + + 3*(1 - t)*Math::pow<2>(t)*p2 + + Math::pow<3>(t)*p3; + CORRADE_COMPARE(bezier.lerp(t), expected); + } +} + +}}} CORRADE_TEST_MAIN(Magnum::Math::Test::BezierTest) From daae9f959ef7f55a4635b20c9d11e123f352e905 Mon Sep 17 00:00:00 2001 From: Ashwin Ravichandran Date: Sun, 31 Jul 2016 06:57:29 -0700 Subject: [PATCH 4/5] Math : Fixed Bezier constructor --- src/Magnum/Math/Bezier.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index 211c64495..3d9fde1d0 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -55,8 +55,8 @@ template class Bezier { explicit Bezier(NoInitT) {} /** @brief Construct Bezier curve with the given array of control points */ - template constexpr Bezier(U... u):_points{u...} { - static_assert(sizeof...(U) == order + 1, "Wrong number of arguments"); + template constexpr Bezier(Vector first, U... next):_points{first, next...} { + static_assert(sizeof...(U) + 1 == order + 1, "Bezier : Wrong number of arguments"); } /** From fbee150c71b40bb9d16c8498bc70f0468c9c0c7b Mon Sep 17 00:00:00 2001 From: Ashwin Ravichandran Date: Fri, 5 Aug 2016 20:59:34 -0700 Subject: [PATCH 5/5] Math : Fixed spaces --- .gitignore | 1 + src/Magnum/Math/Bezier.h | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 997182583..68ebbcabb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /build* /debian /obj-* +.idea/ pkg *.kdev4 *~ diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index 3d9fde1d0..b9ed69cca 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -94,18 +94,16 @@ template class Bezier { * * @see @ref operator[]() */ - Vector*points() {return _points;} - - constexpr const Vector*points() const {return _points;} /**< @overload */ + Vector* points() { return _points; } + constexpr const Vector* points() const { return _points; } /**< @overload */ /** * @brief Value at given position * * @see @ref points() */ - Vector&operator[](std::size_t pos) {return _points[pos];} - - constexpr Vector operator[](std::size_t pos) const {return _points[pos];} /**< @overload */ + Vector& operator[](std::size_t pos) { return _points[pos]; } + constexpr Vector operator[](std::size_t pos) const { return _points[pos]; } /**< @overload */ private: