BRL-CAD
bezier.c File Reference
#include "common.h"
#include "bio.h"
#include "vmath.h"
#include "raytrace.h"
#include "nurb.h"
#include "./librt_private.h"
Include dependency graph for bezier.c:

Go to the source code of this file.

Macros

#define SGN(_x)   (((_x)<0) ? -1 : 1)
 
#define MAXDEPTH   64
 

Functions

HIDDEN int crossing_count (point2d_t *V, int degree, point2d_t ray_start, point2d_t ray_perp)
 
HIDDEN int control_polygon_flat_enough (point2d_t *V, int degree, fastf_t epsilon)
 
void bezier (point2d_t *V, int degree, double t, point2d_t *Left, point2d_t *Right, point2d_t eval_pt, point2d_t normal)
 
HIDDEN int compute_x_intercept (point2d_t *V, int degree, point2d_t ray_start, point2d_t ray_dir, point2d_t intercept, point2d_t normal)
 
int bezier_roots (point2d_t *w, int degree, point2d_t **intercept, point2d_t **normal, point2d_t ray_start, point2d_t ray_dir, point2d_t ray_perp, int depth, fastf_t epsilon)
 
struct bezier_2d_list * bezier_subdivide (struct bezier_2d_list *bezier_in, int degree, fastf_t epsilon, int depth)
 

Detailed Description

The following routines are for 2D Bezier curves.

The following routines are borrowed from Graphics Gems I, Academic Press, Inc., 1990, Andrew S. Glassner (editor), "A Bezier Curve-based Root-finder", Philip J. Schneider.

Modifications have been made for inclusion in BRL-CAD and to generalize the codes for finding intersections with any 2D line rather than just the X-axis.

Definition in file bezier.c.