BRL-CAD
metaball_tri.c File Reference
#include "common.h"
#include <stddef.h>
#include <string.h>
#include <math.h>
#include "bio.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "nurb.h"
#include "wdb.h"
#include "metaball.h"
Include dependency graph for metaball_tri.c:

Go to the source code of this file.

Macros

#define MEH(c, di, dj, dk)   VSET(p[c], i+di, j+dj, k+dk); pv |= rt_metaball_point_inside((const point_t *)&p[c], mb) << c;
 
#define MEH(a, b, c)
 

Functions

int rt_metaball_tess (struct nmgregion **r, struct model *m, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
 

Detailed Description

Tessellation/facetization routines for the metaball primitive.

Here be magic.

         4
   4-----------5
 8/|         9/|
 / |   0     / |
0-----------1  |5
|  |7       |  |
|  |   6   1|  |

3| 7-----—|–6 | / | / |/11 |/10 3--------—2 2

Definition in file metaball_tri.c.

Macro Definition Documentation

#define MEH (   c,
  di,
  dj,
  dk 
)    VSET(p[c], i+di, j+dj, k+dk); pv |= rt_metaball_point_inside((const point_t *)&p[c], mb) << c;

Referenced by rt_metaball_tess().

#define MEH (   a,
  b,
 
)
Value:
if (!(pv&(1<<b)&&pv&(1<<c))) { \
rt_metaball_find_intersection(edges+a, mb, (const point_t *)(p+b), (const point_t *)(p+c), mtol, finalstep); \
}
int rt_metaball_find_intersection(point_t *intersect, const struct rt_metaball_internal *mb, const point_t *a, const point_t *b, fastf_t step, const fastf_t finalstep)
Definition: metaball.c:345

Function Documentation

int rt_metaball_tess ( struct nmgregion **  r,
struct model *  m,
struct rt_db_internal ip,
const struct rt_tess_tol ttol,
const struct bn_tol tol 
)

Tessellate a metaball.

Definition at line 65 of file metaball_tri.c.

References rt_tess_tol::abs, BU_LIST_FIRST, BU_LIST_FOR, bu_log(), bu_vls_addr(), BU_VLS_INIT_ZERO, bn_tol::dist, rt_db_internal::idb_ptr, MEH, nmg_mark_edges_real(), nmg_mc_realize_cube(), nmg_model_fuse(), nmg_mrsv(), nmg_region_a(), rt_tess_tol::rel, RT_CK_DB_INTERNAL, rt_get_timer(), rt_metaball_bbox(), rt_metaball_get_bounding_sphere(), rt_prep_timer(), s, X, Y, and Z.

Here is the call graph for this function: