gCAD3D 2.35
ut_rbspl.c File Reference

rational b-spline curve functions More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_ox_base.h"
#include "../ut/ut_math.h"
#include "../ut/ut_TX.h"
#include "../ut/ut_bspl.h"
#include "../ut/ut_obj.h"
#include "../ut/func_types.h"
#include "../xa/xa_mem.h"


#define TABSIZ1   16
#define TABSIZ2   1000000


int UT3D_par_rbsp_pt (double *kv, double *dist, CurvRBSpl *cvi, Point *pt)
double UT3D_par1_par_rbsp (double *kv, CurvRBSpl *cv1)
int UT3D_rbsp_rbez (CurvRBSpl *cvo, CurvRBez *cvi, Memspc *memSeg1)
int UT3D_pt_int_ln_rbsp (int *nxp, Point *xptab, Memspc *memSeg1, Line *ln1, CurvRBSpl *rbsp1)
int UT3D_pt_int_bsp_rbsp (int *nxp, Point *xptab, Memspc *memSeg1, CurvBSpl *bspl1, CurvRBSpl *bspl2)
int UT3D_pt_projptrbspl (int *nxp, Point *ptOut, double *vaOut, Memspc *memSeg1, double tol, CurvRBSpl *cv, Point *pt)
double UT3D_par_par1_rbsp (double pv, CurvRBSpl *cv1)
int UT3D_rbspl_ck_closed (CurvRBSpl *cv1)
int UT3D_obj_cnvt_rbspl (ObjGX *opo, CurvRBSpl *spi, Memspc *mpWrk)
int UT3D_ci_rbspl_ (Circ *cpo, CurvRBSpl *spi)
int UT3D_ci_rbspl3 (Circ *cpo, CurvRBSpl *spi)
int UT3D_ptNr_rbsp (int *iu, CurvRBSpl *bsp, double tol1)
int UT3D_cv_rbsp (int *ptNr, Point *pTab, double *dTab, CurvRBSpl *cv1, int ptMax, double tol)
int UT3D_pt_evparxCrvRBSpl (Point *pto, CurvRBSpl *cv1, double uv, double dist)
int UT3D_pt_evparCrvRBSpl (Point *pt, double *wt, CurvRBSpl *rbspl, double u)
int UT3D_bspl_deriv1 (CurvBSpl *bspld, Memspc *memSeg1, CurvBSpl *bspl)
int UT3D_rbspl_deriv1 (CurvBSpl *g, CurvBSpl *fd, CurvBSpl *gd, Memspc *memSeg1, CurvRBSpl *rbspl)
int UT3D_vc_evparCrvRBSpl (Vector *tg, CurvRBSpl *rbspl, CurvBSpl *g, CurvBSpl *fd, CurvBSpl *gd, double t)

Detailed Description

rational b-spline curve functions

UT3D_pt_evparCrvRBSpl point <-- rational b-spline at parameter
UT3D_pt_projptrbspl project point onto rational-b-spline curve
UT3D_vc_evparCrvRBSpl tangent vector <-- rational b-spline at parameter
UT3D_ptNr_rbsp estimate nr of polygonPoints for rat-B-spline
UT3D_cv_rbsp make Polygon from Rat.B-Spline-Kurve + tol
UT3D_bspl_deriv1 1. derivation b-spline curve <-- b-spline curve
UT3D_rbspl_deriv1 1. deriv. rat. b-spline curve <-- rat. b-spline curve
UT3D_rbsp_rbez rational-Bspline-curve from rational-bezier-curve
UT3D_rbspl_ck_closed check if B-SplCv is closed
UT3D_par_rbsp_pt get knotvalue from point on rational-b-spline curve
UT3D_par_par1_rbsp get knotValue from parameter 0-1
UT3D_par1_par_rbsp get parameter 0-1 from knotvalue of rational-b-spline
UT3D_obj_cnvt_rbspl convert Rat.B-Spl --> CI/LN; see UT3D_bsp_degrad
UT3D_ci_rbspl3 create circle from Rat.B-SplineCurve 3 ControlPoints
UT3D_pt_int_ln_rbsp intersect line X rat-b-spline-curv
UT3D_pt_int_bsp_rbsp intersect b-spline-curv X rat-b-spline-curv
------------------------ testfunctions:
UT3D_rbspl_tst_1 testprogs
UT3D_rbspl_tst_load load a teststruct
UT3D_rbspl_tst_cc display ControlPoints/Curve
UT3D_rbspl_tst_tg disp points und tangents

Macro Definition Documentation

#define TABSIZ1   16
#define TABSIZ2   1000000

Function Documentation

int UT3D_par_rbsp_pt ( double *  kv,
double *  dist,
CurvRBSpl cvi,
Point pt 


double UT3D_par1_par_rbsp ( double *  kv,
CurvRBSpl cv1 
int UT3D_rbsp_rbez ( CurvRBSpl cvo,
CurvRBez cvi,
Memspc memSeg1 
UT3D_rbsp_rbez rational-Bspline-curve from rational-bezier-curve
Backmeister, Reiter 2014-09-11
controlpoints, weights from cvi; knots in memSeg1.
int UT3D_pt_int_ln_rbsp ( int *  nxp,
Point xptab,
Memspc memSeg1,
Line ln1,
CurvRBSpl rbsp1 
int UT3D_pt_int_bsp_rbsp ( int *  nxp,
Point xptab,
Memspc memSeg1,
CurvBSpl bspl1,
CurvRBSpl bspl2 
int UT3D_pt_projptrbspl ( int *  nxp,
Point ptOut,
double *  vaOut,
Memspc memSeg1,
double  tol,
CurvRBSpl cv,
Point pt 
UT3D_pt_projptrbspl project point onto rational-b-spline curve
UT3D_pt_projptrbspl Author: Franz Reiter 2.4.2010
int *nxp ... size of ptOut and vaOut
CurvRBSpl *cv ... rational-b-spline curve
Point *pt ... point
Memspc *memSeg1 ... Memory fuer temp. Objects;
double tol pointtolerance
int *nxp ... number of projection points
Point *ptOut ... array of projection points
double *vaOut ... array of corresponding parameter values of
projection points on b-spline curve;
none if vaOut=NULL
0 = OK
-1 = out of mem (Memspc too small)
-2 = out of mem (ptab too small)
double UT3D_par_par1_rbsp ( double  pv,
CurvRBSpl cv1 
UT3D_par_par1_rbsp get knotValue from parameter 0-1
int UT3D_rbspl_ck_closed ( CurvRBSpl cv1)
int UT3D_obj_cnvt_rbspl ( ObjGX opo,
CurvRBSpl spi,
Memspc mpWrk 
int UT3D_ci_rbspl_ ( Circ cpo,
CurvRBSpl spi 
int UT3D_ci_rbspl3 ( Circ cpo,
CurvRBSpl spi 
int UT3D_ptNr_rbsp ( int *  iu,
CurvRBSpl bsp,
double  tol1 
UT3D_ptNr_rbsp estimate nr of polygonPoints for rat-B-spline
int UT3D_cv_rbsp ( int *  ptNr,
Point pTab,
double *  dTab,
CurvRBSpl cv1,
int  ptMax,
double  tol 
int UT3D_pt_evparxCrvRBSpl ( Point pto,
CurvRBSpl cv1,
double  uv,
double  dist 
int UT3D_pt_evparCrvRBSpl ( Point pt,
double *  wt,
CurvRBSpl rbspl,
double  u 
UT3D_pt_evparCrvRBSpl point <-- rational b-spline at parameter
UT3D_pt_evparCrvRBSpl Author: Thomas Backmeister 18.9.2004
Evaluate a point on a rational b-spline curve.
The underlying algorithm is "rational de Boor".
The point is computed for any parameter value within the maximal
support of the curve (we do not consider the limit parameters
rbspl->v0 and rbspl->v1).
The function needs work space of size
(curve degree + 1) * (sizeof(Point) + sizeof(double)).
CurvRBSpl *rbspl ... rational b-spline curve
double u ... parameter value
Memspc *workSeg ... work space (control points and weights)
Point *pt ... curve point
double *wt ... weight for *pt
0 = OK
-1 = out of work space
-2 = input error
int UT3D_bspl_deriv1 ( CurvBSpl bspld,
Memspc memSeg1,
CurvBSpl bspl 
int UT3D_rbspl_deriv1 ( CurvBSpl g,
CurvBSpl fd,
CurvBSpl gd,
Memspc memSeg1,
CurvRBSpl rbspl 
int UT3D_vc_evparCrvRBSpl ( Vector tg,
CurvRBSpl rbspl,
CurvBSpl g,
CurvBSpl fd,
CurvBSpl gd,
double  t