suanPan
NURBS.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
30#ifndef NURBS_H
31#define NURBS_H
32
33#include "BSpline.h"
34
35class NURBSBase {
36protected:
38
39 void initialize_binomial(sword) const;
40};
41
42class NURBS : public BSpline, public NURBSBase {
43public:
44 using BSpline::BSpline;
45
46 [[nodiscard]] vec evaluate_point(double, const field<vec>&) const override;
47 [[nodiscard]] field<vec> evaluate_point_derivative(double, const field<vec>&, sword = -1) const override;
48
49 [[nodiscard]] vec evaluate_shape_function(double, const field<vec>&) const override;
50 [[nodiscard]] field<vec> evaluate_shape_function_derivative(double, const field<vec>&, sword = -1) const override;
51};
52
53class NURBSCurve2D final : public NURBS {
54public:
55 explicit NURBSCurve2D(vec, field<vec>&& = {});
56};
57
58class NURBSCurve3D final : public NURBS {
59public:
60 explicit NURBSCurve3D(vec, field<vec>&& = {});
61};
62
63class NURBSCurve4D final : public NURBS {
64public:
65 explicit NURBSCurve4D(vec, field<vec>&& = {});
66};
67
68#endif
69
Definition: BSpline.h:44
BSpline(vec, uword, field< vec > &&={})
Definition: BSpline.cpp:50
Definition: NURBS.h:35
mat binomial_mat
Definition: NURBS.h:37
void initialize_binomial(sword) const
Definition: NURBS.cpp:21
Definition: NURBS.h:53
NURBSCurve2D(vec, field< vec > &&={})
Definition: NURBS.cpp:99
Definition: NURBS.h:58
NURBSCurve3D(vec, field< vec > &&={})
Definition: NURBS.cpp:102
Definition: NURBS.h:63
NURBSCurve4D(vec, field< vec > &&={})
Definition: NURBS.cpp:105
Definition: NURBS.h:42
vec evaluate_point(double, const field< vec > &) const override
Algorithm A3.1.
Definition: NURBS.cpp:31
vec evaluate_shape_function(double, const field< vec > &) const override
Definition: NURBS.cpp:56
field< vec > evaluate_shape_function_derivative(double, const field< vec > &, sword=-1) const override
Definition: NURBS.cpp:66
field< vec > evaluate_point_derivative(double, const field< vec > &, sword=-1) const override
Algorithm A3.2.
Definition: NURBS.cpp:37