'geometry' - a spline library


Classes

class  Go::ApproxCurve
 This class can generate a B-spline curve that approximates a set of points for a given accuracy. More...
class  Go::ApproxSurf
 This class can generate a B-spline surface that approximates a set of points for a given accuracy. More...
class  Go::BoundedSurface
 The class representing trimmed surfaces in Go. More...
class  Go::BsplineBasis
 Class representing a B-spline basis of a spline space. More...
class  Go::CompositeSurface
struct  Go::sideConstraint
 Struct defining linear side constraints between control points in a surface. More...
struct  Go::sideConstraintSet
 Struct defining linear side constraints between control points in a set of surfaces. More...
class  Go::CoonsPatchGen::UnKnownError
 Exception class. More...
class  Go::CrossTangentOffset
 This curve represent an offset curve from a given space curve, along a direction obtained by blending two 'cross-tangent curves', and with an offset distance which is a linear function interpolating the cross-tangent length at the start and end of the curve. More...
class  Go::CrossTanOffDist
 This class defines an evaluator-based offset-curve. More...
class  Go::CurveBoundedDomain
 A 2D parameter domain represented by its boundaries. More...
class  Go::CurveLoop
 CurveLoop represents a closed loop defined by the composition of a set of curves. More...
class  Go::CurveOnSurface
 Missing doxygen documentation class description. More...
class  Go::Domain
 Abstract base class representing a 2D parameter domain. More...
class  Go::EvalCurve
 This is the abstract base class of a curve type that can be evaluated. More...
class  Go::EvalCurveSet
 This abstract class provides an interface to a set of curves that can be evaluated. More...
class  Go::Creator
 Abstract base class for Creators. More...
class  Go::ConcreteCreator< T >
 This is the concrete Creator class for generating GeomObject-derived classes. More...
class  Go::Factory
 This is the Factory for creating instances of GeomObjects of type requested by the user. More...
class  Go::Registrator< T >
 On some compilators (ie., VS6), the Register() function cannot be used directly. More...
class  Go::GeomObject
 Base class for geometrical objects (curves, surfaces, etc. More...
class  Go::HermiteAppC
 This class is used to generate a SplineCurve from a EvalCurve using Hermite interpolation. More...
class  Go::HermiteAppS
 This class is used to generate a set of SplineCurves from a EvalCurveSet (which itself represents a set of related curves) using Hermiet interpolation. More...
class  Go::HermiteGrid1D
 The type "GoHemiteGrid1D" holds a one dimensional grid containing sampled points and derivatives from a curve. More...
class  Go::HermiteGrid1DMulti
 The type "GoHemiteGrid1DMulti" holds a one dimensional grid containing sampled points and derivatives from a set of curves, as represented by a EvalCurveSet. More...
class  Go::HermiteInterpolator
 An Interpolator that generates a hermite spline curve through given points and tangents. More...
class  Go::Interpolator
 Base class for spline interpolators or approximators. More...
class  Go::LiftCurve
 This class represents a "lift curve", generated from taking a surface and a 2D curve and then evaluation the surface at the parameter values obtained by evaluating the 2D curve. More...
class  Go::LineCloud
 GeomObject representing a collection of line segments in space. More...
class  Go::ObjectHeader
 An object representing the "header" usually preceeding a GeomObject in a stream. More...
class  Go::ParamCurve
 Base class for parametric curves in Go. More...
class  Go::ParamSurface
 Base class for parametric surfaces in Go. More...
class  Go::PointCloud< Dim >
 Represent a cloud of points in 'Dim'-dimensional space. More...
class  Go::ProjectCurve
 This class represents the curve obtained by projecting a given 3D curve onto a given part of a given 3D surface. More...
class  Go::ProjectCurveAndCrossTan
 Evaluator class representing the projection and and tangent curve given a set of input curves. More...
class  Go::ProjectIntersectionCurve
 This class provides an interface to a curve that can be evaluated. More...
class  Go::RectDomain
 Represents a rectangular parameter domain. More...
class  Go::RectGrid
 This class represent the simplest of all quadrangulations: a rectangular grid. More...
class  Go::SmoothCurve
 This class is used to generate a spline curve from a given spline space that approximates a set of weighed data points. More...
class  Go::SmoothSurf
 This class modifies a tensor product B-spline surface with respect to conditions on smoothness, editing constraints and boundary conditions. More...
class  Go::SmoothSurfSet
 This class modifies a set of tensor product B-spline surfaces with respect to conditions on smoothness, editing constraints and boundary conditions. More...
class  Go::SmoothTransition
 This abstract class provides an interface to a curve that can be evaluated. More...
class  Go::SolveCG
 Solve the equation system Ax=b where A is a symmetric positive definite matrix using the Conjugate Gradient Method. More...
class  Go::SplineApproximator
 An Interpolator that generates a spline curve approximating the given dataset in the least squares sense. More...
class  Go::SplineCurve
 SplineCurve provides methodes for storing, reading and manipulating rational and non-rational B-spline curves. More...
class  Go::SplineInterpolator
 An Interpolator that generates a spline curve interpolating the given dataset. More...
class  Go::SplineSurface
 SplineSurface provides methodes for storing, reading and manipulating rational and non-rational B-spline surfaces. More...
class  Go::Streamable
 Base class for streamable objects, ie. More...
struct  Go::go_iterator_traits< Iterator >
 Iterator traits classes are provided for the Go namespace, so that we won't need to include. More...
struct  Go::go_iterator_traits< T * >
struct  Go::go_iterator_traits< const T * >

Typedefs

typedef Go::sideConstraint Go::sideConstraint
 Struct defining linear side constraints between control points in a surface.
typedef Go::sideConstraintSet Go::sideConstraintSet
 Struct defining linear side constraints between control points in a set of surfaces.
typedef PointCloud< 3 > Go::PointCloud3D
typedef PointCloud< 4 > Go::PointCloud4D

Enumerations

enum  Go::ClassType
 All concrete classes that inherit GeomObject should have a matching enum in ClassType. More...
enum  Go::AlgorithmChoice
 This enumeration denotes whether the 'closestPtSurfSurfPlane' function should base itself upon a geometrical algorithm (marching on the surfaces) or a pure functional one (constrained minimization of a cost function). More...
enum  
 Enumeration of various pretopologies that can be associated with intersections.

Functions

std::vector< shared_ptr< CurveOnSurface > > Go::BoundedUtils::intersectWithSurface (CurveOnSurface &curve, BoundedSurface &bounded_surf, double epsge)
 Extract those parts of a given CurveOnSurface where its parameter curve lies inside the parameter domain of a BoundedSurface.
void Go::BoundedUtils::intersectWithSurfaces (vector< shared_ptr< CurveOnSurface > > &curves1, shared_ptr< BoundedSurface > &bd_sf1, vector< shared_ptr< CurveOnSurface > > &curves2, shared_ptr< BoundedSurface > &bd_sf2, double epsge)
 We have two set of CurveOnSurface s, 'curves1' and 'curves2', and two BoundedSurface s, 'bd_sf1' and 'bd_sf2'.
vector< vector< shared_ptr<
CurveOnSurface > > > 
Go::BoundedUtils::getBoundaryLoops (const BoundedSurface &sf, vector< shared_ptr< CurveOnSurface > > &part_bnd_cvs)
 This function tries to complete "partial" boundary loops by filling out the missing parts using fragments from the domain boundary of a BoundedSurface.
vector< shared_ptr< BoundedSurface > > Go::BoundedUtils::trimWithPlane (const shared_ptr< Go::ParamSurface > &surf, Point point, Point normal, double epsge)
 We intersect a parametric surface with a plane, and return the surface(s) consisting only of the part(s) of the surface that were located on the positive side of the intersection.
vector< shared_ptr< BoundedSurface > > Go::BoundedUtils::trimSurfWithSurf (const shared_ptr< Go::ParamSurface > &sf1, const shared_ptr< Go::ParamSurface > &sf2, double epsge)
 If the argument surfaces intersect, and if the intersection curves result in new boundary loops being defined, then the new surface parts defined within these domains will be returned.
BoundedSurfaceGo::BoundedUtils::convertToBoundedSurface (const SplineSurface &surf, double space_epsilon)
 Convert a SplineSurface to a BoundedSurface.
vector< shared_ptr< BoundedSurface > > Go::BoundedUtils::createTrimmedSurfs (vector< vector< boost::shared_ptr< CurveOnSurface > > > &loops, shared_ptr< SplineSurface > &under_sf, double epsgeo)
 Define the surfaces that result from trimming a given SplineSurface with a set of boundary loops.
std::vector< shared_ptr< CurveOnSurface > > Go::BoundedUtils::intersectWithPlane (shared_ptr< SplineSurface > &surf, Point pnt, Point normal, double geom_tol)
 Find the intersection curve(s) between a SplineSurface and a given plane.
void Go::BoundedUtils::getIntersectionCurve (shared_ptr< SplineSurface > &sf1, shared_ptr< SplineSurface > &sf2, vector< shared_ptr< CurveOnSurface > > &int_segments1, vector< shared_ptr< CurveOnSurface > > &int_segments2, double epsge)
 Find the intersction curve(s) between two spline surfaces.
void Go::BoundedUtils::translateBoundedSurf (Point trans_vec, BoundedSurface &bd_sf, double deg_eps)
 Translate a given BoundedSurface.
void Go::BoundedUtils::rotateBoundedSurf (Point rot_axis, double alpha, BoundedSurface &bf_sf, double deg_eps)
 
Parameters:
rot_axis a vector specifying the axis of rotation

void Go::closestPtCurves (const ParamCurve *cv1, const ParamCurve *cv2, double &par1, double &par2, double &dist, Point &ptc1, Point &ptc2)
 Compute a closest point or an intersection point between two curves.
void Go::closestPtCurves (const ParamCurve *cv1, const ParamCurve *cv2, double tmin1, double tmax1, double tmin2, double tmax2, double seed1, double seed2, double &par1, double &par2, double &dist, Point &ptc1, Point &ptc2)
 Newton iteration on the distance function between two curves to find a closest point or an intersection point.
void Go::computeSeedCvCv (const SplineCurve *pc1, const SplineCurve *pc2, double &seed1, double &seed2)
 Computes initial start points for iteration along the curves.
void Go::insideParamDomain (double &delta, double acoef, double astart, double aend)
 Adjust delta to satisfy:

\[ astart \leq acoef+delta \leq aend \]

Ported from the sisl function s1770_s9corr.

void Go::nextStep (double &cdist, double &cdiff1, double &cdiff2, std::vector< Point > &eval1, std::vector< Point > &eval2)
 Computes the distance vector and value beetween a point on the first curve and a point on the second curve.
void Go::closestPtCurves2D (ParamCurve *cv1, ParamCurve *cv2, double aepsge, double tmin1, double tmax1, double tmin2, double tmax2, double seed1, double seed2, int method, bool quick, double &par1, double &par2, double &dist, Point &ptc1, Point &ptc2, int &istat)
 Newton iteration on the distance function between two curves in 2D to find a closest point or an intersection point.
void Go::closestPtCurveSurf (ParamCurve *pcurve, ParamSurface *psurf, double aepsge, double astart1, double aend1, RectDomain *domain, double anext1, double enext2[], double &cpos1, double gpos2[], double &dist, Point &pt_cv, Point &pt_su, bool second_order=false)
 Newton iteration on the distance function between a curve and a surface to find a closest point or an intersection point.
void Go::closestPtCurveSurf (ParamCurve *pcurve, ParamSurface *psurf, double aepsge, double astart1, double estart2[], double aend1, double eend2[], double anext1, double enext2[], double &cpos1, double gpos2[], double &dist, Point &pt_cv, Point &pt_su, int &istat, bool second_order=false)
 Newton iteration on the distance function between a curve and a surface to find a closest point or an intersection point.
void Go::closestPtSurfSurfPlane (const std::vector< Point > &epoint, const std::vector< Point > &epnt1, const std::vector< Point > &epnt2, const Point &epar1, const Point &epar2, const ParamSurface *psurf1, const ParamSurface *psurf2, double aepsge, std::vector< Point > &gpnt1, std::vector< Point > &gpnt2, Point &gpar1, Point &gpar2, int &jstat, AlgorithmChoice algo=FUNCTIONAL)
 Newton iteration on the distance function between two surfaces and a plane to find a closest point or an intersection point.
void Go::closestPtSurfSurfPlaneGeometrical (const std::vector< Point > &epoint, const std::vector< Point > &epnt1, const std::vector< Point > &epnt2, const Point &epar1, const Point &epar2, const ParamSurface *psurf1, const ParamSurface *psurf2, double aepsge, std::vector< Point > &gpnt1, std::vector< Point > &gpnt2, Point &gpar1, Point &gpar2, int &jstat)
 This is the geometrically-based implementation of closestPtSurfSurfPlane.
void Go::closestPtSurfSurfPlaneFunctional (const std::vector< Point > &epoint, const std::vector< Point > &epnt1, const std::vector< Point > &epnt2, const Point &epar1, const Point &epar2, const ParamSurface *psurf1, const ParamSurface *psurf2, double aepsge, std::vector< Point > &gpnt1, std::vector< Point > &gpnt2, Point &gpar1, Point &gpar2, int &jstat)
 This is the functional-based implementation of closestPtSurfSurfPlane.
SplineSurface * Go::CoonsPatchGen::createCoonsPatch (const CurveLoop &boundary)
 Create a new SplineSurface representing the coons patch as defined by a loop of four SplineCurves.
SplineSurface * Go::CoonsPatchGen::createCoonsPatch (std::vector< boost::shared_ptr< ParamCurve > > &bd_curves, std::vector< boost::shared_ptr< ParamCurve > > &cross_curves, double epsge, double kink_tol)
 bd_curves form a loop, all cross curves point into the surface.
SplineSurface * Go::CoonsPatchGen::createCoonsPatch (std::vector< boost::shared_ptr< SplineCurve > > &bd_curves, std::vector< boost::shared_ptr< SplineCurve > > &cross_curves)
 Create a Gordon Surface from input curves.
SplineSurface * Go::CoonsPatchGen::createGordonSurface (std::vector< boost::shared_ptr< SplineCurve > > &mesh_curves, std::vector< double > &params, int &nmb_u_crvs, bool use_param_values)
 Create a Gordon Surface from input curves and parameters.
SplineSurface * Go::CoonsPatchGen::createGordonSurface (std::vector< boost::shared_ptr< SplineCurve > > &mesh_curves, std::vector< double > &params, int &nmb_u_crvs, std::vector< boost::shared_ptr< SplineCurve > > &cross_curves, std::vector< int > &cross_index, bool use_param_values=true)
 Create a Gordon Surface from input curves and parameters.
SplineSurface * Go::CoonsPatchGen::doCreateSurface (std::vector< boost::shared_ptr< SplineCurve > > &mesh_curves, std::vector< double > &params, int &nmb_u_crvs, std::vector< boost::shared_ptr< SplineCurve > > &cross_curves, std::vector< int > &cross_index)
 Create a Gordon Surface interpolating the input curves in the input parameters.
SplineSurface * Go::CoonsPatchGen::loftSurface (std::vector< boost::shared_ptr< SplineCurve > >::iterator first_curve, int nmb_crvs)
 Create a lofting surface based on the input curves.
SplineSurface * Go::CoonsPatchGen::loftSurface (std::vector< boost::shared_ptr< SplineCurve > >::iterator first_curve, std::vector< double >::iterator first_param, int nmb_crvs)
 Create a lofting surface interpolating the input curves in the input parameters.
SplineSurface * Go::CoonsPatchGen::loftSurface (std::vector< boost::shared_ptr< SplineCurve > >::iterator first_curve, std::vector< double >::iterator first_param, int nmb_crvs, std::vector< boost::shared_ptr< SplineCurve > >::iterator first_cross_curve, std::vector< int > &cross_index)
 Create a lofting surface interpolating the input curves and cross tangent curves in the input parameters.
SplineSurface * Go::CoonsPatchGen::tpSurface (const std::vector< boost::shared_ptr< SplineCurve > > &mesh_curves, std::vector< double > params, int nmb_u_crvs, const std::vector< boost::shared_ptr< SplineCurve > > &cross_curves, std::vector< int > &cross_index)
 Make tensor product surface which interpolates given grid points.
void Go::CoonsPatchGen::splitMeshCurves (std::vector< boost::shared_ptr< SplineCurve > > &mesh_curves, std::vector< double > &params, int &nmb_u_crvs, std::vector< int > &cross_index, double epsgeo)
 Given input iso-curves, the curves are analyzed and the ordering altered such that the nmb_u_crvs first elements are u-curves, and the rest are v-curves.
void Go::CoonsPatchGen::sortMeshCurves (std::vector< boost::shared_ptr< SplineCurve > > &mesh_curves, std::vector< double > &params, int nmb_u_crvs, std::vector< int > &cross_index)
 Given that mesh_curves has been regrouped with u-curves up front, we sort the vector according to values in params.
void Go::CoonsPatchGen::getCrossTangs (const std::vector< boost::shared_ptr< SplineCurve > > &curves, std::vector< boost::shared_ptr< SplineCurve > > &mod_cross_curves, double tol1, double tol2)
 Prepare cross tangents for surface creation.
void Go::CoonsPatchGen::addMissingCrossCurves (const std::vector< boost::shared_ptr< SplineCurve > > &bnd_curves, std::vector< boost::shared_ptr< SplineCurve > > &cross_crvs)
 Generates missing cross boundary curves.
void Go::CoonsPatchGen::getTangBlends (std::vector< boost::shared_ptr< SplineCurve > > &curves, int iedge, std::vector< boost::shared_ptr< SplineCurve > > &blend_functions)
 Find blending functions used to blend two derivative along some boundary curves corresponding to a surface, into a cross derivative curve pr edge.
void Go::CoonsPatchGen::blendcoef (double evecu[], double evecv[], double etang[], int idim, int isign, double *coef1, double *coef2)
 Project the etang vector onto the plane defined by evecu and evecv.
void Go::CoonsPatchGen::hermit (double econd[], int icond, bool hasder1, double astart, double aend, int idim)
 Hermite interpolate the input points.
void Go::CoonsPatchGen::fixCrossEndPts (const std::vector< boost::shared_ptr< SplineCurve > > &bd_curves, const std::vector< boost::shared_ptr< SplineCurve > > &cross_curves)
 Make sure that the end points of the existing cross_tangent_curves match the end derivatives of the corresponding bd_curves.
void Go::CoonsPatchGen::makeLoftParams (std::vector< boost::shared_ptr< SplineCurve > >::const_iterator first_curve, int nmb_crvs, double param_length, std::vector< double > &params)
 Calculate iso parameters for the input curves.
void Go::CoonsPatchGen::reparamBoundaryCurve (std::vector< boost::shared_ptr< SplineCurve > > &curves, double aconst)
 Check length of tangent vectors at the endpoints of a curve compared to the size of the curve.
SplineCurve * Go::CreatorsUtils::getParametricCurve (const std::vector< boost::shared_ptr< const CurveOnSurface > > &cv)
 Helper function.
boost::shared_ptr< Go::SplineCurveGo::CreatorsUtils::createCrossTangent (const Go::CurveOnSurface &cv)
 Generate the inwards pointing cross-tangent curve along the input trim curve.
boost::shared_ptr< Go::SplineCurveGo::CreatorsUtils::createCrossTangent (const Go::CurveOnSurface &cv, boost::shared_ptr< Go::SplineCurve > basis_space_cv, const Go::SplineCurve *cross_cv_ref, bool appr_offset_cv=true)
 The cross tangent cv along input cv is created.
void Go::computeFirstFundamentalForm (const ParamSurface &sf, double u, double v, int derivs, std::vector< double > &form)
 Computes the coefficients of the first fundamental form.
void Go::computeSecondFundamentalForm (const ParamSurface &sf, double u, double v, double form1[3], double form2[3])
 Computes the coefficients of the first and second fundamental forms.
void Go::curvatures (const ParamSurface &sf, double u, double v, double &K, double &H)
 Computes the Gaussian (K) and mean (H) curvatures.
SplineCurve * Go::CurveCreators::multCurveWithFunction (const SplineCurve &alpha, const SplineCurve &f)
 Construct a SplineCurve which is the 'product' of another SplineCurve and a function (which is given as a 1-dimensional SplineCurve).
SplineCurve * Go::CurveCreators::blend (const SplineCurve &alpha_1, const SplineCurve &f_1, const SplineCurve &alpha_2, const SplineCurve &f_2)
 Given blend functions alpha_1 & alpha_2 (represented as 1-dimensional SplineCurves), and the spline curves f_1 and f_2, return the blended expression 'alpha_1 * f_1 + alpha_2 * f_2'.
SplineCurve * Go::CurveCreators::approxCurves (boost::shared_ptr< SplineCurve > *first_crv, boost::shared_ptr< SplineCurve > *last_crv, const std::vector< Point > &start_pt, const std::vector< Point > &end_pt, double approxtol, double &maxdist, int max_iter=5)
 This function is used generate one SplineCurve which approximates a sequence of (supposedly end-to-end continuous) input SplineCurves.
SplineCurve * Go::CurveCreators::projectSpaceCurve (boost::shared_ptr< SplineCurve > &space_cv, boost::shared_ptr< SplineSurface > &surf, boost::shared_ptr< Point > &start_par_pt, boost::shared_ptr< Point > &end_par_pt, double epsge, const RectDomain *domain_of_interest=NULL)
 Generate a SplineCurve which lies on a given (part of a) SplineSurface and is the projection og a given SplineCurve onto that surface.
SplineCurve * Go::CurveCreators::liftParameterCurve (boost::shared_ptr< SplineCurve > &parameter_cv, boost::shared_ptr< SplineSurface > &surf, double epsge)
 'Lift' a 2D parameter curve onto a surface.
SplineCurve * Go::CurveCreators::createCircle (Point center, Point axis, Point normal, double radius)
 Generate a 3D SplineCurve representing a circle.
boost::shared_ptr< Go::SplineCurveGo::CurveCreators::insertParamDomain (const Go::SplineCurve &cv_1d, double knot_tol=1e-08)
 Given input of 1-dimensional curve, return the 2-dimensional visualization (x, f(x)).
template<class PtrToCurveType>
double Go::computeLoopGap (const std::vector< PtrToCurveType > &curves)
 Computes the largest gap in the loop specified by the vector of curves.
int Go::extremalPtSurfSurf (ParamSurface *psurf1, ParamSurface *psurf2, int constraints[2], double constraints_par[2], double limit[], double enext[], double gpos[], double angle_tol)
 Finds one point in each surface where the two normals are parallel to each other and to the difference vector between the two points.
template<class T>
void Go::Register ()
 This function is used to register a class derived from GeomObject with the global Factory.
int Go::analyzePeriodicity (const SplineCurve &cv, double knot_tol=1e-12)
 Analyze periodicity of curve based on number of repeating knots and control points.
int Go::analyzePeriodicity (const SplineSurface &sf, int direction, double knot_tol=1e-12)
 Analyze periodicity of surface based on number of repeating knots and control points.
int Go::analyzePeriodicity (const BsplineBasis &basis, double knot_tol=1e-12)
 Analyze periodicity of basis based on number of repeating knots.
int Go::analyzePeriodicityDerivs (const ParamCurve &cv, int max_derivs, double tol=1e-14)
 Analyze periodicity of curve based on evaluating derivatives at both endpoints.
int Go::analyzePeriodicityDerivs (const SplineSurface &sf, int direction, int max_derivs, double tol=1e-14)
 Analyze periodicity of surface based on evaluating derivatives at opposing ends of the surface.
boost::shared_ptr< SplineCurve > Go::curveSum (const SplineCurve &crv1, double fac1, const SplineCurve &crv2, double fac2, double num_tol=1e-05)
 Addition of two signed SplineCurves, i.e.
void Go::estimateSurfaceSize (const SplineSurface &srf, double &length_u, double &length_v)
 Rough estimate of the size of a parametric surface.
void Go::estimateIsoCurveLength (const SplineSurface &srf, bool dir_u, double par, double &length)
 estimate the length of an iso-curve on the surface
bool Go::degenerateToCurve (const SplineSurface &srf, bool dir_u, double tol)
 Check if a given spline surface degnerates to a curve within a given tolerance.
void Go::makeBdDegenerate (SplineSurface &srf, int bd_idx)
 Make a specified surface boundary exactly degenerate.
bool Go::checkConstantCoef (SplineCurve &cv, int idx, double val, double max_dist, double tol)
 Check if a curve coefficient is equal to a constant in a specified dimension provided it already lies close.
void Go::setSfBdCoefToConst (SplineSurface &srf, int bd_idx, int idx_d, double val, double deg_tol)
 Modify surface along specified boundary to match a specific constant in one direction.
void Go::findDominant (const SplineSurface &surface, Vector3D &dominant_u, Vector3D &dominant_v)
 Finds the "dominant u- and v-vectors" for a surface, defined to be the sum of all the vectors pointing from one control point to the next in the u- and v-directions.
void Go::getGnJoints (const ParamCurve &curve, const std::vector< double > &cont, std::vector< double > &gn_joints)
 Partition the given curve into segments where each segment is at least G^n continuous (currently supporting up to G2 continuity).
void Go::getGnJoints (const CurveLoop &loop, const std::vector< double > &cont, std::vector< std::vector< double > > &gn_joints)
 Partition a given CurveLoop into segments where each segment is at least G^n continuous (currently supporting up to G2 continuity).
bool Go::isCoincident (const ParamCurve &cv1, const ParamCurve &cv2, double epsge)
 Returns true if the curves are approximately coincident (that is, they have the same parameter space and overlap in space).
bool Go::negativeProj (const SplineSurface &surface, const Array< Vector3D, 2 > &refvector, const double eps=0.0)
 Returns true if any vector difference between neighboring control points in the u- or v-directions has negative projection on the given reference vector.
boost::shared_ptr< SplineCurve > Go::projectCurve (const SplineCurve &incurve, const Point &normal, bool planar)
 Project a 3D SplineCurve into a given plane.
boost::shared_ptr< SplineCurve > Go::representSurfaceAsCurve (const SplineSurface &surface, int cv_dir)
 Describe a surface as a high-dimensional curve in a given direction.
boost::shared_ptr< SplineSurface > Go::representCurveAsSurface (const SplineCurve &curve, int cv_dir, const BsplineBasis &other_bas, bool rational)
 Describe a curve as a lower-dimensional surface in a given direction.
std::vector< double > Go::getRotationMatrix (const Point &unit_axis_dir, double alpha)
 Compute the elements of the matrix describing a rotation or a given number of radians around a given axis going through the origin.
void Go::rotateSplineSurf (Point rot_axis, double alpha, SplineSurface &sf)
 Rotate the given SplineSurface a certain angle around a given axis.
void Go::rotateSplineCurve (Point rot_axis, double alpha, SplineCurve &cv)
 Rotate the given SplineCurve a certain angle around a given axis.
void Go::rotateLineCloud (Point rot_axis, double alpha, LineCloud &lc)
 Rotate the given LineCloud a certain angle around a given axis.
void Go::rotatePoint (Point rot_axis, double alpha, double *space_pt)
 Rotate the given 3D point a certain angle around a certain axis.
void Go::splitCurveIntoSegments (const SplineCurve &cv, std::vector< SplineCurve > &seg)
 Split a spline curve into Bezier segments.
std::vector< boost::shared_ptr<
SplineSurface > > 
Go::splitInKinks (const SplineSurface &sf, const std::vector< double > &u_kinks, const std::vector< double > &v_kinks)
 Extract sub patches from the surface given by input parameters.
void Go::splitSurfaceIntoPatches (const SplineSurface &sf, std::vector< SplineSurface > &pat)
 Splits a spline surface into Bezier patches.
void Go::surfaceKinks (const SplineSurface &sf, double max_normal_angle, std::vector< double > &g1_disc_u, std::vector< double > &g1_disc_v)
 Surface assumed to be continuous.
void Go::translateSplineSurf (const Point &trans_vec, SplineSurface &sf)
 Translate the given SplineSurface by trans_vec.
void Go::translateSplineCurve (const Point &trans_vec, SplineCurve &cv)
 Translate the given SplineCurve by trans_vec.
void Go::translateLineCloud (const Point &trans_vec, LineCloud &lc)
 Translate the given LineCloud by trans_vec.
void Go::averageBoundaryCoefs (boost::shared_ptr< SplineSurface > &srf1, int bd1, bool keep_first, boost::shared_ptr< SplineSurface > &srf2, int bd2, bool keep_second, bool found_corner1, Point corner1, bool found_corner2, Point corner2, bool opposite)
 Average specified boundary coefficients between two spline surfaces to ensure a C0 transition.
void Go::unifyCurveSplineSpace (std::vector< boost::shared_ptr< SplineCurve > > &curves, double tol)
 Make sure that a set of curves live on the same knot vector tol-equal knots are set equal (i.e.
void Go::unifySurfaceSplineSpace (std::vector< boost::shared_ptr< SplineSurface > > &surfaces, double tol, int dir=0)
 Make sure that a set of surfaces live on the same knot vectors tol-equal knots are set equal (i.e.
boost::shared_ptr< SplineSurface > Go::joinPatches (const std::vector< boost::shared_ptr< SplineSurface > > &patches, const SplineSurface &spline_space)
 Join patches with continuity according to input basis_u & basis_v.
void Go::intersect2Dcurves (const ParamCurve *cv1, const ParamCurve *cv2, double epsge, std::vector< std::pair< double, double > > &intersections, std::vector< int > &pretopology)
 Intersect two 2D spline curves.
void Go::intersectcurves (SplineCurve *cv1, SplineCurve *cv2, double epsge, std::vector< std::pair< double, double > > &intersections)
 Intersect two spline curves.
void Go::closestPtCurves (SplineCurve *cv1, SplineCurve *cv2, double epsge, double &par1, double &par2, double &dist)
 Compute the closest point between two curves.
std::vector< boost::shared_ptr<
Go::ParamSurface > > 
Go::HahnsSurfaceGen::constructPolygonialSurface (std::vector< boost::shared_ptr< Go::ParamCurve > > &bnd_curves, std::vector< boost::shared_ptr< Go::ParamCurve > > &cross_curves, double neighbour_tol, double kink_tol, double knot_diff_tol)
 The routine which actually creates vector of blending surfaces, with given curves as their total bnd curve.
std::vector< boost::shared_ptr<
Go::ParamSurface > > 
Go::HahnsSurfaceGen::constructHahnsSurface (std::vector< boost::shared_ptr< Go::SplineCurve > > &bnd_curves, std::vector< boost::shared_ptr< Go::SplineCurve > > &mod_cross_curves, double neighbour_tol, double kink_tol, double knot_diff_tol)
 Given input of bnd_curves and cross_tangent curves, create the corresponding Hahns Surface.
void Go::GaussQuadInner (const BsplineBasis &basis, int ider, double lim1, double lim2, double ***integral)
 Compute all definite integrals of inner products of derivatives of B-splines up to a given order where the differentiation is of the same order for both B-splines.
void Go::GaussQuadInner2 (const BsplineBasis &basis, int ider, double lim1, double lim2, double **integral)
 Compute all definite integrals of inner products of derivatives of B-splines up to a given order where the differentiation is of the same order for both B-splines.
bool Go::LoopUtils::loopIsCCW (const std::vector< boost::shared_ptr< Go::SplineCurve > > &simple_par_loop, double int_tol)
 Check if a closed 2D-loop is oriented counterclockwise or not.
bool Go::LoopUtils::paramIsCCW (const std::vector< boost::shared_ptr< Go::CurveOnSurface > > &loop, double int_tol)
 Check if a loop defined by CurveOnSurface s is oriented counterclockwise in the surface's parametric domain.
bool Go::LoopUtils::firstLoopInsideSecond (const std::vector< boost::shared_ptr< Go::CurveOnSurface > > &first_loop, const std::vector< boost::shared_ptr< Go::CurveOnSurface > > &second_loop, double loop_tol, double int_tol)
 Test whether one loop lies entirely within another.
template<class PtrToCurveType>
void Go::orientCurves (const std::vector< PtrToCurveType > &curves, std::vector< int > &permutation, std::vector< bool > &reversed, double neighbour_tol, bool assume_manifold=true)
 This function sorts and orients a set of curves so that curves whose endpoints coincide will be ordered consecutively, and eventually 'reversed' so that startpoints meet endpoints.
SISLCurve * Go::Curve2SISL (const SplineCurve &cv, bool copy=true)
 Convert a SplineCurve to a SISLCurve.
SplineCurve * Go::SISLCurve2Go (const SISLCurve *const cv)
 Convert a SISLCurve to a SplineCurve.
SISLSurf * Go::GoSurf2SISL (const SplineSurface &sf, bool copy=true)
 Convert a SplineSurface to a SISLSurface.
SplineSurface * Go::SISLSurf2Go (SISLSurf *sf)
 Convert a SISLSurface to a SplineSurface.
void Go::writeSpaceParamCurve (const SplineCurve &pcurve, std::ostream &os, double z=0.0)
 For debugging.
void Go::objToFile (GeomObject *geom_obj, char *to_file)
 writes the geometric object (with header) to the specified file name.
void Go::objsToFile (std::vector< boost::shared_ptr< GeomObject > > &geom_objs, char *to_file)
 writes the geometric objects (with header) to the specified file name.
void Go::writeSISLFormat (const SplineCurve &spline_cv, std::ostream &os)
 Write a SplineCurve to a stream using the SISL file format (not the Go format).
void Go::transpose_array (int dim, int m, int n, double *array_start)
 Transpose an (m x n) matrix of dim-dimensional points stored as an array in row-major order (i.e.
int Go::closest_in_array (const double *pt, const double *array, int n, int dim)
 Find the point in an array closest to the given base point (measured in the usual, Euclidean distance).
Vector3D Go::closest_on_triangle (const Vector3D &pt, const Vector3D tri[3], double &clo_dist2)
 Find the closest point on a triangle, in barycentric coordinates.
double Go::closest_on_line_segment (const Vector3D &pt, const Vector3D &beg, const Vector3D &end)
 Find the closest point on a line segment to a given point.
void Go::closest_on_rectgrid (const double *pt, const double *array, int m, int n, double &clo_u, double &clo_v)
 Find an approximate closest point on a rectangular grid of 3-dimensional points.
void Go::closest_on_rectgrid (const double *pt, const double *array, int u_min, int u_max, int v_min, int v_max, int nmb_coefs_u, double &clo_u, double &clo_v)
 Find an approximate closest point on a sub-grid of a rectangular grid of 3-dimensional points.
void Go::make_coef_array_from_rational_coefs (const double *rationals, double *coefs, int num_coefs, int dim)
 convert an array of rational coefficients to an array of nonrational coefficients
void Go::curve_ratder (double const eder[], int idim, int ider, double gder[])
 This function takes as input the position and a certain number of derivatives in homogenous space of a point on a rational curve.
void Go::surface_ratder (double const eder[], int idim, int ider, double gder[])
 This function takes as input the position and a certain number of derivatives in homogenous space of a point on a rational surface.
void Go::osloalg (int ij, int imy, int ik, int in, int *jpl, int *jfi, int *jla, double *et, double *etau, double *galfa)
 Corresponds to s1701 in SISL This function computes in a compact format a line in the discrete B-spline matrix converting between an orginal basis "etau" and a new basis "et".
void Go::refmatrix (double *et, int im, int ik, double *etau, int in, double *ea, int *nfirst, int *nlast)
 Corresponds to sh1922 in SISL Computes the B-spline refinement transformation matrix from the spline space generated by the knot vector etau to the refined spline space generated by the refined knot vector et.
std::istream & Go::operator>> (std::istream &is, Go::Streamable &obj)
std::ostream & Go::operator<< (std::ostream &os, const Go::Streamable &obj)
boost::shared_ptr< SplineSurface > Go::SurfaceCreators::createSmoothTransition (const std::vector< boost::shared_ptr< const ParamSurface > > &surfs, const std::vector< boost::shared_ptr< const CurveOnSurface > > &int_cvs, double dist_0, double dist_1, double epsge, std::vector< boost::shared_ptr< SplineCurve > > &trim_crvs)
 Given input of two parametric surfaces, which intersect along an edge, create a smooth surface by moving boundary of surfs to inner part of current surfs.
boost::shared_ptr< SplineSurface > Go::SurfaceCreators::mult1DSurfaces (const SplineSurface &sf1, const SplineSurface &sf2)
 Return the product of the two spline surfaces.
boost::shared_ptr< SplineSurface > Go::SurfaceCreators::mult1DBezierPatches (const SplineSurface &patch1, const SplineSurface &patch2)
 Return the product of the two Bezier patches.
boost::shared_ptr< Go::SplineSurfaceGo::SurfaceCreators::mergeRationalParts (const Go::SplineSurface &nom_sf, const Go::SplineSurface &den_sf, bool weights_in_first=false)
 Return the rational surface 'nom_sf/den_sf'.
boost::shared_ptr< Go::SplineSurfaceGo::SurfaceCreators::insertParamDomain (const Go::SplineSurface &sf_1d)
 Given input of 1d-sf, return the 3d visualization (u, v, f(u, v)).
std::vector< boost::shared_ptr<
Go::SplineSurface > > 
Go::SurfaceCreators::separateRationalParts (const Go::SplineSurface &sf)
 Assuming the sf is rational, separate the geometric space from the homogenuous.
template<typename ForwardIterator>
go_iterator_traits< ForwardIterator
>::value_type 
Go::sum (ForwardIterator first, ForwardIterator last)
 sum finds the sum of the elements
template<typename ForwardIterator>
go_iterator_traits< ForwardIterator
>::value_type 
Go::sum_squared (ForwardIterator first, ForwardIterator last)
 sum_squared finds the squared sum of the elements
template<typename ForwardIterator>
go_iterator_traits< ForwardIterator
>::value_type 
Go::distance_squared (ForwardIterator first1, ForwardIterator last1, ForwardIterator first2)
 distance_squared
template<typename ForwardIterator>
void Go::normalize (ForwardIterator first, ForwardIterator last)
 normalize makes the length of a vector 1.0
template<typename ForwardIterator>
go_iterator_traits< ForwardIterator
>::value_type 
Go::inner (ForwardIterator first, ForwardIterator last, ForwardIterator second)
 inner product
template<typename InputStream>
InputStream & Go::eatwhite (InputStream &is)
 eat white space
int Go::BsplineBasis::lastKnotInterval () const
 Return the index of the left knot of the last knot interval accessed for some reason (evaluation, etc.
double Go::BsplineBasis::grevilleParameter (int index) const
 Get the greville parameter starting from a certain knot.

Variables

const int Go::MAJOR_VERSION = 1
const int Go::MINOR_VERSION = 0

Typedef Documentation

typedef struct Go::sideConstraint Go::sideConstraint

Struct defining linear side constraints between control points in a surface.

The elements of factor_ correspond to a linear combination of control points on the left side of the equation, whilst constant_term_ denotes the right side of the equation.

typedef struct Go::sideConstraintSet Go::sideConstraintSet

Struct defining linear side constraints between control points in a set of surfaces.

The elements of factor_ correspond to a linear combination of control points on the left side of the equation, whilst constant_term_ denotes the right side of the equation.


Enumeration Type Documentation

enum Go::AlgorithmChoice

This enumeration denotes whether the 'closestPtSurfSurfPlane' function should base itself upon a geometrical algorithm (marching on the surfaces) or a pure functional one (constrained minimization of a cost function).

The default has been set to FUNCTIONAL, as there are flaws in the GEOMETRICAL one when it comes to close-to-degenerate cases.

Definition at line 55 of file closestPtSurfSurfPlane.h.

enum Go::ClassType

All concrete classes that inherit GeomObject should have a matching enum in ClassType.

It is necessary to have a central location for the type identification numbers, so that two classes in different modules (for example) does not try to use the same number. At the same time, it is something we'd like to avoid, because it forces you to update this file every time you add a new GeomObject- inheriting class.

Definition at line 51 of file ClassType.h.


Function Documentation

void Go::CoonsPatchGen::addMissingCrossCurves ( const std::vector< boost::shared_ptr< SplineCurve > > &  bnd_curves,
std::vector< boost::shared_ptr< SplineCurve > > &  cross_crvs 
)

Generates missing cross boundary curves.

In case of missing cross_crv, we're expecting a NULL pointer. boundary_crvs form a loop. cross_crvs share spline space, and all cross curves point inwards = into the surface. A missing cross_curve is indicated by a null pointer. The added cross curve will also point inwards, following parametrization given by boundary curves.

int Go::analyzePeriodicity ( const BsplineBasis &  basis,
double  knot_tol = 1e-12 
)

Analyze periodicity of basis based on number of repeating knots.

The return value is -1 if there is no repeating (or order-tuple end knots), up to k if there are (order-1-k)-tuple end knots and sufficient repeats for a C^k curve. This is mostly a helper function for the curve and surface analysis functions.

Parameters:
basis reference to the BsplineBasis to analyze
knot_tol the tolerance used when comparing knots and knot intervals
Returns:
-1 if there is no repeating (or order-tuple end knots), up to k if there are (order-1-k)-tuple end knots and sufficient repeats for a C^k curve.

int Go::analyzePeriodicity ( const SplineSurface &  sf,
int  direction,
double  knot_tol = 1e-12 
)

Analyze periodicity of surface based on number of repeating knots and control points.

The return value is -1 if the surface edges are disjoint, otherwise k if sf is C^k continuous across the seam. These are sufficient but not necessary conditions for periodicity, so it is possible that a call to analyzePeriodicityDerivs() will yield a higher degree of periodicity. The current implementation is quite slow, and not optimized for speed.

Parameters:
sf reference to the SplineSurface to be analyzed
direction specify 'direction' to be '0' to check for periodicity in the first parameter direction, or '1' to check the second parameter direction.
knot_tol the tolerance used when comparing knot intervals
Returns:
-1 if the surface edges are disjoint, otherwise k if the

int Go::analyzePeriodicity ( const SplineCurve &  cv,
double  knot_tol = 1e-12 
)

Analyze periodicity of curve based on number of repeating knots and control points.

The return value is -1 if the curve ends are disjoint, otherwise k if cv is C^k continuous. These are sufficient but not necessary conditions for periodicity, so it is possible that a call to analyzePeriodicityDerivs() will yield a higher degree of periodicity.

Parameters:
cv the curve to analyse
knot_tol the tolerance used when comparing knot intervals.
Returns:
-1 if the curve ends are disjoint, or k if the curve is proven to be C^k continuous.

int Go::analyzePeriodicityDerivs ( const SplineSurface &  sf,
int  direction,
int  max_derivs,
double  tol = 1e-14 
)

Analyze periodicity of surface based on evaluating derivatives at opposing ends of the surface.

The return value is -1 if the surface edges are disjoint, otherwise k if sf is C^k continuous across the seam. These are sufficient but not necessary conditions for periodicity, so it is possible that a call to analyzePeriodicityDerivs() will yield a higher degree of periodicity. The current implementation is quite slow, and not optimized for speed.

Parameters:
sf the SplineSurface to analyze for periodicity
direction the parameter direction to check for periodicity (0 to check in the first parameter direction, 1 to check in the second.
max_derivs the maximum of computed derivatives (the analysis cannot detect continuities beyond this value
tol the tolerance used when comparing points and derivatives for approximate equality.
Returns:
-1 if the surface edges are disjoint, or k if the surface is proven to be C^k continuous across the seam.

int Go::analyzePeriodicityDerivs ( const ParamCurve &  cv,
int  max_derivs,
double  tol = 1e-14 
)

Analyze periodicity of curve based on evaluating derivatives at both endpoints.

The return value is -1 if the curve ends are disjoint, otherwise k if cv is C^k continuous. A maximum of max_derivs derivatives are computed, so the analysis cannot yield a higher return value then max_derivs. The tolerance is the amount the point and derivatives are allowed to be different at the two ends. The default is quite tight!

Parameters:
cv the curve to be analyzed for periodicity
max_derivs the maximum of computed derivatives (the analysis can not detect continuities beyond this value).
tol the tolerance used when comparing points and derivatives for approximate equality
Returns:
-1 if the curve ends are disjoint, k if the curve is proven to be C^k continuous.

SplineCurve* Go::CurveCreators::approxCurves ( boost::shared_ptr< SplineCurve > *  first_crv,
boost::shared_ptr< SplineCurve > *  last_crv,
const std::vector< Point > &  start_pt,
const std::vector< Point > &  end_pt,
double  approxtol,
double &  maxdist,
int  max_iter = 5 
)

This function is used generate one SplineCurve which approximates a sequence of (supposedly end-to-end continuous) input SplineCurves.

In addition, the user can define explicitly the start and end point and tangent of the generated curve.

Parameters:
first_crv pointer to the start of a range of (shared pointers to) SplineCurves, supposedly stored so that the end point of each curve coincides with the start point of the succeeding one.
last_crv pointer to one-past-last of the range of SplineCurves.
start_pt The user can choose to explicitly specify the start point and tangent of the curve to be generated. If so, then this vector must contain one or two elements: the start point and optionally the start tangent.
end_pt The user can choose to explicitly specify the end point and tangent of the curve to be generated. If so, then this vector must contain one or two elements: the end point and optionally the end tangent.
approxtol The routine will try to generate a curve that fits the given curves within a tolerance of 'approxtol', but is not guaranteed to succeed. If unsuccessful, a message will be written to standard output.
maxdist Reports the maximum found distance between the generated curve and the input curves.
Return values:
max_iter Specify the maximum number of iterations that is allowed in order to converge to a solution.
Returns:
a raw pointer to the generated SplineCurve. User assumes ownership.

SplineCurve* Go::CurveCreators::blend ( const SplineCurve &  alpha_1,
const SplineCurve &  f_1,
const SplineCurve &  alpha_2,
const SplineCurve &  f_2 
)

Given blend functions alpha_1 & alpha_2 (represented as 1-dimensional SplineCurves), and the spline curves f_1 and f_2, return the blended expression 'alpha_1 * f_1 + alpha_2 * f_2'.

NB: All the curves given as input must e defined on the same parameter interval. Their knotvectors and orders do not have to be equal, though.

Parameters:
alpha_1 the multiplier function for the first curve, 'f_1'. It is represented as an 1-dimensional SplineCurve.
f_1 The first SplineCurve to be blended.
alpha_2 the multiplier function for the second curve, 'f_2'. It is represented as an 1-dimensional SplineCurve
f_2 The second SplineCurve to be blended.
Returns:
A raw pointer to the newly generated SplineCurve, a blend between 'f_1' and 'f_2'. The user assumes ownership.

void Go::CoonsPatchGen::blendcoef ( double  evecu[],
double  evecv[],
double  etang[],
int  idim,
int  isign,
double *  coef1,
double *  coef2 
)

Project the etang vector onto the plane defined by evecu and evecv.

The projected vector will be represented as (*coef1)*evecu + (*coef2)*evecv.

Parameters:
evecu one of the vectors spanning the plane.
evecv one of the vectors spanning the plane.
etang vector to be projected.
idim the geometric dimension of the space.
isign sign with wich etang is to be multiplied.
coef1 scalar corresponding to evecu.
coef2 scalar corresponding to evecv.

int Go::closest_in_array ( const double *  pt,
const double *  array,
int  n,
int  dim 
)

Find the point in an array closest to the given base point (measured in the usual, Euclidean distance).

Parameters:
pt pointer to the base point (of dimension 'n')
array pointer to the array in which we will search
n number of elements in the array
dim dimension of the elements/base point

double Go::closest_on_line_segment ( const Vector3D &  pt,
const Vector3D &  beg,
const Vector3D &  end 
)

Find the closest point on a line segment to a given point.

Parameters:
pt the point for which we want to find the closest point on the line segment
beg the start point of the line segment
end the end point of the line segment
Returns:
the barycentric coordinate of the closest point on the line segment (number between 0 and 1, where 0 is the start point and 1 is the end point)

void Go::closest_on_rectgrid ( const double *  pt,
const double *  array,
int  u_min,
int  u_max,
int  v_min,
int  v_max,
int  nmb_coefs_u,
double &  clo_u,
double &  clo_v 
)

Find an approximate closest point on a sub-grid of a rectangular grid of 3-dimensional points.

The method used is to 'triangulate' the grid, and locate the closest point on this triangulation. We imagine that the parametrization of the sub-grid is from 'u_min' to 'u_max' along each row and from 'v_min' to 'v_max' along each column.

Parameters:
pt the point we want to search the closest point for
array pointer to the array of 3D-points; coordinates should be stored consecutively in a row-wise fashion.
u_min lowest column index of the subgrid we want to search
u_max highest column index of the subgrid we want to search
v_min lowest row index of the subgrid we want to search
v_max highest row index of the subgrid we want to search
nmb_coefs_u total number of columns in the complete grid (necessary to know in order to determine how far to jump to get to the next row in the subgrid.
clo_u upon function return; the u-parameter of the closest point, using the parametrization explained above.
clo_v upon function return; the v-parameter of the closest point, using the parametrization explained above.

void Go::closest_on_rectgrid ( const double *  pt,
const double *  array,
int  m,
int  n,
double &  clo_u,
double &  clo_v 
)

Find an approximate closest point on a rectangular grid of 3-dimensional points.

The method used is to 'triangulate' the grid, and locate the closest point on this triangulation. We imagine that the point grid is uniformly parametrized from 0 to m-1 along each row and from 0 to n-1 along each column, and we refer to these parameters as 'u' and 'v'.

Parameters:
pt the point we want to search the closest point for
array pointer to the array of 3D-points; coordinates should be stored consecutively in a row-wise fashion.
m number of columns in the point array
n number of rows in the point array
clo_u upon function return; the u-parameter of the closest point, using the parametrization explained above.
clo_v upon function return; the v-parameter of the closest point, using the parametrization explained above.

Vector3D Go::closest_on_triangle ( const Vector3D &  pt,
const Vector3D  tri[3],
double &  clo_dist2 
)

Find the closest point on a triangle, in barycentric coordinates.

Parameters:
pt the point for which we want to find the closest point on the triangle
tri the triangle, specified by its three corners
clo_dist2 the squared Euclidean distance from 'pt' to the closest point in the triangle.
Returns:
the barycentric coordinates of the closest point on the triangle

void Go::closestPtCurves ( SplineCurve *  cv1,
SplineCurve *  cv2,
double  epsge,
double &  par1,
double &  par2,
double &  dist 
)

Compute the closest point between two curves.

Parameters:
cv1 pointer to the first curve
cv2 pointer to the second curve
epsge geometrical tolerance
Return values:
par1 parameter of the closest point in the first curve
par2 parameter of the closest point in the second curve
dist distance between the curves at the closest point

void Go::closestPtCurves ( const ParamCurve *  cv1,
const ParamCurve *  cv2,
double  tmin1,
double  tmax1,
double  tmin2,
double  tmax2,
double  seed1,
double  seed2,
double &  par1,
double &  par2,
double &  dist,
Point &  ptc1,
Point &  ptc2 
)

Newton iteration on the distance function between two curves to find a closest point or an intersection point.

The solution is restricted to the intervals [tmin1,tmax1] and [tmin2,tmax2] in the first and second curves's parameter domain. Ported from the sisl function s1770.

Parameters:
cv1 Curve number one.
cv2 Curve number two.
tmin1 Min. parameter value. First curve
tmax1 Max. parameter value. First curve
tmin2 Min. parameter value. Second curve
tmax2 Max. parameter value. Second curve
seed1 Start point for iteration along curve number one.
seed2 Start point for iteration along curve number two.
Return values:
par1 Parameter value of the first curve's point.
par2 Parameter value of the second curve's point.
dist Distance between the points.
ptc1 Point on curve number one.
ptc2 Point on curve number two.

void Go::closestPtCurves ( const ParamCurve *  cv1,
const ParamCurve *  cv2,
double &  par1,
double &  par2,
double &  dist,
Point &  ptc1,
Point &  ptc2 
)

Compute a closest point or an intersection point between two curves.

Ported from the sisl-functions s1770, s1770_s9corr, s1770_s9dir

Parameters:
cv1 Curve number one.
cv2 Curve number two.
Return values:
par1 Parameter value of the first curve's point.
par2 Parameter value of the second curve's point.
dist Distance between the points.
ptc1 Point on curve number one.
ptc2 Point on curve number two.

void Go::closestPtCurves2D ( ParamCurve *  cv1,
ParamCurve *  cv2,
double  aepsge,
double  tmin1,
double  tmax1,
double  tmin2,
double  tmax2,
double  seed1,
double  seed2,
int  method,
bool  quick,
double &  par1,
double &  par2,
double &  dist,
Point &  ptc1,
Point &  ptc2,
int &  istat 
)

Newton iteration on the distance function between two curves in 2D to find a closest point or an intersection point.

The solution is restricted to the intervals [tmin1,tmax1] and [tmin2,tmax2] in the first and second curves's parameter domain. Ported from the sisl-function s1770_2D.

Parameters:
cv1 Curve number one.
cv2 Curve number two.
aepsge Geometry resolution.
tmin1 Min. parameter value. First curve
tmax1 Max. parameter value. First curve
tmin2 Min. parameter value. Second curve
tmax2 Max. parameter value. Second curve
seed1 Start point for iteration along curve number one.
seed2 Start point for iteration along curve number two.
method 1 or 2. Using the the method in s1770_2D, starting with order one or two. method=3 uses the method from s1770 (order one).
quick Reduce requirement on exactness.
Return values:
par1 Parameter value of the first curve's point.
par2 Parameter value of the second curve's point.
dist Distance in space between the points.
ptc1 Point on curve number one.
ptc2 Point on curve number two.
istat =1 Intersection. =2 Minimum value. =3 Nothing found.

void Go::closestPtCurveSurf ( ParamCurve *  pcurve,
ParamSurface *  psurf,
double  aepsge,
double  astart1,
double  estart2[],
double  aend1,
double  eend2[],
double  anext1,
double  enext2[],
double &  cpos1,
double  gpos2[],
double &  dist,
Point &  pt_cv,
Point &  pt_su,
int &  istat,
bool  second_order = false 
)

Newton iteration on the distance function between a curve and a surface to find a closest point or an intersection point.

The solution is restricted to the interval [astart1,aend1] in the curves's parameter domain and [estart2[],eend2[]] in the surface's parameter domain. Ported from the sisl-function s1772.

Parameters:
pcurve Pointer to the curve in the intersection.
psurf Pointer to the surface in the intersection.
aepsge Geometry resolution.
astart1 Start parameter value of the curve.
estart2[] Start parameter values of surface.
aend1 End parameter value of the curve.
eend2[] End parameter values of the surface.
anext1 Start point for iteration along curve number one.
enext2[] Start parameter values of the iteration on the surface.
second_order if 'true' the function will attempt a second-order method directly.
Return values:
cpos1 Parameter value of the curve in the intersection point.
gpos2[] Parameter values of the surface in the intersection point.
dist Distance between the points.
pt_cv The point on the curve.
pt_su The point on the surface.
istat =1 Intersection. =2 Minimum value. =3 Nothing found.

void Go::closestPtCurveSurf ( ParamCurve *  pcurve,
ParamSurface *  psurf,
double  aepsge,
double  astart1,
double  aend1,
RectDomain *  domain,
double  anext1,
double  enext2[],
double &  cpos1,
double  gpos2[],
double &  dist,
Point &  pt_cv,
Point &  pt_su,
bool  second_order = false 
)

Newton iteration on the distance function between a curve and a surface to find a closest point or an intersection point.

The solution is restricted to the interval [astart1,aend1] in the curves's parameter domain and [estart2[],eend2[]] in the surface's parameter domain. Ported from the sisl-function s1772.

Parameters:
pcurve Pointer to the curve in the intersection.
psurf Pointer to the surface in the intersection.
aepsge Geometry resolution.
astart1 Start parameter value of the curve.
aend1 End parameter value of the curve.
domain the parametric domain of interest of the surface
anext1 Start point for iteration along curve number one.
enext2[] Start parameter values of the iteration on the surface.
second_order if 'true' the function will attempt a second-order method directly.
Return values:
cpos1 Parameter value of the curve in the intersection point.
gpos2[] Parameter values of the surface in the intersection point.
dist Distance between the points.
pt_cv The point on the curve.
pt_su The point on the surface.

void Go::closestPtSurfSurfPlane ( const std::vector< Point > &  epoint,
const std::vector< Point > &  epnt1,
const std::vector< Point > &  epnt2,
const Point &  epar1,
const Point &  epar2,
const ParamSurface *  psurf1,
const ParamSurface *  psurf2,
double  aepsge,
std::vector< Point > &  gpnt1,
std::vector< Point > &  gpnt2,
Point &  gpar1,
Point &  gpar2,
int &  jstat,
AlgorithmChoice  algo = FUNCTIONAL 
)

Newton iteration on the distance function between two surfaces and a plane to find a closest point or an intersection point.

Ported from the sisl-function s9iterate.

Parameters:
epoint - Vector of Points containing parts of plane description. epoint[0] contains a point in the plane. epoint[1] contains the normal vector to the plane.
epnt1 0-2 Derivatives + normal of start point for iteration in first surface.
epnt2 0-2 Derivatives + normal of start point for iteration in second surface.
epar1 Parameter pair of start point in first surface.
epar2 Parameter pair of start point in second surface.
psurf1 Pointer to the first surface.
psurf2 Pointer to the second surface.
aepsge Absolute tolerance.
gpnt1 0-2 Derivatives + normal of result of iteration in first surface.
gpnt2 0-2 Derivatives + normal of result of iteration in second surface.
gpar1 Parameter pair of result of iteration in first surface.
gpar2 Parameter pair of result of iteration in second surface.
jstat =1 Intersection. =2 Minimum value. =3 Nothing found.
algo choose whether the implementation of the algorithm should be based on general function minimization, or a geometric approach

void Go::closestPtSurfSurfPlaneFunctional ( const std::vector< Point > &  epoint,
const std::vector< Point > &  epnt1,
const std::vector< Point > &  epnt2,
const Point &  epar1,
const Point &  epar2,
const ParamSurface *  psurf1,
const ParamSurface *  psurf2,
double  aepsge,
std::vector< Point > &  gpnt1,
std::vector< Point > &  gpnt2,
Point &  gpar1,
Point &  gpar2,
int &  jstat 
)

This is the functional-based implementation of closestPtSurfSurfPlane.

It is called from the function above (closestPtSurfSurfPlane()) if it is called with algo = FUNCTIONAL. The user can also choose to call this function directly. The parameter description is the same as in closestPtSurfSurfPlane().

void Go::closestPtSurfSurfPlaneGeometrical ( const std::vector< Point > &  epoint,
const std::vector< Point > &  epnt1,
const std::vector< Point > &  epnt2,
const Point &  epar1,
const Point &  epar2,
const ParamSurface *  psurf1,
const ParamSurface *  psurf2,
double  aepsge,
std::vector< Point > &  gpnt1,
std::vector< Point > &  gpnt2,
Point &  gpar1,
Point &  gpar2,
int &  jstat 
)

This is the geometrically-based implementation of closestPtSurfSurfPlane.

It is called from the function above (closestPtSurfSurfPlane()) if it is called with algo = GEOMETRICAL. The user can also choose to call this function directly. The parameter description is the same as in closestPtSurfSurfPlane().

void Go::computeFirstFundamentalForm ( const ParamSurface &  sf,
double  u,
double  v,
int  derivs,
std::vector< double > &  form 
)

Computes the coefficients of the first fundamental form.

The returned values are stored { E F G [Eu Fu Gu Ev Fv Gv [Euu Fuu Guu Euv Fuv Guv Evv Fvv Gvv [...] ] ] }. Only one derivative is implemented so far.

Parameters:
sf reference to the concerned surface
u first parameter of point where we want to compute the first fundamental form
v second parameter of point where we want to compute the first fundamental form
derivs number of (partial) derivatives of the first fundamental form that we want to include in the result. So far, only the computation of the first derivative is actually implemented.
form the computed values, on the format described above

void Go::computeSecondFundamentalForm ( const ParamSurface &  sf,
double  u,
double  v,
double  form1[3],
double  form2[3] 
)

Computes the coefficients of the first and second fundamental forms.

The returned values are stored { E F G } in form1 and { e f g } in form2. This function cannot compute derivatives.

Parameters:
sf reference to the concerned surface
u first parameter of point where we want to compute the fundamental forms.
v second parameter of point where we want to compute the fundamental forms
form1 the values associated with the first fundamental form will be returned here.
form2 the values associated with the second fundamental form will be returned here.

void Go::computeSeedCvCv ( const SplineCurve *  pc1,
const SplineCurve *  pc2,
double &  seed1,
double &  seed2 
)

Computes initial start points for iteration along the curves.

Parameters:
pc1 Curve number one.
pc2 Curve number two.
Return values:
seed1 Start point for iteration along curve number one.
seed2 Start point for iteration along curve number two.

std::vector<boost::shared_ptr<Go::ParamSurface> > Go::HahnsSurfaceGen::constructHahnsSurface ( std::vector< boost::shared_ptr< Go::SplineCurve > > &  bnd_curves,
std::vector< boost::shared_ptr< Go::SplineCurve > > &  mod_cross_curves,
double  neighbour_tol,
double  kink_tol,
double  knot_diff_tol 
)

Given input of bnd_curves and cross_tangent curves, create the corresponding Hahns Surface.

Assuming input curves fulfill corner conditions. All curves expected to live in 3-dimensional space.

Parameters:
bnd_curves edge curves for the Hahns Surface.
mod_cross_curves corresponding cross tangent curves.
neighbour_tol allowed distance between corresponding end points.
kink_tol allowed angle between corresponding tangents.
knot_diff_tol parametric tolerance for equality of knots.
Returns:
vector containing the Hahns Surface.

std::vector<boost::shared_ptr<Go::ParamSurface> > Go::HahnsSurfaceGen::constructPolygonialSurface ( std::vector< boost::shared_ptr< Go::ParamCurve > > &  bnd_curves,
std::vector< boost::shared_ptr< Go::ParamCurve > > &  cross_curves,
double  neighbour_tol,
double  kink_tol,
double  knot_diff_tol 
)

The routine which actually creates vector of blending surfaces, with given curves as their total bnd curve.

# of return surfaces equals # of curves. All bnd curves share orientation (clockwise), and all cross curves point inwards. A missing cross curve is indicated by a 0 pointer. bnd_curves must form a loop. As we approximate modified cross curves, we include parameters to denote the exactness of the approximation. All curves expected to live in 3-dimensional space.

Parameters:
bnd_curves edge curves for the Hahns Surface.
cross_curves corresponding cross tangent curves.
neighbour_tol allowed distance between corresponding end points.
kink_tol allowed angle between corresponding tangents.
knot_diff_tol parametric tolerance for equality of knots.
Returns:
vector containing the Hahns Surface.

BoundedSurface* Go::BoundedUtils::convertToBoundedSurface ( const SplineSurface surf,
double  space_epsilon 
)

Convert a SplineSurface to a BoundedSurface.

All information is copied, nothing is shared.

Parameters:
surf the SplineSurface to convert
space_epsilon the tolerance assigned to the newly created BoundedSurface
Returns:
(pointer to) a BoundedSurface that represent the same surface as 'surf'. The user assumes ownership of the object.

SplineCurve* Go::CurveCreators::createCircle ( Point  center,
Point  axis,
Point  normal,
double  radius 
)

Generate a 3D SplineCurve representing a circle.

Assuming dimension is 3.

Parameters:
center the center point of the circle,
axis a vector pointing from the center point of the circle and towards start and end point of the circle.
normal the normal to the plane in which the circle lie.
radius the radius of the circle to generate.
Returns:
a raw pointer to the generated SplineCurve, representing the specified circle. User assumes ownership.

SplineSurface* Go::CoonsPatchGen::createCoonsPatch ( std::vector< boost::shared_ptr< SplineCurve > > &  bd_curves,
std::vector< boost::shared_ptr< SplineCurve > > &  cross_curves 
)

Create a Gordon Surface from input curves.

bd_curves forms a loop, all cross curves point into the surface. Assumes curves have been preprocessed, i.e. cross_curves fulfill twist and tangent requirements.

Parameters:
bd_curves ccw loop defining the boundary of the patch, size = 4.
cross_curves corresponding cross tangent curves, size = 4, an element may be a NULL pointer.
Returns:
pointer to the created Gordon Surface.

SplineSurface* Go::CoonsPatchGen::createCoonsPatch ( std::vector< boost::shared_ptr< ParamCurve > > &  bd_curves,
std::vector< boost::shared_ptr< ParamCurve > > &  cross_curves,
double  epsge,
double  kink_tol 
)

bd_curves form a loop, all cross curves point into the surface.

cross_curves need not fulfill twist and tangent requirements. Create a new SplineSurface representing the coons patch defined by a loop of four boundary curves, and their respective cross-tangent curves.

Parameters:
bd_curves ccw loop defining the boundary of the patch, size = 4.
cross_curves corresponding cross tangent curves, size = 4, an element may be a NULL pointer.
epsge allowed distance between corresponding end points of bd_curves.
kink_tol allowed angle between end tangents of bd_curves and corresponding end points of cross_curves.
Returns:
pointer to the created Gordon Surface.

SplineSurface* Go::CoonsPatchGen::createCoonsPatch ( const CurveLoop &  boundary  ) 

Create a new SplineSurface representing the coons patch as defined by a loop of four SplineCurves.

Parameters:
boundary the CurveLoop describing the boundary of the coons patch to be generated. There must be exactly four curves, they must all be of type 'SplineCurve', and they must be nonrational.
Returns:
a pointer to a newly created SplineSurface representing the coons patch. The user assumes ownership of the object.

boost::shared_ptr<Go::SplineCurve> Go::CreatorsUtils::createCrossTangent ( const Go::CurveOnSurface cv,
boost::shared_ptr< Go::SplineCurve basis_space_cv,
const Go::SplineCurve cross_cv_ref,
bool  appr_offset_cv = true 
)

The cross tangent cv along input cv is created.

Length given by length of derivs in sf along cv or by input_cross_cv if it exists. Direction of created cross tangent cv is to the left of cv (i.e. it should point into the surface). If input_cross_cv exists so does basis_space_cv and they must share parametrization. If input_cross_cv exists, but not basis_space_cv, it shares parametrization with cv.

Parameters:
cv the trim curve along which we are to compute the cross tangent cv.
basis_space_cv if != NULL we use the basis and parametrization of basis_space_cv.
cross_cv_ref if != NULL the curve defines the angle between the boundary curve and the new cross tangent curve. Additionally it defines the length of the new cross tangent curve.
appr_offset_cv whether the method should approximate the offset curve (as opposed to the cross tangent curve).
Returns:
the cross tangent (or offset) curve.

boost::shared_ptr<Go::SplineCurve> Go::CreatorsUtils::createCrossTangent ( const Go::CurveOnSurface cv  ) 

Generate the inwards pointing cross-tangent curve along the input trim curve.

Parameters:
cv the trim curve.
Returns:
the inwards cross tangent curve.

SplineSurface* Go::CoonsPatchGen::createGordonSurface ( std::vector< boost::shared_ptr< SplineCurve > > &  mesh_curves,
std::vector< double > &  params,
int &  nmb_u_crvs,
std::vector< boost::shared_ptr< SplineCurve > > &  cross_curves,
std::vector< int > &  cross_index,
bool  use_param_values = true 
)

Create a Gordon Surface from input curves and parameters.

cross_index refers to indexing of mesh_curves, which means that the boundary curves to which it is a tangent must be included. All cross_curves are assumed to fulfill twist and tangent requirements.

Parameters:
mesh_curves the iso-curves defining the Gordon Surface.
params the corresponding iso parameters. Updated if use_param_values == false.
nmb_u_crvs the number of curves parametrized in the u-direction. Updated if use_param_values == false.
cross_curves cross tangent curves for the Gordon Surface, corresponding to element in mesh_curves.
cross_index referring to index element in mesh_curves.
use_param_values whether to use the input parameters.
Returns:
pointer to the created Gordon Surface.

SplineSurface* Go::CoonsPatchGen::createGordonSurface ( std::vector< boost::shared_ptr< SplineCurve > > &  mesh_curves,
std::vector< double > &  params,
int &  nmb_u_crvs,
bool  use_param_values 
)

Create a Gordon Surface from input curves and parameters.

We require that both boundary curves in one direction (at least) are given. If use_param_values == true, we require the curves to be ordered (with parameters as given by params), with nmb_u_crvs u-curves up front. If use_param_values == false, mesh_curves is reordered as explained in splitMeshCurves() and sortMeshCurves(). Intersection parameters of curves are found and set in params, and nmb_u_crvs is also set.

Parameters:
mesh_curves the iso-curves defining the Gordon Surface.
params the corresponding iso parameters. Updated if use_param_values == false.
nmb_u_crvs the number of curves parametrized in the u-direction. Updated if use_param_values == false.
use_param_values whether to use the input parameters.
Returns:
pointer to the created Gordon Surface.

boost::shared_ptr<SplineSurface> Go::SurfaceCreators::createSmoothTransition ( const std::vector< boost::shared_ptr< const ParamSurface > > &  surfs,
const std::vector< boost::shared_ptr< const CurveOnSurface > > &  int_cvs,
double  dist_0,
double  dist_1,
double  epsge,
std::vector< boost::shared_ptr< SplineCurve > > &  trim_crvs 
)

Given input of two parametric surfaces, which intersect along an edge, create a smooth surface by moving boundary of surfs to inner part of current surfs.

Normals of input surfs are assumed to be consistent.

Parameters:
surfs the input surfaces, size of vector is 2.
int_cvs intersection curves between the two surfaces. Vector has size 2. Both parameter curves should exist, the space curve should be the same.
dist_0 the offset space distance in surfs[0].
dist_1 the offset space distance in surfs[1].
epsge the geometrical tolerance when offsetting.
trim_crvs the offset trim curves: par_cv0, space_cv0, par_cv1, space_cv1.

vector<shared_ptr<BoundedSurface> > Go::BoundedUtils::createTrimmedSurfs ( vector< vector< boost::shared_ptr< CurveOnSurface > > > &  loops,
shared_ptr< SplineSurface > &  under_sf,
double  epsgeo 
)

Define the surfaces that result from trimming a given SplineSurface with a set of boundary loops.

Counterclockwise loops define the interior of a parameter domain, while clockwise loops define holes in the domain.

Parameters:
loops each entry in the outermost vector represent a vector of curves that together specify a loop in 2D parametrical space of the surface 'under_sf'. These are the trim curves. The curves are expected to be simple, lying on the surface 'under_sf'. No pair of curve loops with the same orientation may lie inside/outside of each other; in that case, the irrelevant loop will be reased. Furthermore, we assume that no pair of loops intersect transversally (they are still allowed to touch tangentially).
under_sf the underlying SplineSurface that we are going to trim with the curves given in 'loops'.
epsgeo geometrical tolerance used in computations
Returns:
a vector containing BoundedSurface s that each represent a trimmed part of the 'under_sf' surface.

void Go::curvatures ( const ParamSurface &  sf,
double  u,
double  v,
double &  K,
double &  H 
)

Computes the Gaussian (K) and mean (H) curvatures.

Parameters:
sf reference to the concerned surface
u first parameter of point where we want to carry out computation
v second parameter of point where weh want to carry out computation
K value of Gaussian curvature returned here
H value of mean curvature returned here

SISLCurve* Go::Curve2SISL ( const SplineCurve &  cv,
bool  copy = true 
)

Convert a SplineCurve to a SISLCurve.

Parameters:
cv the SplineCurve to convert
copy if 'true', then the generated SISLCurve will have its own copy of the coefficient information contained in 'cv'. Otherwise, it will share this information with 'cv' (ie. it will only contain a pointer into the corresponding storage array in 'cv'.
Returns:
A newly generated SISLCurve that describes the same curve as 'cv'. The user assumes ownership and is responsible for cleaning up (which means calling the SISL function freeCurve(...) on the pointer when it should be destroyed).

void Go::curve_ratder ( double const  eder[],
int  idim,
int  ider,
double  gder[] 
)

This function takes as input the position and a certain number of derivatives in homogenous space of a point on a rational curve.

It outputs the position and derivatives of this point in non-homogenous ("ordinary") space. (Corresponds to s6ratder in SISL)

Parameters:
eder pointer to the array where the point's position and derivatives in homogenous coordinates (input) are consecutively stored
idim the dimension of the non-homogenous space
ider the number of derivatives sought (0 means that we only want to convert the position to non-homogenous coordinates).
gder pointer to the array where the result will be written (in same order as 'eder').

boost::shared_ptr<SplineCurve> Go::curveSum ( const SplineCurve &  crv1,
double  fac1,
const SplineCurve &  crv2,
double  fac2,
double  num_tol = 1e-05 
)

Addition of two signed SplineCurves, i.e.

this function can also be used for subtraction. The curves is assumed to live on the same parameter domain, but may have different knot vectors. resulting curve = fac1 * crv1 + fac2 * crv2

Parameters:
crv1 the first of the curves to be added
fac1 multiplicative factor of the first curve
crv2 the second of the curves to be added
fac2 multiplicative factor of the second curve
num_tol tolerance used when unifying the spline spaces in which 'crv1' and 'crv2' lie.
Returns:
shared pointed to a newly created SplineCurve which is the sum of 'crv1' and 'crv2'.

SplineSurface* Go::CoonsPatchGen::doCreateSurface ( std::vector< boost::shared_ptr< SplineCurve > > &  mesh_curves,
std::vector< double > &  params,
int &  nmb_u_crvs,
std::vector< boost::shared_ptr< SplineCurve > > &  cross_curves,
std::vector< int > &  cross_index 
)

Create a Gordon Surface interpolating the input curves in the input parameters.

mesh_curves assumed to be ordered (i.e. u-curves first, with ascending parameter values), and missing boundary curve(s) in at most one direction. Expecting end conditions are satisfied.

Parameters:
mesh_curves iso-curves for Gordon Surface.
params iso-parameters for the mesh_curves.
nmb_u_crvs the number of curves parametrized in the u-direction. May alter as the parameter directions may swap.
cross_curves the cross tangent curves along iso-curves for the Gordon Surface.
cross_index index in mesh_curves of corresponding boundary curve.
Returns:
pointer to the created Gordon Surface.

void Go::estimateIsoCurveLength ( const SplineSurface &  srf,
bool  dir_u,
double  par,
double &  length 
)

estimate the length of an iso-curve on the surface

Parameters:
srf the surface containing the iso-curve
dir_u 'true' if the iso-curve is along the first parameter (second parameter fixed), 'false' if it is the first parameter that is fixed.
par parameter value for the fixed parameter
length returns the estimated length of the iso-curve

void Go::estimateSurfaceSize ( const SplineSurface &  srf,
double &  length_u,
double &  length_v 
)

Rough estimate of the size of a parametric surface.

Parameters:
srf the surface we want to estimate the size of
length_u the estimated average length of the surface, moving along the first parameter
length_v the estimated average length of the surface, moving along the second parameter

int Go::extremalPtSurfSurf ( ParamSurface *  psurf1,
ParamSurface *  psurf2,
int  constraints[2],
double  constraints_par[2],
double  limit[],
double  enext[],
double  gpos[],
double  angle_tol 
)

Finds one point in each surface where the two normals are parallel to each other and to the difference vector between the two points.

The edge info makes it possible to constrain the search to an ISO-curve in one of or both surfaces. Ported from the sisl-function shsing_ext.

METHOD :  - Start with a guess value (u,v) in domain of surface 1 (S(u,v))
      (a) - Find domain value (r,t) of closest point (to S(u,v) in surface 2 (Q(r,t))
          - If vf1(u,v) = <Su,Normal(Q> and vf2(u,v)= <Sv,Normal(Q> is small enough  stop
                 (<,> means scalar prod.)
          - Find du and dv by taylorizing vf1 and vf2.
            This include finding the derivatives of the closest point function (r(u,v),t(u,v))
            with respect to u and v. (called h(u,v) in article, see comments in shsing_s9dir)
          - u:= u+du v:= v+dv, goto (a)

   
REFERENCES : Solutions of tangential surface and curve intersections.
             R P Markot and R L Magedson
             Computer-Aided Design; vol. 21, no 7 sept. 1989, page 421-429
   
Parameters:
psurf1 Pointer to the first surface.
psurf2 Pointer to the second surface
constraints Constraints flag.
  • constraints
    1. constraints[0] Constraint 1. surface
    2. constraints[1] Constraint 2. surface
  • constraints values
    1. -1 : No constraints.
    2. 0 : Constant in 1. par direction
    3. 1 : Constant in 2. par direction
------------------ or ----------------
Parameters:
constraints_par Constraints parameters.
  1. constraints_par[0] Constraints parameter 1. surface.
  2. constraints_par[1] Constraints parameter 2. surface.
limit - Parameter borders of both surfaces.
  1. limit[0] - limit[1] Parameter interval. 1. surface 1. direction.
  2. limit[2] - limit[3] Parameter interval. 1. surface 2. direction.
  3. limit[4] - limit[5] Parameter interval. 2. surface 1. direction.
  4. limit[6] - limit[7] Parameter interval. 2. surface 2. direction.
enext Parameter start value for iteration(4 values).
angle_tol The angular tolerance for success.
gpos Parameter values of the found singularity(4 values).
Returns:
Status message. =1 Extremum found. = 0 Extremum NOT found.

void Go::findDominant ( const SplineSurface &  surface,
Vector3D &  dominant_u,
Vector3D &  dominant_v 
)

Finds the "dominant u- and v-vectors" for a surface, defined to be the sum of all the vectors pointing from one control point to the next in the u- and v-directions.

Parameters:
surface the surface we want to analyze
dominant_u returns the dominant u-vector for the surface
dominant_v returns the dominant v-vector for the surface

bool Go::LoopUtils::firstLoopInsideSecond ( const std::vector< boost::shared_ptr< Go::CurveOnSurface > > &  first_loop,
const std::vector< boost::shared_ptr< Go::CurveOnSurface > > &  second_loop,
double  loop_tol,
double  int_tol 
)

Test whether one loop lies entirely within another.

This function does not work in the general case; it makes the assumption that the loops do NOT intersect each other transversally (their boundaries are allowed to tangentially touch though). The algorithm works by testing a single point on the first loop for being inside the second loop, so if the first loop lay partially inside, partially outside the second, the answer would be arbitrary.

Parameters:
first_loop the first loop
second_loop the second loop
loop_tol the tolerance for defining coincidence between start/endpoints on the consecutive curve segments consituting a loop.
int_tol tolerance used for intersection calculations
Returns:
'true' if 'first_loop' was found to be located inside 'second_loop' (given the assumptions above). 'false' otherwise.

void Go::CoonsPatchGen::fixCrossEndPts ( const std::vector< boost::shared_ptr< SplineCurve > > &  bd_curves,
const std::vector< boost::shared_ptr< SplineCurve > > &  cross_curves 
)

Make sure that the end points of the existing cross_tangent_curves match the end derivatives of the corresponding bd_curves.

Curves are oriented CCW.

Parameters:
bd_curves curves along the boundary, ccw orientated. Will not be altered.
cross_curves the corresponding cross tangent curves (same orientation). The curve objects referred to by the pointers may be altered.

void Go::GaussQuadInner ( const BsplineBasis &  basis,
int  ider,
double  lim1,
double  lim2,
double ***  integral 
)

Compute all definite integrals of inner products of derivatives of B-splines up to a given order where the differentiation is of the same order for both B-splines.

The interval of integration are equal to the parameter intervals of the surface in the current par. dir.

Parameters:
basis B-spline basis.
ider Number of derivatives to compute.
lim1 Start of parameter interval.
lim2 End of parameter interval.
integral Computed integrals.

void Go::GaussQuadInner2 ( const BsplineBasis &  basis,
int  ider,
double  lim1,
double  lim2,
double **  integral 
)

Compute all definite integrals of inner products of derivatives of B-splines up to a given order where the differentiation is of the same order for both B-splines.

The interval of integration are equal to the parameter intervals of the surface in the current par. dir.

Parameters:
basis B-spline basis.
ider Number of derivatives to compute.
lim1 Start of parameter interval.
lim2 End of parameter interval.
integral Computed integrals.

vector<vector<shared_ptr<CurveOnSurface> > > Go::BoundedUtils::getBoundaryLoops ( const BoundedSurface sf,
vector< shared_ptr< CurveOnSurface > > &  part_bnd_cvs 
)

This function tries to complete "partial" boundary loops by filling out the missing parts using fragments from the domain boundary of a BoundedSurface.

Parameters:
sf the surface whose domain boundary will be used
part_bnd_cvs a vector of (shared pointers to) curve segments that represent incomplete loops. Upon function return, this vector will be emptied.
Returns:
a vector contained the loops that the function was able to completely close using curve segments from 'part_bnd_cvs' and the domain boundaries of 'sf'.

void Go::CoonsPatchGen::getCrossTangs ( const std::vector< boost::shared_ptr< SplineCurve > > &  curves,
std::vector< boost::shared_ptr< SplineCurve > > &  mod_cross_curves,
double  tol1,
double  tol2 
)

Prepare cross tangents for surface creation.

curves contains boundary_curve, cross_curve; one edge at a time (iedge*2 curves). boundary curves form a loop. All curves share spline space, and all cross curves point inwards = into the surface. A missing cross_curve is indicated by a null pointer. Output mod_cross_curves fulfills tangent and twist conditions.

void Go::getGnJoints ( const CurveLoop &  loop,
const std::vector< double > &  cont,
std::vector< std::vector< double > > &  gn_joints 
)

Partition a given CurveLoop into segments where each segment is at least G^n continuous (currently supporting up to G2 continuity).

Parameters:
loop the CurveLoop to analyze
cont the tolerance used for defining continuity. cont[0] is the tolerance used for defining the G^0 continuity, cont[1] is used for checking G^1 continuity, etc. The length of this vector also determines 'n' ('n' is equal to cont.size() - 1).
gn_joints a vector of a vector, reporting the result of the analysis. The outer vector contains one entry per curve in the CurveLoop. This entry contains the parameters for which that curve must be split in order to obtain G^n segments. NB: the start- and end parameters are NOT included here, as opposed to the result obtained from the other getGnJoints() function. The exception to this is when there is an G^n discontinuity at the transition between the curve 'i-1' and curve 'i' in the CurveLoop. To indicate this, the start parameter value for curve 'i' will be included in the corresponding entry in 'gn_joints'.

void Go::getGnJoints ( const ParamCurve &  curve,
const std::vector< double > &  cont,
std::vector< double > &  gn_joints 
)

Partition the given curve into segments where each segment is at least G^n continuous (currently supporting up to G2 continuity).

Parameters:
curve the curve to analyze
cont the tolerance used for defining continuity. cont[0] is the tolerance used for defining the G^0 continuity, cont[1] is used for checking G^1 continuity, etc. The length of this vector also determines 'n' ('n' is equal to cont.size() - 1).
Return values:
gn_joints returns the parameter values where one segment stops and the next begins. The vector will at least contain two values (the start and end parameter of the curve).

void Go::BoundedUtils::getIntersectionCurve ( shared_ptr< SplineSurface > &  sf1,
shared_ptr< SplineSurface > &  sf2,
vector< shared_ptr< CurveOnSurface > > &  int_segments1,
vector< shared_ptr< CurveOnSurface > > &  int_segments2,
double  epsge 
)

Find the intersction curve(s) between two spline surfaces.

Parameters:
sf1 the first surface to intersect
sf2 the second surface to intersect
Return values:
int_segments1 a vector of CurveOnSurface s, representing the intersection curves as lying on 'sf1'.
int_segments2 a vector of CurveOnSurface s, representing the intersection curves as lying on 'sf2'.
Parameters:
epsge geometrical tolerance to be used for intersection computations

SplineCurve* Go::CreatorsUtils::getParametricCurve ( const std::vector< boost::shared_ptr< const CurveOnSurface > > &  cv  ) 

Helper function.

Returns the parametric representation of the input curve. The returned curve is created (i.e. it should be be handled by a smart ptr)! This function takes as argument a vector of (shared pointers to) CurveOnSurfaces, which are assumed to lie on the same surface and to represent consecutive parts of a larger curve, and return the parametric representation of this larger curve.

Parameters:
cv a vector of (shared pointers to) CurveOnSurfaces. We suppose that these curves are all lying on the same surface and that they constitute consecutive parts of a global curve.
Returns:
if successful, a pointer to the newly generated SplineCurve, which represents the global curve that is the union of the input curves. This SplineCurve is represented in the parameter plane of the surface, and is therefore a 2D curve. If it could not be constructed (due a failure of any of the provided CurveOnSurfaces to provide their internal parameter curve), a null pointer is returned instead. The user assumes ownership of the SplineCurve.

std::vector<double> Go::getRotationMatrix ( const Point &  unit_axis_dir,
double  alpha 
)

Compute the elements of the matrix describing a rotation or a given number of radians around a given axis going through the origin.

Parameters:
unit_axis_dir this vector defines the axis of rotation. It must be of unit length, although this is not checked by the function.
alpha the angle of rotation, in radians
Returns:
a vector containing the matrix elements of the corresponding rotation matrix, stored row-wise.

void Go::CoonsPatchGen::getTangBlends ( std::vector< boost::shared_ptr< SplineCurve > > &  curves,
int  iedge,
std::vector< boost::shared_ptr< SplineCurve > > &  blend_functions 
)

Find blending functions used to blend two derivative along some boundary curves corresponding to a surface, into a cross derivative curve pr edge.

Get curves for blending of two tangent curves into one cross tangent curve. Size of curves = iedge * 3 (i.e. bd_curve, cross_curve, tangent curve). Boundary curves form a loop, and all curves share orientation and line space. cross-curves point inwards.

SISLSurf* Go::GoSurf2SISL ( const SplineSurface &  sf,
bool  copy = true 
)

Convert a SplineSurface to a SISLSurface.

Parameters:
sf the SplineSurface to convert
copy if 'true', then the generated SISLSurf will have its own copy of the coefficient information contained in 'sf'. Otherwise, it will share this information with 'sf' (ie. it will only contain a pointer into the corresponding storage array in 'sf'.
Returns:
a newly generated SISLSurf that describes the same surface as 'sf'. The user assumes ownership and is responsible for cleaning up (which means calling the SISL function freeSurf(...) on the pointer when it should be destroyed).

double Go::BsplineBasis::grevilleParameter ( int  index  )  const [inline, inherited]

Get the greville parameter starting from a certain knot.

Parameters:
index the index of the knot from which the greville parameter should be computed.
Returns:
the corresponding greville parameter

Definition at line 356 of file BsplineBasis.h.

References Go::BsplineBasis::order().

void Go::CoonsPatchGen::hermit ( double  econd[],
int  icond,
bool  hasder1,
double  astart,
double  aend,
int  idim 
)

Hermite interpolate the input points.

Parameters:
econd array containing the points and derivatives to be interpolated. The ordering is <start_pt, (start_tan,) end_der, end_pt> The array will contain the coefficients of the spline curve fulfilling the input requirements.
icond number of interpolation conditions.
hasder1 Whether derivative is given in the start of the interval
astart start parameter of the produced curve.
aend end parameter of the produced curve.
idim dimension of the geometric space.

boost::shared_ptr<Go::SplineSurface> Go::SurfaceCreators::insertParamDomain ( const Go::SplineSurface sf_1d  ) 

Given input of 1d-sf, return the 3d visualization (u, v, f(u, v)).

Parameters:
sf_1d 1-dimensional surface.
Returns:
the 3-dimensional surface.

void Go::intersect2Dcurves ( const ParamCurve *  cv1,
const ParamCurve *  cv2,
double  epsge,
std::vector< std::pair< double, double > > &  intersections,
std::vector< int > &  pretopology 
)

Intersect two 2D spline curves.

Collect intersection parameters and pretopology information.

Parameters:
cv1 pointer to the first 2D curve
cv2 pointer to the second 2D curve
epsge geometrical tolerance
Return values:
intersections this vector will contain the parameter pairs of the found intersections (one vector entry per intersection. The two parameters in the pair<> correspond to the parameter value in 'cv1' and 'cv2' for a particular intersection.
pretopology vector containing a pretopology indicator for each detected intersection point. There is one entry per intersection point.

void Go::intersectcurves ( SplineCurve *  cv1,
SplineCurve *  cv2,
double  epsge,
std::vector< std::pair< double, double > > &  intersections 
)

Intersect two spline curves.

Collect intersection parameters.

Parameters:
cv1 pointer to the first spline curve
cv2 pointer to the second spline curve
epsge geometrical tolerance
Return values:
intersections this vector will contain the parameter pairs of the found intersections (one vector entry per intersection. The two parameters in the pair<> correspond to the parameter value in 'cv1' and 'cv2' for a particular intersection.

std::vector<shared_ptr<CurveOnSurface> > Go::BoundedUtils::intersectWithPlane ( shared_ptr< SplineSurface > &  surf,
Point  pnt,
Point  normal,
double  geom_tol 
)

Find the intersection curve(s) between a SplineSurface and a given plane.

The plane is defined by its normal and a point on the plane.

Parameters:
surf the SplineSurface to intersect with the plane
pnt a point lying on the plane
normal the normal of the plane
geom_tol geometrical tolerance to be used for intersection computations
Returns:
a vector with (shared pointers to) CurveOnSurface s, which represent the intersection curves found.

std::vector<shared_ptr<CurveOnSurface> > Go::BoundedUtils::intersectWithSurface ( CurveOnSurface curve,
BoundedSurface bounded_surf,
double  epsge 
)

Extract those parts of a given CurveOnSurface where its parameter curve lies inside the parameter domain of a BoundedSurface.

Parameters:
curve the CurveOnSurface that we want to check
bounded_surf the BoundedSurface whose parameter domain we will check against
epsge geometric tolerance used in calculations
Returns:
a vector containing those segments of 'curve' that have parameter descriptions inside the parameter domain of the 'bounded_surf'.

void Go::BoundedUtils::intersectWithSurfaces ( vector< shared_ptr< CurveOnSurface > > &  curves1,
shared_ptr< BoundedSurface > &  bd_sf1,
vector< shared_ptr< CurveOnSurface > > &  curves2,
shared_ptr< BoundedSurface > &  bd_sf2,
double  epsge 
)

We have two set of CurveOnSurface s, 'curves1' and 'curves2', and two BoundedSurface s, 'bd_sf1' and 'bd_sf2'.

We extract those segments of curves in 'curves1' and 'curves2' that have parameter curves in the parameter domains of respective 'bd_sf1' and 'bd_sf2'. Then we compare the resulting segments from the two sets against each others, and keep those that overlap spatially. Segments are split in two if necessary in order to make start and end points from one set coincide with those from the other set. 'curves1' and 'curves2' are then cleared and filled with the resulting curve segments.

Parameters:
curves1 see above, we suppose that the curves are NOT self-intersecting
bd_sf1 see above, we suppose that the underlying surface is the same as the one refered to by the curves in 'curves1'.
curves2 see above, we suppose that the curves are NOT self-intersecting
bd_sf2 see above, we suppose that the underlying surface is the same as the one refered to by the curves in 'curves2'.
epsge geometric epsilon used in closest point calculations, checks for coincidence, etc.

bool Go::isCoincident ( const ParamCurve &  cv1,
const ParamCurve &  cv2,
double  epsge 
)

Returns true if the curves are approximately coincident (that is, they have the same parameter space and overlap in space).

The function uses a (possibly high) number of closest point calculations to check for spatial coincidence.

Parameters:
cv1 the first curve to check for coincidence
cv2 the second curve to check for coincidence
epsge the tolerance for specifying what we mean by approximately coincident
Returns:
'true' if the curves are found to be approximately coincident, 'false' otherwise.

boost::shared_ptr<SplineSurface> Go::joinPatches ( const std::vector< boost::shared_ptr< SplineSurface > > &  patches,
const SplineSurface &  spline_space 
)

Join patches with continuity according to input basis_u & basis_v.

The patches are assumed to be in Bezier form, and form a continuous set. There should be num_u x num_v patches, where num_u = numcoefs_u/order_u and num_v = numcoefs_v/order_v (as given by basis_u and basis_v).

int Go::BsplineBasis::lastKnotInterval (  )  const [inline, inherited]

Return the index of the left knot of the last knot interval accessed for some reason (evaluation, etc.

) in this basis.

Definition at line 350 of file BsplineBasis.h.

SplineCurve* Go::CurveCreators::liftParameterCurve ( boost::shared_ptr< SplineCurve > &  parameter_cv,
boost::shared_ptr< SplineSurface > &  surf,
double  epsge 
)

'Lift' a 2D parameter curve onto a surface.

(This means generate a space curve lying on the surface, defined as the curved obtained when evaluating the surface at the parameter points given by the 2D curve).

Parameters:
parameter_cv the 2D parameter curve. Its values should be kept within the parameter domain of 'surf'.
surf the surface on which the obtained 3D curve will lie.
epsge geometrical tolerance used when generating the curve
Returns:
a raw pointer to the generated spatial SplineCurve. User assumes ownership.

SplineSurface* Go::CoonsPatchGen::loftSurface ( std::vector< boost::shared_ptr< SplineCurve > >::iterator  first_curve,
std::vector< double >::iterator  first_param,
int  nmb_crvs,
std::vector< boost::shared_ptr< SplineCurve > >::iterator  first_cross_curve,
std::vector< int > &  cross_index 
)

Create a lofting surface interpolating the input curves and cross tangent curves in the input parameters.

All curves assumed to share spline space.

Parameters:
first_curve iterator to first iso-curve in the lofted surface.
first_param iso parameter to corresponding curve referred to by first_curve.
nmb_crvs the number of curves referred to by first_curve.
first_cross_curve iterator to first cross tangent curve in the lofted surface.
cross_index referring to index of corresponding boundary curve.
Returns:
pointer to the created lofting surface.

SplineSurface* Go::CoonsPatchGen::loftSurface ( std::vector< boost::shared_ptr< SplineCurve > >::iterator  first_curve,
std::vector< double >::iterator  first_param,
int  nmb_crvs 
)

Create a lofting surface interpolating the input curves in the input parameters.

Parameters:
first_curve iterator to first iso-curve in the lofted surface.
first_param iso parameter to corresponding curve referred to by first_curve.
nmb_crvs the number of curves referred to by first_curve.
Returns:
pointer to the created lofting surface.

SplineSurface* Go::CoonsPatchGen::loftSurface ( std::vector< boost::shared_ptr< SplineCurve > >::iterator  first_curve,
int  nmb_crvs 
)

Create a lofting surface based on the input curves.

Parameters:
first_curve iterator to first iso-curve in the lofted surface.
nmb_crvs the number of curves referred to by first_curve.
Returns:
pointer to the created lofting surface.

bool Go::LoopUtils::loopIsCCW ( const std::vector< boost::shared_ptr< Go::SplineCurve > > &  simple_par_loop,
double  int_tol 
)

Check if a closed 2D-loop is oriented counterclockwise or not.

Parameters:
simple_par_loop a sequence of 2D curves that are joined start-to-end and that form a closed loop in the plane.
int_tol (geometric) tolerance used for internal computations (intersection detections)
Returns:
'true' if the loop was found to be oriented CCW, otherwise 'false'.

void Go::make_coef_array_from_rational_coefs ( const double *  rationals,
double *  coefs,
int  num_coefs,
int  dim 
)

convert an array of rational coefficients to an array of nonrational coefficients

Parameters:
rationals pointer to the array of rational coefficients
coefs pointer to the array where the nonrational coefficients are to be written
num_coefs total number of coefficients
dim dimension of coefficients (not counting the rational component).

void Go::CoonsPatchGen::makeLoftParams ( std::vector< boost::shared_ptr< SplineCurve > >::const_iterator  first_curve,
int  nmb_crvs,
double  param_length,
std::vector< double > &  params 
)

Calculate iso parameters for the input curves.

The curves are expected to be ordered, i.e. corresponding to increasing iso parameters. Curves are given iso-parameters in the range 0.0 to param_length.

Parameters:
first_curve iterator to first iso curve.
nmb_crvs the number of input curves.
param_length length of parameter domain.
params the computed iso parameters for the input curves.

boost::shared_ptr<Go::SplineSurface> Go::SurfaceCreators::mergeRationalParts ( const Go::SplineSurface nom_sf,
const Go::SplineSurface den_sf,
bool  weights_in_first = false 
)

Return the rational surface 'nom_sf/den_sf'.

Parameters:
nom_sf the nominator surface.
den_sf the denominator surface.
weights_in_first true if the coefficients of the nom_sf have been multiplied by the corresonding rational coefficients in den_sf.
Returns:
the rational surface.

boost::shared_ptr<SplineSurface> Go::SurfaceCreators::mult1DBezierPatches ( const SplineSurface &  patch1,
const SplineSurface &  patch2 
)

Return the product of the two Bezier patches.

Expecting them to be non-rational.

Parameters:
patch1 SplineSurface of Bezier type (i.e. no inner knots).
patch2 SplineSurface of Bezier type (i.e. no inner knots).
Returns:
the surface product.

boost::shared_ptr<SplineSurface> Go::SurfaceCreators::mult1DSurfaces ( const SplineSurface &  sf1,
const SplineSurface &  sf2 
)

Return the product of the two spline surfaces.

Expecting them to be non-rational.

Parameters:
sf1 the first surface.
sf2 the second surface.
Returns:
the surface product.

SplineCurve* Go::CurveCreators::multCurveWithFunction ( const SplineCurve &  alpha,
const SplineCurve &  f 
)

Construct a SplineCurve which is the 'product' of another SplineCurve and a function (which is given as a 1-dimensional SplineCurve).

NB: The two SplineCurves given as argument must be defined on exactly the same parameter interval. Their knotvectors and orders do not have to be equal, though.

Parameters:
alpha the multiplier function, given here as a 1-dimensional SplineCurve
f the SplineCurve to be multiplied with
Returns:
A raw pointer to the newly generated SplineCurve, a product between 'f' and the 'alpha' function. The user assumes ownership.

bool Go::negativeProj ( const SplineSurface &  surface,
const Array< Vector3D, 2 > &  refvector,
const double  eps = 0.0 
)

Returns true if any vector difference between neighboring control points in the u- or v-directions has negative projection on the given reference vector.

Parameters:
surface the SplineSurface containing the control points
refvector the vector onto which we carry out the projection
eps toleance used when defining whether a vector has a negative projection onto 'refvector' (the scalar product must be less than -eps).
Returns:
'true' if we have found a difference between neighboring control points that has a negative projection on the reference vector.

void Go::nextStep ( double &  cdist,
double &  cdiff1,
double &  cdiff2,
std::vector< Point > &  eval1,
std::vector< Point > &  eval2 
)

Computes the distance vector and value beetween a point on the first curve and a point on the second curve.

And computes a next step on both curves. This is equivalent to the nearest way to the parameter plane in the tangent plane from a point in the distance surface between two curves. Ported from the sisl function s1770_s9dir. METHOD : The method is to compute the parameter distance to the points on both tangents which is closest to each other. The difference vector beetween these points are orthogonal to both tangents. If the distance vector beetween the two points on the curve is "diff" and the two derivative vectors are "der1" and "der2", and the two wanted parameter distances are "dt1" and "dt2", then we get the following system of equations:

      <dt1*der1+dist-dt2*der2,der2> = 0
      <dt1*der1+dist-dt2*der2,der1> = 0
   	       This is further:
    
    | -<der1,der2>   <der2,der2> |  | dt1 |   | <diff,der2> |
    |                            |  |     | = |             |
    | -<der1,der1>   <der1,der2> |  | dt2 |   | <diff,der1> |
   

The solution of this matrix equation dt1,dt2 are returned in the parameters cdiff1,cdiff2.

void Go::objsToFile ( std::vector< boost::shared_ptr< GeomObject > > &  geom_objs,
char *  to_file 
)

writes the geometric objects (with header) to the specified file name.

Parameters:
geom_objs the objects to write to file.
to_file the file name to which the objects will be written.

void Go::objToFile ( GeomObject *  geom_obj,
char *  to_file 
)

writes the geometric object (with header) to the specified file name.

Parameters:
geom_obj the object to write to file.
to_file the file name to which the object will be written.

template<class PtrToCurveType>
void Go::orientCurves ( const std::vector< PtrToCurveType > &  curves,
std::vector< int > &  permutation,
std::vector< bool > &  reversed,
double  neighbour_tol,
bool  assume_manifold = true 
) [inline]

This function sorts and orients a set of curves so that curves whose endpoints coincide will be ordered consecutively, and eventually 'reversed' so that startpoints meet endpoints.

It is assumed that the set of curves given constitute one or several manifolds, ie., that there will not be cases where three or more endpoints meet at a common point (this would make the above mentionned ordering impossible).

Parameters:
curves a vector containing the set of (pointers to) curves to be analysed. It is expected that they constitute one or more 1-manifolds.
permutation upon return, this vector will contain a permutation of the indices to the input curves such that after this permutation, curves whose endpoints are connected will become 'consecutive'.
reversed upon return, this vector, whose length will be equal to that of 'curves' and 'permutation', will contain bool values. If curve at position 'i' in the 'curves' vector needs to be reversed in order to connect startpoint-to-endpoint with its neighbours, then the corresponding value in 'reversed' will be 'true', and 'false' if no reversal is necessary.
neighbour_tol the tolerance used when checking for coincident points.
assume_manifold if the user specifies 'true', then the manifold property will be assumed, but will not be explicitly checked. If 'false' is specified, then the input will be checked for consistency with respect to this, and an exception will be cast if the manifold condition is violated.

Definition at line 66 of file orientCurves.h.

void Go::osloalg ( int  ij,
int  imy,
int  ik,
int  in,
int *  jpl,
int *  jfi,
int *  jla,
double *  et,
double *  etau,
double *  galfa 
)

Corresponds to s1701 in SISL This function computes in a compact format a line in the discrete B-spline matrix converting between an orginal basis "etau" and a new basis "et".

Parameters:
ij The index of the new vertice
imy An index on etau, where the input value are to be etau(imy) <= et(ij) < etau(imy + 1).
ik The order of the B-spline.
in The number of the orginal vertices.
et The new knot vector.
etau The old knot vector.
et An array ep(ik) to local use. Such that we do not need to allocate the array locally after each call.
jpl The negativ difference between the index in galfa and the real knot inserten matrix.
jfi The index of the first element in the line j in the the real knot inserten matrix whice is not zero. The element with the index (jfi+jpl) in galfa is the same as the element with index jfi in the real line j in the knot inserten matrix.
jla The index of the last element in the line j in the real knot inserten matrix whice is not zero. The element with the index (jla+jpl) in galfa is the same as the element with index jla in the real line j in the knot inserten matrix.
galfa A compressed line in the knot inserten matrix.

bool Go::LoopUtils::paramIsCCW ( const std::vector< boost::shared_ptr< Go::CurveOnSurface > > &  loop,
double  int_tol 
)

Check if a loop defined by CurveOnSurface s is oriented counterclockwise in the surface's parametric domain.

Parameters:
loop a sequence of CurveOnSurface s that are jointed start-to-end and that form a closed loop on the surface.
int_tol (geometric) tolerance used for internal computations (intersection detections)
Returns:
'true' if the loop was found to be oriented CCW, otherwise 'false'.

boost::shared_ptr<SplineCurve> Go::projectCurve ( const SplineCurve &  incurve,
const Point &  normal,
bool  planar 
)

Project a 3D SplineCurve into a given plane.

The curve can be returned either as a 3D curve lying in the plane or as a 2D curve. In the latter case, the coordinate system is rotated such that the given plane normal coincides with the z-axis.

Parameters:
incurve the curve to project
normal the normal to the plane of projection
planar 'true' if we want the returned curve to be a 2D curve.
Returns:
a shared pointer to a newly constructed, planar SplineCurve expressing the projection of 'incurve' onto the given plane.

SplineCurve* Go::CurveCreators::projectSpaceCurve ( boost::shared_ptr< SplineCurve > &  space_cv,
boost::shared_ptr< SplineSurface > &  surf,
boost::shared_ptr< Point > &  start_par_pt,
boost::shared_ptr< Point > &  end_par_pt,
double  epsge,
const RectDomain *  domain_of_interest = NULL 
)

Generate a SplineCurve which lies on a given (part of a) SplineSurface and is the projection og a given SplineCurve onto that surface.

Parameters:
space_cv the SplineCurve (in 3D space) that we want to project onto the surface.
surf The surface we will project the curve onto. The resulting curve will therefore lie in this surface.
start_par_pt if the user wants to explicitly define where the start point of the curve should lie, 'start_par_pt' could be set to point to this point. It can also be a zero pointer, in which case the start point is determined just like any other point
end_par_pt if the user wants to explicitly define where the end point of the curve should lie, 'end_par_pt' could be set to point to this point. It can also be a zero pointer, in which case the end point is determined just like any other point.
epsge The geometrical tolerance to user when generating the projected curve.
domain_of_interest If the user do not want a projection onto the whole 'surf', he/she can specify the part of the surface to use by limiting the parametric domain to use. If this pointer is left as a null pointer, the whole surface is used.
Returns:
a raw pointer to the generated SplineCurve. User assumes ownership.

void Go::refmatrix ( double *  et,
int  im,
int  ik,
double *  etau,
int  in,
double *  ea,
int *  nfirst,
int *  nlast 
)

Corresponds to sh1922 in SISL Computes the B-spline refinement transformation matrix from the spline space generated by the knot vector etau to the refined spline space generated by the refined knot vector et.

Parameters:
et Real array of length (im+ik) containing the refined knot vector.
im The dimension of the spline space corresponding to et.
ik The order of the spline space.
etau Real array of length (in+ik) containing the original knot vector.
in The dimension of the spline space corresponding to etau.
ea Real array of dimension (im*ik) containing the B-spline refinement matrix from the knot vector etau to the knot vector et. This matrix has dimension im*in but since at most ik entries are nonzero in each row, it can be stored in a im*ik array together with two integer arrays indicating the position of the first and last nonzero elements in each row.
nfirst Integer array of dimension (im) containing pointers to the first nonzero element of each row of the B-spline refinement matrix from etau to et.
nlast Integer array of dimension (im) containing pointers to the last nonzero element of each row of the B-spline refinement matrix from etau to et.

template<class T>
void Go::Register (  ) 

This function is used to register a class derived from GeomObject with the global Factory.

By using this function rather than Factory::registerClass(), the user does not have to worry about the details of the Creator class. To register a class

 DerivedClass 
, it should be sufficient to run:
 Register<DerivedClass>() 
.

Definition at line 147 of file Factory.h.

References Go::Factory::globalFactory(), and Go::Factory::registerClass().

void Go::CoonsPatchGen::reparamBoundaryCurve ( std::vector< boost::shared_ptr< SplineCurve > > &  curves,
double  aconst 
)

Check length of tangent vectors at the endpoints of a curve compared to the size of the curve.

If the vectors are too long, reparametrize the curve and all the other curves in vector. All curves expected to share parametrization. First curve is a bnd curve. Optional additional curves may be cross tangent curve. Function reparametrizes bnd curve so that end tangents have length equal to aconst. Typical value is 1/3 of edge-length.

Parameters:
curves input and output curves.
aconst scalar defining end tangent length.

boost::shared_ptr<SplineSurface> Go::representCurveAsSurface ( const SplineCurve &  curve,
int  cv_dir,
const BsplineBasis &  other_bas,
bool  rational 
)

Describe a curve as a lower-dimensional surface in a given direction.

Parameters:
curve the curve that we want to express as a surface
cv_dir If this variable is set to '1', then the curve's parameter will become the first parameter in the generated surface. If it is set to '2', the curve's parameter will become the second parameter in the generated surface. Other values are illegal.
other_bas the BsplineBasis for the additional parameter direction.
rational define whether the generated surface shall be specified as rational or not.
Returns:
a shared pointer to a new SplineSurface, expressing the curve in a space of lower dimensionality.

boost::shared_ptr<SplineCurve> Go::representSurfaceAsCurve ( const SplineSurface &  surface,
int  cv_dir 
)

Describe a surface as a high-dimensional curve in a given direction.

If the surface is rational, the curve will be non-rational and living in the homogenous space.

Parameters:
surface the surface to express as a curve
cv_dir the parameter direction that will be kept when defining the curve (the other one will disappear, as the control points in this direction will be lumped together and expressed as single control points in a higher-dimensional space. 'cv_dir' takes either the value '1' (keep the first parameter direction) or '2' (keep the second parameter direction).
Returns:
shared pointer to a new SplineCurve, expressing the surface as a curve in a high-dimensional space.

void Go::BoundedUtils::rotateBoundedSurf ( Point  rot_axis,
double  alpha,
BoundedSurface bf_sf,
double  deg_eps 
)

Parameters:
rot_axis a vector specifying the axis of rotation

Parameters:
alpha the angle of rotation (in radians)
bf_sf the surface to rotate
deg_eps an epsilon value used when determining degenerate boundary loops

void Go::rotateLineCloud ( Point  rot_axis,
double  alpha,
LineCloud &  lc 
)

Rotate the given LineCloud a certain angle around a given axis.

Parameters:
rot_axis the axis of rotation. It does not have to be normalized, but must of course be nonzero.
alpha the angle of rotation, given in radians
lc reference to the LineCloud that is to be rotated

void Go::rotatePoint ( Point  rot_axis,
double  alpha,
double *  space_pt 
)

Rotate the given 3D point a certain angle around a certain axis.

Parameters:
rot_axis the axis of rotation. It does not have to be normalized, but must of course be nonzero.
alpha the angle of rotation, given in radians
space_pt pointer to the memory location where the 3D coordinates of the point are stored. These will be overwritten with the rotated coordinates.

void Go::rotateSplineCurve ( Point  rot_axis,
double  alpha,
SplineCurve &  cv 
)

Rotate the given SplineCurve a certain angle around a given axis.

Parameters:
rot_axis the axis of rotation. It does not have to be normalized, but must of course be nonzero.
alpha the angle of rotation, given in radians
cv reference to the curve that is to be rotated

void Go::rotateSplineSurf ( Point  rot_axis,
double  alpha,
SplineSurface &  sf 
)

Rotate the given SplineSurface a certain angle around a given axis.

Parameters:
rot_axis the axis of rotation. It does not have to be normalized, but must of course be nonzero.
alpha the angle of rotation, given in radians
sf reference to the surface that is to be rotated.

std::vector<boost::shared_ptr<Go::SplineSurface> > Go::SurfaceCreators::separateRationalParts ( const Go::SplineSurface sf  ) 

Assuming the sf is rational, separate the geometric space from the homogenuous.

Parameters:
sf the input spline surface.
Returns:
the non-rational parts of sf.

void Go::setSfBdCoefToConst ( SplineSurface &  srf,
int  bd_idx,
int  idx_d,
double  val,
double  deg_tol 
)

Modify surface along specified boundary to match a specific constant in one direction.

Currently only non-rational surfaces

SplineCurve* Go::SISLCurve2Go ( const SISLCurve *const   cv  ) 

Convert a SISLCurve to a SplineCurve.

Parameters:
cv the SISLcurve to convert
Returns:
A newly generated SplineCurve that describes the same curve as 'cv'. The user assumes ownership and is responsible for cleaning up by calling the delete function.

SplineSurface* Go::SISLSurf2Go ( SISLSurf *  sf  ) 

Convert a SISLSurface to a SplineSurface.

Parameters:
sf the SISLSurf to convert
Returns:
A newly generated SplineSurface that describes the same surface as 'sf'. The user assumes ownership and is responsible for cleaning up by calling the delete function.

void Go::CoonsPatchGen::splitMeshCurves ( std::vector< boost::shared_ptr< SplineCurve > > &  mesh_curves,
std::vector< double > &  params,
int &  nmb_u_crvs,
std::vector< int > &  cross_index,
double  epsgeo 
)

Given input iso-curves, the curves are analyzed and the ordering altered such that the nmb_u_crvs first elements are u-curves, and the rest are v-curves.

Calculated iso parameter for the curves is returned in params.

Parameters:
mesh_curves iso-curves for a surface, sorted inside function.
params calculated parameters for the iso-curves.
nmb_u_crvs the number of curves parametrized in the u-direction.
cross_index elements referring to mesh_curves, updated inside function.
epsgeo geometrical tolerance defining intersections between mesh_curves.

void Go::surface_ratder ( double const  eder[],
int  idim,
int  ider,
double  gder[] 
)

This function takes as input the position and a certain number of derivatives in homogenous space of a point on a rational surface.

It outputs the positioin and derivatives of this point in non-homogenous ("ordinary") space. (Corresponds to s6strider in SISL)

Parameters:
eder pointer to double array of dimenson [(ider+1)*(ider+2)*(idim+1)/2] containing the position and the derivative vectors of the homogeneous surface at the point with parameter value (epar[0],epar[1]). (idim+1 is the number of components of each B-spline coefficient, i.e. the dimension of the homogemous space in which the surface lies.) These vectors are stored in the following order: First the idim+1 components of the position vector, then the idim+1 components of the D(1,0) vector, then the idim+1 components of the D(0,1) vector, then the idim+1 components of the D(2,0) vector, followed by D(1,1), D(0,2) and so on up to the idim+1 components of the D(0,ider).
idim The dimension of the non homogenous space
ider The number of input derivatives with respect to both parameter directions.
gder pointer to the array where the result will be written (in same order as 'eder').

void Go::surfaceKinks ( const SplineSurface &  sf,
double  max_normal_angle,
std::vector< double > &  g1_disc_u,
std::vector< double > &  g1_disc_v 
)

Surface assumed to be continuous.

Return parameter values failing to achieve G1-continuity.

SplineSurface* Go::CoonsPatchGen::tpSurface ( const std::vector< boost::shared_ptr< SplineCurve > > &  mesh_curves,
std::vector< double >  params,
int  nmb_u_crvs,
const std::vector< boost::shared_ptr< SplineCurve > > &  cross_curves,
std::vector< int > &  cross_index 
)

Make tensor product surface which interpolates given grid points.

All curves assumed to share spline space.

Parameters:
mesh_curves curves to be interpolated in the Gordon Surface, both u- and v-curves.
params the iso parameters for the curves.
nmb_u_crvs the number of curves parametrized in the u-direction.
cross_curves cross tangent curves for the Gordon Surface.
cross_index referring to index of corresponding boundary curve.
Returns:
pointer the created lofting surface.

void Go::BoundedUtils::translateBoundedSurf ( Point  trans_vec,
BoundedSurface bd_sf,
double  deg_eps 
)

Translate a given BoundedSurface.

Parameters:
trans_vec the vector specifying the translation to apply to the surface
bd_sf the surface to translate
deg_eps an epsilon value used when determining degenerate boundary loops

void Go::transpose_array ( int  dim,
int  m,
int  n,
double *  array_start 
)

Transpose an (m x n) matrix of dim-dimensional points stored as an array in row-major order (i.e.

all elements of a single row are stored together).

Parameters:
dim the dimension of each of the points in the array
m number of lines in the matrix
n number of columns in the matrix
array_start pointer to the start of array where matrix is stored

vector<shared_ptr<BoundedSurface> > Go::BoundedUtils::trimSurfWithSurf ( const shared_ptr< Go::ParamSurface > &  sf1,
const shared_ptr< Go::ParamSurface > &  sf2,
double  epsge 
)

If the argument surfaces intersect, and if the intersection curves result in new boundary loops being defined, then the new surface parts defined within these domains will be returned.

Otherwise, the return vector will be empty.

Parameters:
sf1 the first surface to participate in the intersection
sf2 the second surface to participate in the intersection
epsge geometrical tolerance to be used in computations
Returns:
a vector with the surfaces representing the parts of the original surfaces enclosed by new parametrical loops arising when combining existing loops with the curves defined by the intersection.

vector<shared_ptr<BoundedSurface> > Go::BoundedUtils::trimWithPlane ( const shared_ptr< Go::ParamSurface > &  surf,
Point  point,
Point  normal,
double  epsge 
)

We intersect a parametric surface with a plane, and return the surface(s) consisting only of the part(s) of the surface that were located on the positive side of the intersection.

If there was no intersection, an empty stl-vector is returned. The plane is defined by its normal and a point located on it.

Parameters:
surf the parametric surface. It must be either a BoundedSurface or a SplineSurface.
point a point on the plane to intersect against
normal normal of the plane to intersect against
epsge geometric tolerance
Returns:
the surface(s) consisting of the part(s) of 'surf' that were located on the positive side of the intersection.

void Go::unifyCurveSplineSpace ( std::vector< boost::shared_ptr< SplineCurve > > &  curves,
double  tol 
)

Make sure that a set of curves live on the same knot vector tol-equal knots are set equal (i.e.

if they differ within tol). Warning! Objects being pointed to may be recreated inside function. Remember to update evnt. other shared pointers.

void Go::unifySurfaceSplineSpace ( std::vector< boost::shared_ptr< SplineSurface > > &  surfaces,
double  tol,
int  dir = 0 
)

Make sure that a set of surfaces live on the same knot vectors tol-equal knots are set equal (i.e.

if they differ within tol). Warning! Objects being pointed to may be recreated inside function. Remember to update evnt. other shared pointers. dir 0 means both, 1 is u, 2 is v

void Go::writeSISLFormat ( const SplineCurve &  spline_cv,
std::ostream &  os 
)

Write a SplineCurve to a stream using the SISL file format (not the Go format).

Parameters:
spline_cv the curve to write to a stream
os the stream to which the curve will be written (in SISL format)x

void Go::writeSpaceParamCurve ( const SplineCurve &  pcurve,
std::ostream &  os,
double  z = 0.0 
)

For debugging.

Writes a parameter curve (2D) in the xy-plane, for a given z-value. It will be written (with header) to the specified stream as a 3D curve.

Parameters:
pcurve the parameter curve we want to write as a 3D curve
os the stream to which we want to write the 3D curve
z the constant z-value for the generated curve


Generated on Mon Jun 11 14:48:18 2007 for GoTools Core Library by  doxygen 1.5.1