BRL-CAD
nurb_interp.c File Reference
#include "common.h"
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "raytrace.h"
#include "nurb.h"
Include dependency graph for nurb_interp.c:

Go to the source code of this file.

Macros

#define NVAL(_col, _row)   data[((_row)*xmax+(_col))*3]
 

Functions

void rt_nurb_nodes (fastf_t *nodes, const struct knot_vector *knots, int order)
 
void rt_nurb_interp_mat (fastf_t *imat, struct knot_vector *knots, fastf_t *nodes, int order, int dim)
 
void rt_nurb_cinterp (struct edge_g_cnurb *crv, int order, const fastf_t *data, int n)
 
void rt_nurb_sinterp (struct face_g_snurb *srf, int order, const fastf_t *data, int ymax, int xmax)
 

Detailed Description

Interpolation routines for fitting NURB curves and and surfaces to existing data.

Definition in file nurb_interp.c.

Macro Definition Documentation

#define NVAL (   _col,
  _row 
)    data[((_row)*xmax+(_col))*3]

Referenced by rt_nurb_sinterp().

Function Documentation

void rt_nurb_nodes ( fastf_t nodes,
const struct knot_vector *  knots,
int  order 
)

Definition at line 41 of file nurb_interp.c.

Referenced by rt_nurb_cinterp().

void rt_nurb_interp_mat ( fastf_t imat,
struct knot_vector *  knots,
fastf_t nodes,
int  order,
int  dim 
)

Definition at line 59 of file nurb_interp.c.

References rt_nurb_basis_eval().

Referenced by rt_nurb_cinterp().

Here is the call graph for this function:

void rt_nurb_cinterp ( struct edge_g_cnurb *  crv,
int  order,
const fastf_t data,
int  n 
)

main routine for interpolation of curves

Definition at line 80 of file nurb_interp.c.

References bu_free(), bu_malloc(), rt_nurb_interp_mat(), rt_nurb_kvknot(), rt_nurb_nodes(), and rt_nurb_solve().

Referenced by rt_nurb_sinterp().

Here is the call graph for this function:

void rt_nurb_sinterp ( struct face_g_snurb *  srf,
int  order,
const fastf_t data,
int  ymax,
int  xmax 
)

Interpolate the 2-D grid of data values and fit a B-spline surface to it.

This is done in two steps:

1) Fit a curve to the data in each row.

2) Fit a curve to the control points from step 1 in each column. The result is a mesh of control points which defines the surface.

Input data is assumed to be a 3-tuple of (X, Y, Z) where Z is the independent variable being interpolated to make the surface.

Definition at line 151 of file nurb_interp.c.

References bu_calloc(), bu_free(), bu_malloc(), NMG_EDGE_G_CNURB_MAGIC, NMG_FACE_G_SNURB_MAGIC, NVAL, rt_nurb_cinterp(), rt_nurb_clean_cnurb(), and rt_nurb_kvknot().

Referenced by interpolate_data().

Here is the call graph for this function: