BRL-CAD
sketch_tess.cpp File Reference
#include "common.h"
#include <vector>
#include "raytrace.h"
#include "rtgeom.h"
#include "vmath.h"
#include "brep.h"
Include dependency graph for sketch_tess.cpp:

Go to the source code of this file.

Macros

#define MINSTEP   0.0001
 
#define MAXSTEP   0.1
 
#define GETSTEPSIZE(step)   ((step) > MAXSTEP ? MAXSTEP : ((step) < MINSTEP ? MINSTEP : (step)))
 
#define POW3(x)   ((x)*(x)*(x))
 
#define SIGN(x)   ((x) >= 0 ? 1 : -1)
 
#define CURVATURE(d1, d2)   (V2CROSS((d1), (d2)) / POW3((d1).Length()))
 
#define SKETCH_PT(idx)   sketch_ip->verts[(idx)]
 
#define DIST_PT2D_PT2D_SQ(_p1, _p2)
 
#define DIST_PT2D_PT2D(_p1, _p2)   sqrt(DIST_PT2D_PT2D_SQ(_p1, _p2))
 

Functions

HIDDEN ON_2dPoint incenter (const ON_2dPoint a, const ON_2dPoint b, const ON_2dPoint c)
 
HIDDEN ON_Arc make_biarc (const ON_BezierCurve &bezier)
 
HIDDEN bool bezier_inflection (const ON_BezierCurve &bezier, fastf_t &inflection_pt)
 
HIDDEN void approx_bezier (const ON_BezierCurve &bezier, const ON_Arc &biarc, const struct bn_tol *tol, std::vector< ON_Arc > &approx)
 
HIDDEN void bezier_to_carcs (const ON_BezierCurve &bezier, const struct bn_tol *tol, std::vector< ON_Arc > &carcs)
 
void rt_sketch_surf_area (fastf_t *area, const struct rt_db_internal *ip)
 

Macro Definition Documentation

#define MINSTEP   0.0001

Definition at line 97 of file sketch_tess.cpp.

#define MAXSTEP   0.1

Definition at line 98 of file sketch_tess.cpp.

#define GETSTEPSIZE (   step)    ((step) > MAXSTEP ? MAXSTEP : ((step) < MINSTEP ? MINSTEP : (step)))

Definition at line 100 of file sketch_tess.cpp.

Referenced by approx_bezier(), and bezier_inflection().

#define POW3 (   x)    ((x)*(x)*(x))

Definition at line 102 of file sketch_tess.cpp.

#define SIGN (   x)    ((x) >= 0 ? 1 : -1)

Definition at line 103 of file sketch_tess.cpp.

Referenced by bezier_inflection().

#define CURVATURE (   d1,
  d2 
)    (V2CROSS((d1), (d2)) / POW3((d1).Length()))

Definition at line 104 of file sketch_tess.cpp.

Referenced by approx_bezier(), and bezier_inflection().

#define SKETCH_PT (   idx)    sketch_ip->verts[(idx)]

Definition at line 244 of file sketch_tess.cpp.

Referenced by rt_sketch_surf_area().

#define DIST_PT2D_PT2D_SQ (   _p1,
  _p2 
)
Value:
(((_p2)[X] - (_p1)[X]) * ((_p2)[X] - (_p1)[X]) + \
((_p2)[Y] - (_p1)[Y]) * ((_p2)[Y] - (_p1)[Y]))
Definition: color.c:49
Definition: color.c:50

Definition at line 246 of file sketch_tess.cpp.

Referenced by rt_sketch_surf_area().

#define DIST_PT2D_PT2D (   _p1,
  _p2 
)    sqrt(DIST_PT2D_PT2D_SQ(_p1, _p2))

Definition at line 250 of file sketch_tess.cpp.

Referenced by rt_sketch_surf_area().

Function Documentation

HIDDEN ON_2dPoint incenter ( const ON_2dPoint  a,
const ON_2dPoint  b,
const ON_2dPoint  c 
)

Definition at line 54 of file sketch_tess.cpp.

Referenced by make_biarc().

HIDDEN ON_Arc make_biarc ( const ON_BezierCurve &  bezier)

Definition at line 78 of file sketch_tess.cpp.

References incenter().

Referenced by approx_bezier(), and bezier_to_carcs().

Here is the call graph for this function:

HIDDEN bool bezier_inflection ( const ON_BezierCurve &  bezier,
fastf_t inflection_pt 
)

Definition at line 111 of file sketch_tess.cpp.

References CURVATURE, GETSTEPSIZE, SIGN, and sign().

Referenced by bezier_to_carcs().

Here is the call graph for this function:

HIDDEN void approx_bezier ( const ON_BezierCurve &  bezier,
const ON_Arc &  biarc,
const struct bn_tol tol,
std::vector< ON_Arc > &  approx 
)

Definition at line 146 of file sketch_tess.cpp.

References CURVATURE, GETSTEPSIZE, and make_biarc().

Referenced by bezier_to_carcs().

Here is the call graph for this function:

HIDDEN void bezier_to_carcs ( const ON_BezierCurve &  bezier,
const struct bn_tol tol,
std::vector< ON_Arc > &  carcs 
)

Definition at line 184 of file sketch_tess.cpp.

References approx_bezier(), bezier(), bezier_inflection(), M_PI, and make_biarc().

Referenced by rt_sketch_surf_area().

Here is the call graph for this function: