#include <ApproxSurf.h>
Public Member Functions | |
ApproxSurf (std::vector< boost::shared_ptr< SplineCurve > > &crvs, const std::vector< double > &points, const std::vector< double > &parvals, double domain[], int dim, double aepsge, int constdir=0) | |
Constructor where the user specifies the boundary curves of the surface to generate, a parameter domain for the surface, the points to approximate and their parameter values, as well as the geometric tolerance. | |
ApproxSurf (boost::shared_ptr< SplineSurface > &srf, const std::vector< double > &points, const std::vector< double > &parvals, int dim, double aepsge, int constdir=0) | |
Constructor where the user specifies a spline surface that should be modified, the points to approximate and their parameter values, as well as the geometric tolerance. | |
~ApproxSurf () | |
Destructor. | |
void | setSmoothingWeight (double smooth) |
Sets the smoothing weight to something other than the default (1e-9). | |
void | setFixBoundary (bool fix_boundary) |
Decide whether or not the total bondary of the surface should be kept fixed (i.e. | |
void | edgeFix (int edge_fix[]) |
Decide whether specific edges of the surface's boundary should be kept fixed (i.e. | |
void | setNormalConditions (const std::vector< double > &points, const std::vector< double > &parvals) |
Forces the surface to approximate certain normals at certain parameter values. | |
boost::shared_ptr< SplineSurface > | getApproxSurf (double &maxdist, double &avdist, int &nmb_out_eps, int max_iter=4) |
When everything else is set, this function can be used to run the approximation process and fetch the approximated surface. | |
int | reParam () |
Reparameterize the data points by a closest point match against the current surface. | |
Protected Member Functions | |
ApproxSurf () | |
Default constructor. |
Definition at line 67 of file ApproxSurf.h.
Go::ApproxSurf::ApproxSurf | ( | std::vector< boost::shared_ptr< SplineCurve > > & | crvs, | |
const std::vector< double > & | points, | |||
const std::vector< double > & | parvals, | |||
double | domain[], | |||
int | dim, | |||
double | aepsge, | |||
int | constdir = 0 | |||
) |
Constructor where the user specifies the boundary curves of the surface to generate, a parameter domain for the surface, the points to approximate and their parameter values, as well as the geometric tolerance.
The two spline basises of the generated tensor product spline surface will be determined by unifying basises of opposing boundary curves.
crvs | the boundary curves of the surface to be generated. This vector should contain exactly four curves, whose endpoints are connected so that they form a loop. | |
points | vector containing the coordinates of the points that this surface should interpolate. They are stored in "xyzxyz...-fashion". | |
parvals | vector containing the parameter values of the points given in the 'points' vector. They are stored in "uvuv...-fashion". | |
domain | pointer to an array of four doubles specifying the parametric domain for the surface to be generated. They should be stored as "u_min, u_max, v_min, v_max". | |
dim | spatial dimension of the points (usually 3). | |
aepsge | geometric tolerance to use internally | |
constdir | The points will be reparameterized internally according to their spatial position with respect to the surface that shall be generated. However, they might be reparameterized in both their u and v parameters, only in their u parameters or only in their v parameters. The user can specify this with 'constdir'. If 'constdir' is set to 0, the points will be reparameterized in both u and v. If 'constdir' is set to 1, they will only be reparameterized in the v parameter. If 'constdir' is set to 2, they will only be reparameterized in the u parameter. |
Go::ApproxSurf::ApproxSurf | ( | boost::shared_ptr< SplineSurface > & | srf, | |
const std::vector< double > & | points, | |||
const std::vector< double > & | parvals, | |||
int | dim, | |||
double | aepsge, | |||
int | constdir = 0 | |||
) |
Constructor where the user specifies a spline surface that should be modified, the points to approximate and their parameter values, as well as the geometric tolerance.
The surface that is given as argument is not copied internally, only pointed to, so it will be modified.
srf | the surface that will be modified to approximate the points. Assumed to contain k-regular knots. | |
points | vector containing the coordinates of the points that this surface should interpolate. They are stored in "xyzxyz...-fashion". | |
parvals | vector containing the parameter values of the points given in the 'points' vector. They are stored in "uvuv...-fashion". | |
dim | spatial dimension of the points (usually 3). | |
aepsge | geometric tolerance to use internally | |
constdir | The points will be reparameterized internally according to their spatial position with respect to the surface that shall be generated. However, they might be reparameterized in both their u and v parameters, only in their u parameters or only in their v parameters. The user can specify this with 'constdir'. If 'constdir' is set to 0, the points will be reparameterized in both u and v. If 'constdir' is set to 1, they will only be reparameterized in the v parameter. If 'constdir' is set to 2, they will only be reparameterized in the u parameter. |
void Go::ApproxSurf::setSmoothingWeight | ( | double | smooth | ) | [inline] |
Sets the smoothing weight to something other than the default (1e-9).
The value should lie in the unit interval, typically close to 0.
smooth | the new smoothing weight. |
Definition at line 141 of file ApproxSurf.h.
void Go::ApproxSurf::setFixBoundary | ( | bool | fix_boundary | ) | [inline] |
Decide whether or not the total bondary of the surface should be kept fixed (i.e.
unchanged by approximation process). Default is true. Cross derivatives will not be kept fixed. (If you want to keep cross derivatives fixed, use the edgeFix() member function instead).
fix_boundary | if 'true' the boundary of the surface will not be modified, if 'false' it will be open to modification. |
Definition at line 153 of file ApproxSurf.h.
void Go::ApproxSurf::edgeFix | ( | int | edge_fix[] | ) | [inline] |
Decide whether specific edges of the surface's boundary should be kept fixed (i.e.
unchanged by approximation process), as well as a certain number of cross- derivatives across these curves.
edge_fix | pointer to an array of four integers specifying to which extent each surface edge should be kept fixed during the approximation process. A value of 0 means that it will not be kept fixed, 1 means that its position will be kept fixed, 2 means that its position and cross-tangent will be kept fixed, etc. The integers are associated with the surface edges starting with the edge 'v=vmin' and moving counterclockwise. |
Definition at line 170 of file ApproxSurf.h.
void Go::ApproxSurf::setNormalConditions | ( | const std::vector< double > & | points, | |
const std::vector< double > & | parvals | |||
) | [inline] |
Forces the surface to approximate certain normals at certain parameter values.
points | this vector contains the normals that should be approximated. They are stored in 'xyzxyz... fashion'. | |
parvals | this vector contains the parameter values of the normals that should be approximated. They are stored in 'uvuv... fashion'. |
Definition at line 182 of file ApproxSurf.h.
boost::shared_ptr<SplineSurface> Go::ApproxSurf::getApproxSurf | ( | double & | maxdist, | |
double & | avdist, | |||
int & | nmb_out_eps, | |||
int | max_iter = 4 | |||
) |
When everything else is set, this function can be used to run the approximation process and fetch the approximated surface.
maxdist | report the maximum distance between the approximated surface and the data points | |
avdist | report the average distance between the approximated surface and the datapoints |
nmb_out_eps | report the number of data points that were found to lie outside the geometric tolerance (as specified by the 'aepsge' argument to the ApproxSurf constructor. | |
max_iter | maximum number of iterations |