37 template <
typename T=real_t>
49 Root(
bool is_odd, T par,
const gsVector<T> &mpoint)
50 : type(is_odd?odd:even), begParameter(0), endParameter(0)
55 Root(
bool is_odd, T parB, T parE,
const gsVector<T> &pointB,
const gsVector<T> &pointE)
56 : type(is_odd?odd_interval:even_interval),
parameter(0)
63 Root() : type(invalid){}
100 const gsBSpline<T> &curve,
101 const gsVector<T> &normal,
104 std::vector<Root<T> > &roots
127 T
const & tr = 0, T
const & tol = 1e-7,
unsigned const & N=100)
140 void allRoots (
gsBSpline<T> const & bsp, std::vector<T> & result,
141 int const & coord = 0,
142 T
const & tr = 0, T
const & tol = 1e-7,
unsigned const & N=100)
149 result.push_back(
value() ) ;
157 T
const & tr, T
const & tol,
unsigned const &N)
166 const knotVectorType & kv = bsp.
knots();
168 m_t.resize(m_n+N+m_d+1);
171 for (
unsigned i = 0; i < m_n; ++i )
173 m_c[i]= bsp.
coef(i, coord) - tr;
177 for (
unsigned i = m_n; i < m_n + m_d +1 ; ++i )
190 std::vector<T> m_c, m_t;
194 unsigned m_n, maxn, m_k ;
206 #ifndef GISMO_BUILD_LIB
207 #include GISMO_HPP_HEADER(gsBSplineSolver.hpp)
gsMatrix< T >::RowXpr coef(index_t i)
Returns the i-th coefficient of the geometry as a row expression.
Definition: gsGeometry.h:346
gsBSplineSolver()
Default empty constructor.
Definition: gsBSplineSolver.h:119
bool nextRoot()
Next root (requires that first root has been called before)
Definition: gsBSplineSolver.hpp:56
~gsBSplineSolver()
Destructor.
Definition: gsBSplineSolver.h:122
unsigned findHyperPlaneIntersections(const gsBSpline< T > &curve, const gsVector< T > &normal, T reference, T tolerance, std::vector< Root< T > > &roots)
find intersections of a BSpline curve with an hyperplane
Definition: gsBSplineSolver.hpp:152
index_t coefsSize() const
Return the number of coefficients (control points)
Definition: gsGeometry.h:371
A B-spline function of one argument, with arbitrary target dimension.
Definition: gsBSpline.h:50
T value()
The value of the current root.
Definition: gsBSplineSolver.h:137
void initSolver(gsBSpline< T > const &bsp, int const &coord, T const &tr, T const &tol, unsigned const &N)
Initialize the solver with B-spline data.
Definition: gsBSplineSolver.h:156
Provides forward declarations of types and structs.
KnotVectorType & knots(const int i=0)
Returns a reference to the knot vector.
Definition: gsBSpline.h:170
int insertKnot(int mu)
Definition: gsBSplineSolver.hpp:24
bool firstRoot(gsBSpline< T > const &bsp, int const &coord=0, T const &tr=0, T const &tol=1e-7, unsigned const &N=100)
Return true if the first root exist, the value of the root is in this->value()
Definition: gsBSplineSolver.h:126
Class for representing a knot vector.
Definition: gsKnotVector.h:79
This is the main header file that collects wrappers of Eigen for linear algebra.
Definition: gsBSplineSolver.h:113
short_t degree(short_t i=0) const
Returns the degree of the B-spline.
Definition: gsBSpline.h:186
GISMO_DEPRECATED bool parameter(int s)
Returns the parameter value (false=0=start, true=1=end) that corresponds to side s.
Definition: gsBoundary.h:1069