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

Go to the source code of this file.

Functions

int rt_nurb_bezier (struct bu_list *bezier_hd, const struct face_g_snurb *orig_surf, struct resource *res)
 
int rt_bez_check (const struct face_g_snurb *srf)
 
int nurb_crv_is_bezier (const struct edge_g_cnurb *crv)
 
void nurb_c_to_bezier (struct bu_list *clist, struct edge_g_cnurb *crv)
 

Detailed Description

Convert a NURB surface or curve into Bezier form, with no internal knots.

Definition in file nurb_bezier.c.

Function Documentation

int rt_nurb_bezier ( struct bu_list bezier_hd,
const struct face_g_snurb *  orig_surf,
struct resource res 
)

Given a single snurb, if it is in Bezier form, duplicate the snurb, and enqueue it on the bezier_hd list. If the original snurb is NOT in Bezier form, subdivide it a set of snurbs which are, each of which are enqueued on the bezier_hd list.

In either case, the original surface remains untouched.

Returns - 0 Surface splitting was done. 1 Original surface was Bezier, only a copy was done.

Definition at line 53 of file nurb_bezier.c.

References BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_INIT, BU_LIST_WHILE, rt_bez_check(), rt_nurb_free_snurb(), rt_nurb_s_split(), rt_nurb_scopy(), and s.

Referenced by isect_ray_snurb_face(), rt_nurb_bbox(), and rt_nurb_prep().

Here is the call graph for this function:

int rt_bez_check ( const struct face_g_snurb *  srf)

Definition at line 87 of file nurb_bezier.c.

Referenced by rt_nurb_bezier().

int nurb_crv_is_bezier ( const struct edge_g_cnurb *  crv)

Check if a NURB curve is in Bezier form.

returns: 1 - curve is Bezier 0 - curve is not Bezier

Definition at line 108 of file nurb_bezier.c.

References bezier(), and ZERO.

Referenced by rt_process_casec().

Here is the call graph for this function:

void nurb_c_to_bezier ( struct bu_list clist,
struct edge_g_cnurb *  crv 
)

Split NURB curve into list of Bezier curves.

If curve is already Bezier, return NULL

Definition at line 134 of file nurb_bezier.c.

References BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_PNEXT, MAX_FASTF, rt_nurb_c_xsplit(), rt_nurb_crv_copy(), rt_nurb_free_cnurb(), and ZERO.

Referenced by rt_process_casec().

Here is the call graph for this function: