Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

bezier_polyline.c File Reference

Redundant functions for Bezier polylines -- kept, just in case... More...

#include <math.h>
#include "geom.h"
#include "bezier.h"
#include "bezier_polyline.h"

Functions

int alloc_bezier_3_poly (struct bezier_3_poly_data *bp, int n)
 Allocate memory for the Bezier polyline data.
int free_bezier_3_poly (struct bezier_3_poly_data *bp)
 Release the memory that had been allocated to the polyline.
int segment_bezier_3_poly (struct bezier_3_poly_data *bp, struct point_3D *loc0, struct point_3D *loc1, struct point_3D *loc2, struct point_3D *loc3, int i)
 Initialize the coordinates of the Bezier control points for Bezier segment i.
int normalize_bezier_3_poly (struct bezier_3_poly_data *bp)
 Normalize the Bezier polyline so that the parameter t_star varies from 0.0 to 1.0 along the entire curve.
int eval_bezier_3_poly (struct bezier_3_poly_data *bp, double t_star, struct point_3D *loc)
 Evaluate the position on the Bezier polyline at given parameter t_star.
int bezier_3_spline (struct bezier_3_poly_data *bp, int m, struct point_3D p[])
 Given m+1 interpolation points, determine the m-segment Bezier polyline that interpolates these points as a spline.
int coons_bezier_3 (struct bezier_3_poly_data *c1, struct bezier_3_poly_data *c2, struct bezier_3_poly_data *c3, struct bezier_3_poly_data *c4, double r, double s, struct point_3D *d)
 Compute a location on the Coons patch at parameter position (r,s).


Detailed Description

Redundant functions for Bezier polylines -- kept, just in case...

Author:
PA Jacobs

Function Documentation

int alloc_bezier_3_poly struct bezier_3_poly_data bp,
int  n
 

Allocate memory for the Bezier polyline data.

Parameters:
bp : pointer to the polyline data structure
n : number of Bezier segments in the polyline
Returns -1 if the allocation fails, 0 otherwise.

int bezier_3_spline struct bezier_3_poly_data bp,
int  m,
struct point_3D  p[]
 

Given m+1 interpolation points, determine the m-segment Bezier polyline that interpolates these points as a spline.

This is done by first determining the array of weight points which define the spline and then evaluating the cubic Bezier segments.

If successful, data is written directly to the Bezier polyline data structure. function returns an integer status flag: 0 == normal return -1 == NULL pointer to Bezier polyline -2 == invalid value for m -3 == NULL pointer for interpolation points -4 == could not allocate weight-point array

Parameters:
bp : (pointer to) the Bezier polyline data bp needs to be allocated before calling this function.
m : number of segments
p[] : array of m+1 data points (i=0...m)
Reference:

G. Engelin & F. Uhlig (1996) Numerical Algorithms with C Springer, Berlin Section 12.3.1

int coons_bezier_3 struct bezier_3_poly_data c1,
struct bezier_3_poly_data c2,
struct bezier_3_poly_data c3,
struct bezier_3_poly_data c4,
double  r,
double  s,
struct point_3D *  d
 

Compute a location on the Coons patch at parameter position (r,s).

Returns 0 for a normal return, -1 otherwise.

Parameters:
c1,c2,c3,c4 : pointers to the bounding curves These are normalized Bezier polylines. c1 and c2 are the South and North boundaries respectively. The parameter 0 <= r <= 1 traverses them West to East. c3 and c4 are the West and East boundaries respectively. Parameter 0 <= s <= 1 traverses them South to North.
r : West to East parameter, 0 <= r <= 1.
s : South to North parameter, 0 <= s <= 1.
d : pointer to the computed location in (x,y,z)-space

int eval_bezier_3_poly struct bezier_3_poly_data bp,
double  t_star,
struct point_3D *  loc
 

Evaluate the position on the Bezier polyline at given parameter t_star.

Returns 0 if everything was OK, -1 if there was a problem.

Parameters:
bp : (pointer to) the Bezier polyline data
t_star : position parameter, 0 <= t_star <= 1.0
loc : (pointer to) the computed location in 3D

int normalize_bezier_3_poly struct bezier_3_poly_data bp  ) 
 

Normalize the Bezier polyline so that the parameter t_star varies from 0.0 to 1.0 along the entire curve.

Returns -1 if the normalization fails, 0 otherwise.

Arc length along the Bezier segments is approximated as the sum of the distances between a number of points along each curve.

Parameters:
bp : pointer to the polyline data structure

int segment_bezier_3_poly struct bezier_3_poly_data bp,
struct point_3D *  loc0,
struct point_3D *  loc1,
struct point_3D *  loc2,
struct point_3D *  loc3,
int  i
 

Initialize the coordinates of the Bezier control points for Bezier segment i.

Parameters:
p3 : (pointer to) the Bezier polyline data
loc0-3 : (pointer to) the location of control points 0-3
i : index of the desired segment, 0 <= i < n


Generated on Tue Oct 25 10:24:13 2005 for CFCFD by  doxygen 1.4.4