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

Go to the source code of this file.

Functions

fastf_t rt_nurb_par_edge (const struct face_g_snurb *srf, fastf_t epsilon)
 
fastf_t rt_cnurb_par_edge (const struct edge_g_cnurb *crv, fastf_t epsilon)
 

Detailed Description

Given Epsilon, compute the number of internal knots to add so that every triangle generated in parametric space is within epsilon of the original surface.

Definition in file nurb_tess.c.

Function Documentation

fastf_t rt_nurb_par_edge ( const struct face_g_snurb *  srf,
fastf_t  epsilon 
)

Algorithm -

See paper in Computer Aided Design (CAD) Volume 27, Number 1, January 1995 TESSELATING TRIMMED NURBS SURFACES, Leslie A Piegl and Arnaud Richard.

There is a slight deviation from the paper; since libnurb (rt_nurb_s_diff) differentiation correctly handles rational surfaces, no special processing for rational is needed.

The idea is to compute the longest edge size in parametric space such that a the edge (or curve) in real space is within epsilon tolerance. The mapping from parametric space is done as a separate step.

Definition at line 59 of file nurb_tess.c.

References rt_nurb_free_snurb(), and rt_nurb_s_diff().

Referenced by rt_nurb_plot().

Here is the call graph for this function:

fastf_t rt_cnurb_par_edge ( const struct edge_g_cnurb *  crv,
fastf_t  epsilon 
)

Calculate the maximum edge length (in parameter space) that will keep the curve approximation within epsilon of the true curve

This is a temporary guess until legitimate code can be found

returns: -1.0 if the curve is a straight line maximum parameter increment otherwise

Definition at line 154 of file nurb_tess.c.

References bu_bomb(), bu_log(), MAX_FASTF, rt_nurb_c_diff(), rt_nurb_free_cnurb(), and ZERO.

Referenced by seg_to_vlist().

Here is the call graph for this function: