Commit 57739c29 authored by Henrik Zimmer's avatar Henrik Zimmer
Browse files

* bug fix: insert_vector

* normal computation


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9955 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3ea67a93
......@@ -353,7 +353,7 @@ get_vector_n(std::vector< Point> & _control_polygon, unsigned int _n)
_control_polygon.resize(dimm_);
for (unsigned int i = 0; i < dimm_; ++i)
_control_polygon[i] = _control_polygon[i][_n];
_control_polygon[i] = control_net_[i][_n];
}
//-----------------------------------------------------------------------------
......@@ -483,6 +483,28 @@ derivativeSurfacePoint(double _u, double _v, int _derm, int _dern)
//-----------------------------------------------------------------------------
template <class PointT>
PointT
BSplineSurfaceT<PointT>::
normalSurfacePoint(double _u, double _v)
{
assert(_u >= loweru() && _u <= upperu());
assert(_v >= lowerv() && _v <= upperv());
int pn = degree_n();
int pm = degree_m();
Point derivu( derivativeSurfacePoint(_u,_v,1,0));
Point derivv( derivativeSurfacePoint(_u,_v,0,1));
Point normal( (derivu%derivv).normalize());
return normal;
}
//-----------------------------------------------------------------------------
template <class PointT>
typename BSplineSurfaceT<PointT>::Scalar
BSplineSurfaceT<PointT>::
......
......@@ -272,7 +272,7 @@ public:
/**
* Returns the _derm'th derivative of a spline curve
* Returns the _derm'th derivative of a spline surface
* \param _u the parameter in u direction
* \param _u the parameter in v direction
* \param _derm the _derm'th derivative in m
......@@ -281,6 +281,13 @@ public:
*/
Point derivativeSurfacePoint(double _u, double _v, int _derm, int _dern);
/**
* Returns the normal of a spline surface
* \param _u the parameter in u direction
* \param _u the parameter in v direction
* \return the normal
*/
Point normalSurfacePoint(double _u, double _v);
public:
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment