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

Go to the source code of this file.

Functions

void rt_dspline_matrix (fastf_t *m, const char *type, const double tension, const double bias)
 
double rt_dspline4 (fastf_t *m, double a, double b, double c, double d, double alpha)
 
void rt_dspline4v (double *pt, const fastf_t *m, const double *a, const double *b, const double *c, const double *d, const int depth, const double alpha)
 
void rt_dspline_n (double *r, const fastf_t *m, const double *knots, const int nknots, const int depth, const double alpha)
 

Detailed Description

Simple data (double) spline package.

rt_dspline_matrix(m, type, tension, bias) create basis matrix rt_dspline4(m, a, b, c, d, alpha) interpolate 1 value rt_dspline4v(m, a, b, c, d, depth alpha) interpolate vectors rt_dspline(r, m, knots, n, depth, alpha) interpolate n knots over 0..1

Example:

mat_t m; double d; vect_t v; vect_t kn = { {0., 0., 0.}, {0., 1., 0.}, {.5, 1., 0.}, {1., 1., 0.}, {1., 0., 0.} };

rt_dspline_matrix(m, "Beta", 0.5, 1.0);

d = rt_dspline4(m, .0, .0, 1.0, 1.0, 0.25);

for (p = 0.0; p <= 1.0; p += 0.0625) { rt_dspline(v, m, kn, 5, 3, p); bu_log("%g (%g %g %g)\n", p, V3ARGS(v)); }

Definition in file dspline.c.

Function Documentation

void rt_dspline_matrix ( fastf_t m,
const char *  type,
const double  tension,
const double  bias 
)

Definition at line 122 of file dspline.c.

References bu_log(), and bu_strncasecmp().

Referenced by fire_setup().

Here is the call graph for this function:

double rt_dspline4 ( fastf_t m,
double  a,
double  b,
double  c,
double  d,
double  alpha 
)

Definition at line 142 of file dspline.c.

void rt_dspline4v ( double *  pt,
const fastf_t m,
const double *  a,
const double *  b,
const double *  c,
const double *  d,
const int  depth,
const double  alpha 
)

Definition at line 159 of file dspline.c.

Referenced by rt_dspline_n().

void rt_dspline_n ( double *  r,
const fastf_t m,
const double *  knots,
const int  nknots,
const int  depth,
const double  alpha 
)

Definition at line 182 of file dspline.c.

References bu_bomb(), and rt_dspline4v().

Referenced by fire_render().

Here is the call graph for this function: