BRL-CAD
nurb_split.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_split.c:

Go to the source code of this file.

Functions

void rt_nurb_s_split (struct bu_list *split_hd, const struct face_g_snurb *srf, int dir, struct resource *res)
 
void rt_nurb_c_split (struct bu_list *split_hd, const struct edge_g_cnurb *crv)
 

Detailed Description

Subdivide a nurb surface by inserting a multiple knot of of the surface order in a given direction and return the resulting surfaces.

Definition in file nurb_split.c.

Function Documentation

void rt_nurb_s_split ( struct bu_list split_hd,
const struct face_g_snurb *  srf,
int  dir,
struct resource res 
)

Algorithm

Given a parametric direction (u or v) look at the direction knot vector and insert a multiple knot of parametric direction surface order. If internal knot values exist than pick the one closest to the middle and add additional knots to split at that value, otherwise add multiple knots at the mid point of the knot vector. Use the new knot vector to pass to the oslo refinement process and split the surface. Separate the surface and return the two resulting surface.

The original surface is undisturbed by this operation.

Definition at line 56 of file nurb_split.c.

References bu_free(), BU_LIST_APPEND, bu_malloc(), rt_nurb_calc_oslo(), rt_nurb_free_oslo(), rt_nurb_kvcopy(), rt_nurb_kvextract(), rt_nurb_kvmult(), rt_nurb_map_oslo(), and ZERO.

Referenced by rt_nurb_bezier(), and rt_nurb_intersect().

Here is the call graph for this function:

void rt_nurb_c_split ( struct bu_list split_hd,
const struct edge_g_cnurb *  crv 
)

Split a NURB curve by inserting a multiple knot and return the result of the two curves.

Algorithm

Insert a multiple knot of the curve order. If internal knot values exist than pick the one closest to the middle and add additional knots to split at that value, otherwise add multiple knots at the mid point of the knot vector. Use the new knot vector to pass to the oslo refinement process and split the curve. Separate the curve and return the two resulting curves.

The original curve is undisturbed by this operation.

Definition at line 258 of file nurb_split.c.

References bu_free(), BU_LIST_APPEND, bu_malloc(), rt_nurb_calc_oslo(), rt_nurb_free_oslo(), rt_nurb_kvextract(), rt_nurb_kvmult(), rt_nurb_map_oslo(), and ZERO.

Here is the call graph for this function: