BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "bnetwork.h"
#include "bu/cv.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "raytrace.h"
#include "nurb.h"
Include dependency graph for nmg.c:

Go to the source code of this file.

Data Structures

struct  nmg_specific
 
struct  tmp_v
 
struct  disk_rt_list
 
struct  disk_model
 
struct  disk_nmgregion
 
struct  disk_nmgregion_a
 
struct  disk_shell
 
struct  disk_shell_a
 
struct  disk_face
 
struct  disk_face_g_plane
 
struct  disk_face_g_snurb
 
struct  disk_faceuse
 
struct  disk_loop
 
struct  disk_loop_g
 
struct  disk_loopuse
 
struct  disk_edge
 
struct  disk_edge_g_lseg
 
struct  disk_edge_g_cnurb
 
struct  disk_edgeuse
 
struct  disk_vertex
 
struct  disk_vertex_g
 
struct  disk_vertexuse
 
struct  disk_vertexuse_a_plane
 
struct  disk_vertexuse_a_cnurb
 
struct  disk_double_array
 
struct  nmg_exp_counts
 
struct  poly_face
 

Macros

#define NMG_SPEC_START_MAGIC   6014061
 
#define NMG_SPEC_END_MAGIC   7013061
 
#define NMG_CK_DISKMAGIC(_cp, _magic)
 
#define DISK_INDEX_NULL   0
 
#define DISK_INDEX_LISTHEAD   -1
 
#define DISK_MODEL_VERSION   1 /* V0 was Release 4.0 */
 
#define DISK_MODEL_MAGIC   0x4e6d6f64 /* Nmod */
 
#define DISK_REGION_MAGIC   0x4e726567 /* Nreg */
 
#define DISK_REGION_A_MAGIC   0x4e725f61 /* Nr_a */
 
#define DISK_SHELL_MAGIC   0x4e73686c /* Nshl */
 
#define DISK_SHELL_A_MAGIC   0x4e735f61 /* Ns_a */
 
#define DISK_FACE_MAGIC   0x4e666163 /* Nfac */
 
#define DISK_FACE_G_PLANE_MAGIC   0x4e666770 /* Nfgp */
 
#define DISK_FACE_G_SNURB_MAGIC   0x4e666773 /* Nfgs */
 
#define DISK_FACEUSE_MAGIC   0x4e667520 /* Nfu */
 
#define DISK_LOOP_MAGIC   0x4e6c6f70 /* Nlop */
 
#define DISK_LOOP_G_MAGIC   0x4e6c5f67 /* Nl_g */
 
#define DISK_LOOPUSE_MAGIC   0x4e6c7520 /* Nlu */
 
#define DISK_EDGE_MAGIC   0x4e656467 /* Nedg */
 
#define DISK_EDGE_G_LSEG_MAGIC   0x4e65676c /* Negl */
 
#define DISK_EDGE_G_CNURB_MAGIC   0x4e656763 /* Negc */
 
#define DISK_EDGEUSE_MAGIC   0x4e657520 /* Neu */
 
#define DISK_VERTEX_MAGIC   0x4e767274 /* Nvrt */
 
#define DISK_VERTEX_G_MAGIC   0x4e765f67 /* Nv_g */
 
#define DISK_VERTEXUSE_MAGIC   0x4e767520 /* Nvu */
 
#define DISK_VERTEXUSE_A_PLANE_MAGIC   0x4e767561 /* Nvua */
 
#define DISK_VERTEXUSE_A_CNURB_MAGIC   0x4e766163 /* Nvac */
 
#define DISK_DOUBLE_ARRAY_MAGIC   0x4e666172 /* Narr */
 
#define NMG_KIND_MODEL   0
 
#define NMG_KIND_NMGREGION   1
 
#define NMG_KIND_NMGREGION_A   2
 
#define NMG_KIND_SHELL   3
 
#define NMG_KIND_SHELL_A   4
 
#define NMG_KIND_FACEUSE   5
 
#define NMG_KIND_FACE   6
 
#define NMG_KIND_FACE_G_PLANE   7
 
#define NMG_KIND_FACE_G_SNURB   8
 
#define NMG_KIND_LOOPUSE   9
 
#define NMG_KIND_LOOP   10
 
#define NMG_KIND_LOOP_G   11
 
#define NMG_KIND_EDGEUSE   12
 
#define NMG_KIND_EDGE   13
 
#define NMG_KIND_EDGE_G_LSEG   14
 
#define NMG_KIND_EDGE_G_CNURB   15
 
#define NMG_KIND_VERTEXUSE   16
 
#define NMG_KIND_VERTEXUSE_A_PLANE   17
 
#define NMG_KIND_VERTEXUSE_A_CNURB   18
 
#define NMG_KIND_VERTEX   19
 
#define NMG_KIND_VERTEX_G   20
 
#define NMG_KIND_DOUBLE_ARRAY   25
 
#define NMG_N_KINDS   26
 
#define INDEX(o, i, elem)   *(uint32_t *)(o)->elem = htonl(reindex((void *)((i)->elem), ecnt))
 
#define INDEXL(oo, ii, elem)
 
#define PUTMAGIC(_magic)   *(uint32_t *)d->magic = htonl(_magic)
 
#define INDEX(o, i, ty, elem)   (i)->elem = (struct ty *)ptrs[ntohl(*(uint32_t*)((o)->elem))]
 
#define INDEXL_HD(oo, ii, elem, hd)
 
#define INDEXL_HD2(oo, ii, elem, hd)
 

Typedefs

typedef unsigned char disk_index_t[4]
 

Functions

int rt_nmg_bbox (struct rt_db_internal *ip, point_t *min, point_t *max, const struct bn_tol *tol)
 
int rt_nmg_prep (struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip)
 
void rt_nmg_print (const struct soltab *stp)
 
int rt_nmg_shot (struct soltab *stp, struct xray *rp, struct application *ap, struct seg *seghead)
 
void rt_nmg_norm (struct hit *hitp, struct soltab *stp, struct xray *rp)
 
void rt_nmg_curve (struct curvature *cvp, struct hit *hitp, struct soltab *stp)
 
void rt_nmg_uv (struct application *ap, struct soltab *stp, struct hit *hitp, struct uvcoord *uvp)
 
void rt_nmg_free (struct soltab *stp)
 
int rt_nmg_plot (struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol, const struct rt_view_info *info)
 
int rt_nmg_tess (struct nmgregion **r, struct model *m, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
 
int rt_nmg_magic_to_kind (uint32_t magic)
 
int rt_nmg_export4_fastf (const fastf_t *fp, int count, int pt_type, double scale)
 
fastf_trt_nmg_import4_fastf (const unsigned char *base, struct nmg_exp_counts *ecnt, long int subscript, const matp_t mat, int len, int pt_type)
 
HIDDEN int reindex (void *p, struct nmg_exp_counts *ecnt)
 
void rt_nmg_edisk (void *op, void *ip, struct nmg_exp_counts *ecnt, int idx, double local2mm)
 
int rt_nmg_idisk (void *op, void *ip, struct nmg_exp_counts *ecnt, int idx, uint32_t **ptrs, const fastf_t *mat, const unsigned char *basep)
 
HIDDEN struct model * rt_nmg_ialloc (uint32_t **ptrs, struct nmg_exp_counts *ecnt, int *kind_counts)
 
void rt_nmg_i2alloc (struct nmg_exp_counts *ecnt, unsigned char *cp, int *kind_counts)
 
int rt_nmg_import4_internal (struct rt_db_internal *ip, const struct bu_external *ep, const fastf_t *mat, int rebound, const struct bn_tol *tol)
 
int rt_nmg_export4_internal (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, int compact)
 
int rt_nmg_import4 (struct rt_db_internal *ip, const struct bu_external *ep, const fastf_t *mat, const struct db_i *dbip)
 
int rt_nmg_import5 (struct rt_db_internal *ip, struct bu_external *ep, const mat_t mat, const struct db_i *dbip)
 
int rt_nmg_export4 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
 
int rt_nmg_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
 
int rt_nmg_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local)
 
void rt_nmg_ifree (struct rt_db_internal *ip)
 
int rt_nmg_get (struct bu_vls *logstr, const struct rt_db_internal *intern, const char *attr)
 
int rt_nmg_adjust (struct bu_vls *logstr, struct rt_db_internal *intern, int argc, const char **argv)
 
void rt_nmg_make (const struct rt_functab *ftp, struct rt_db_internal *intern)
 
int rt_nmg_params (struct pc_pc_set *ps, const struct rt_db_internal *ip)
 
void rt_nmg_surf_area (fastf_t *area, const struct rt_db_internal *ip)
 
void rt_nmg_centroid (point_t *cent, const struct rt_db_internal *ip)
 
void rt_nmg_volume (fastf_t *volume, const struct rt_db_internal *ip)
 

Variables

const int rt_nmg_disk_sizes [NMG_N_KINDS]
 
const char rt_nmg_kind_names [NMG_N_KINDS+2][18]
 

Detailed Description

Intersect a ray with an NMG solid.

Definition in file nmg.c.

Macro Definition Documentation

#define NMG_SPEC_START_MAGIC   6014061

Definition at line 47 of file nmg.c.

Referenced by rt_nmg_prep(), and rt_nmg_shot().

#define NMG_SPEC_END_MAGIC   7013061

Definition at line 48 of file nmg.c.

Referenced by rt_nmg_prep(), and rt_nmg_shot().

#define NMG_CK_DISKMAGIC (   _cp,
  _magic 
)
Value:
if (ntohl(*(uint32_t*)_cp) != _magic) { \
bu_log("NMG_CK_DISKMAGIC: magic mis-match, got x%x, s/b x%x, file %s, line %d\n", \
ntohl(*(uint32_t*)_cp), _magic, __FILE__, __LINE__); \
bu_bomb("bad magic\n"); \
}
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
void bu_bomb(const char *str) _BU_ATTR_NORETURN
Definition: bomb.c:91

Definition at line 364 of file nmg.c.

Referenced by rt_nmg_i2alloc(), and rt_nmg_idisk().

#define DISK_INDEX_NULL   0

Definition at line 381 of file nmg.c.

Referenced by rt_nmg_export4_internal(), and rt_nmg_export5().

#define DISK_INDEX_LISTHEAD   -1

Definition at line 382 of file nmg.c.

Referenced by reindex().

#define DISK_MODEL_VERSION   1 /* V0 was Release 4.0 */
#define DISK_MODEL_MAGIC   0x4e6d6f64 /* Nmod */

Definition at line 393 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_REGION_MAGIC   0x4e726567 /* Nreg */

Definition at line 401 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_REGION_A_MAGIC   0x4e725f61 /* Nr_a */

Definition at line 411 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_SHELL_MAGIC   0x4e73686c /* Nshl */

Definition at line 419 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_SHELL_A_MAGIC   0x4e735f61 /* Ns_a */

Definition at line 432 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACE_MAGIC   0x4e666163 /* Nfac */

Definition at line 440 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACE_G_PLANE_MAGIC   0x4e666770 /* Nfgp */

Definition at line 450 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACE_G_SNURB_MAGIC   0x4e666773 /* Nfgs */

Definition at line 458 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACEUSE_MAGIC   0x4e667520 /* Nfu */

Definition at line 475 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_LOOP_MAGIC   0x4e6c6f70 /* Nlop */

Definition at line 488 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_LOOP_G_MAGIC   0x4e6c5f67 /* Nl_g */

Definition at line 496 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_LOOPUSE_MAGIC   0x4e6c7520 /* Nlu */

Definition at line 504 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGE_MAGIC   0x4e656467 /* Nedg */

Definition at line 517 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGE_G_LSEG_MAGIC   0x4e65676c /* Negl */

Definition at line 525 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGE_G_CNURB_MAGIC   0x4e656763 /* Negc */

Definition at line 534 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGEUSE_MAGIC   0x4e657520 /* Neu */

Definition at line 547 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEX_MAGIC   0x4e767274 /* Nvrt */

Definition at line 563 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEX_G_MAGIC   0x4e765f67 /* Nv_g */

Definition at line 571 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEXUSE_MAGIC   0x4e767520 /* Nvu */

Definition at line 578 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEXUSE_A_PLANE_MAGIC   0x4e767561 /* Nvua */

Definition at line 588 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEXUSE_A_CNURB_MAGIC   0x4e766163 /* Nvac */

Definition at line 595 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_DOUBLE_ARRAY_MAGIC   0x4e666172 /* Narr */

Definition at line 602 of file nmg.c.

Referenced by rt_nmg_export4_fastf(), rt_nmg_i2alloc(), and rt_nmg_import4_fastf().

#define NMG_KIND_MODEL   0

Definition at line 614 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_NMGREGION   1

Definition at line 615 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_NMGREGION_A   2
#define NMG_KIND_SHELL   3

Definition at line 617 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_SHELL_A   4
#define NMG_KIND_FACEUSE   5

Definition at line 619 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_FACE   6
#define NMG_KIND_FACE_G_PLANE   7

Definition at line 621 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_FACE_G_SNURB   8
#define NMG_KIND_LOOPUSE   9

Definition at line 623 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_LOOP   10

Definition at line 624 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_LOOP_G   11
#define NMG_KIND_EDGEUSE   12

Definition at line 626 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGE   13

Definition at line 627 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGE_G_LSEG   14

Definition at line 628 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGE_G_CNURB   15
#define NMG_KIND_VERTEXUSE   16

Definition at line 630 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEXUSE_A_PLANE   17

Definition at line 631 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEXUSE_A_CNURB   18

Definition at line 632 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEX   19

Definition at line 633 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEX_G   20

Definition at line 634 of file nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_DOUBLE_ARRAY   25

special, variable sized

Definition at line 638 of file nmg.c.

Referenced by rt_nmg_export4_internal(), rt_nmg_export5(), rt_nmg_i2alloc(), rt_nmg_ialloc(), rt_nmg_import4_fastf(), and rt_nmg_import4_internal().

#define NMG_N_KINDS   26
#define INDEX (   o,
  i,
  elem 
)    *(uint32_t *)(o)->elem = htonl(reindex((void *)((i)->elem), ecnt))

Definition at line 1369 of file nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define INDEXL (   oo,
  ii,
  elem 
)
Value:
{ \
uint32_t _f = reindex((void *)((ii)->elem.forw), ecnt); \
if (_f == DISK_INDEX_NULL) bu_log("Warning rt_nmg_edisk: reindex forw to null?\n"); \
*(uint32_t *)((oo)->elem.forw) = htonl(_f); \
*(uint32_t *)((oo)->elem.back) = htonl(reindex((void *)((ii)->elem.back), ecnt)); }
ustring back
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
#define DISK_INDEX_NULL
Definition: nmg.c:381
if(share_geom)
Definition: nmg_mod.c:3829
HIDDEN int reindex(void *p, struct nmg_exp_counts *ecnt)
Definition: nmg.c:949
ustring null
void rt_nmg_edisk(void *op, void *ip, struct nmg_exp_counts *ecnt, int idx, double local2mm)
Definition: nmg.c:1001

Definition at line 987 of file nmg.c.

Referenced by rt_nmg_edisk().

#define PUTMAGIC (   _magic)    *(uint32_t *)d->magic = htonl(_magic)

Definition at line 992 of file nmg.c.

Referenced by rt_nmg_edisk().

#define INDEX (   o,
  i,
  ty,
  elem 
)    (i)->elem = (struct ty *)ptrs[ntohl(*(uint32_t*)((o)->elem))]

Definition at line 1369 of file nmg.c.

#define INDEXL_HD (   oo,
  ii,
  elem,
  hd 
)
Value:
{ \
int sub; \
if ((sub = ntohl(*(uint32_t*)((oo)->elem.forw))) < 0) \
(ii)->elem.forw = &(hd); \
else (ii)->elem.forw = (struct bu_list *)ptrs[sub]; \
if ((sub = ntohl(*(uint32_t*)((oo)->elem.back))) < 0) \
(ii)->elem.back = &(hd); \
else (ii)->elem.back = (struct bu_list *)ptrs[sub]; }
Definition: list.h:118
if(share_geom)
Definition: nmg_mod.c:3829
else
Definition: nmg_mod.c:3872

Definition at line 1370 of file nmg.c.

Referenced by rt_nmg_idisk().

#define INDEXL_HD2 (   oo,
  ii,
  elem,
  hd 
)
Value:
{ \
int sub; \
struct edgeuse *eu2; \
if ((sub = ntohl(*(uint32_t*)((oo)->elem.forw))) < 0) { \
(ii)->elem.forw = &(hd); \
} else { \
eu2 = (struct edgeuse *)ptrs[sub]; \
NMG_CK_EDGEUSE(eu2); \
(ii)->elem.forw = &eu2->l2; \
} \
if ((sub = ntohl(*(uint32_t*)((oo)->elem.back))) < 0) { \
(ii)->elem.back = &(hd); \
} else { \
eu2 = (struct edgeuse *)ptrs[sub]; \
NMG_CK_EDGEUSE(eu2); \
(ii)->elem.back = &eu2->l2; \
} }
if(share_geom)
Definition: nmg_mod.c:3829
eu2
Definition: nmg_mod.c:3875

Definition at line 1381 of file nmg.c.

Referenced by rt_nmg_idisk().

Typedef Documentation

typedef unsigned char disk_index_t[4]

Definition at line 386 of file nmg.c.

Function Documentation

int rt_nmg_bbox ( struct rt_db_internal ip,
point_t *  min,
point_t *  max,
const struct bn_tol tol 
)

Calculate the bounding box for an N-Manifold Geometry

Definition at line 70 of file nmg.c.

References rt_db_internal::idb_ptr, nmg_model_bb(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_prep ( struct soltab stp,
struct rt_db_internal ip,
struct rt_i rtip 
)

Given a pointer to a ged database record, and a transformation matrix, determine if this is a valid nmg, and if so, precompute various terms of the formula.

returns 0 if nmg is ok and !0 on error in description

implicit return - a struct nmg_specific is created, and its address is stored in stp->st_specific for use by nmg_shot().

Definition at line 93 of file nmg.c.

References BU_GET, rt_functab::ft_bbox, rt_db_internal::idb_ptr, nmg_specific::manifolds, nmg_specific::nmg_emagic, nmg_manifolds(), nmg_specific::nmg_model, nmg_specific::nmg_smagic, NMG_SPEC_END_MAGIC, NMG_SPEC_START_MAGIC, RT_CK_DB_INTERNAL, rt_i::rti_tol, soltab::st_aradius, soltab::st_bradius, soltab::st_center, soltab::st_max, soltab::st_meth, soltab::st_min, and soltab::st_specific.

Here is the call graph for this function:

void rt_nmg_print ( const struct soltab stp)

Definition at line 126 of file nmg.c.

References nmg_pr_m(), and soltab::st_specific.

Here is the call graph for this function:

int rt_nmg_shot ( struct soltab stp,
struct xray rp,
struct application ap,
struct seg seghead 
)

Intersect a ray with a nmg. If an intersection occurs, a struct seg will be acquired and filled in.

Returns - 0 MISS >0 HIT

Definition at line 145 of file nmg.c.

References application::a_rt_i, ray_data::ap, bu_bomb(), bu_calloc(), bu_free(), BU_LIST_INIT, bu_log(), ray_data::classifying_ray, ray_data::hitmiss, if(), ray_data::magic, nmg_specific::manifolds, ray_data::manifolds, rt_g::NMG_debug, nmg_specific::nmg_emagic, nmg_specific::nmg_invdir, nmg_isect_ray_model(), nmg_specific::nmg_model, NMG_RAY_DATA_MAGIC, nmg_ray_segs(), nmg_specific::nmg_smagic, NMG_SPEC_END_MAGIC, NMG_SPEC_START_MAGIC, xray::r_dir, ray_data::rd_hit, ray_data::rd_invdir, ray_data::rd_m, ray_data::rd_miss, ray_data::rp, rt_pr_tol(), RTG, rt_i::rti_tol, ray_data::seghead, soltab::st_specific, ray_data::stp, ray_data::tol, X, Y, Z, and ZERO.

Here is the call graph for this function:

void rt_nmg_norm ( struct hit hitp,
struct soltab stp,
struct xray rp 
)

Given ONE ray distance, return the normal and entry/exit point.

Definition at line 229 of file nmg.c.

References hit::hit_dist, hit::hit_point, xray::r_dir, xray::r_pt, RT_CK_HIT, RT_CK_RAY, and RT_CK_SOLTAB.

void rt_nmg_curve ( struct curvature cvp,
struct hit hitp,
struct soltab stp 
)

Return the curvature of the nmg.

Definition at line 246 of file nmg.c.

References bn_vec_ortho(), curvature::crv_c1, curvature::crv_c2, curvature::crv_pdir, hit::hit_normal, RT_CK_HIT, and RT_CK_SOLTAB.

Here is the call graph for this function:

void rt_nmg_uv ( struct application ap,
struct soltab stp,
struct hit hitp,
struct uvcoord uvp 
)

For a hit on the surface of an nmg, return the (u, v) coordinates of the hit point, 0 <= u, v <= 1.

u = azimuth v = elevation

Definition at line 269 of file nmg.c.

References RT_CK_APPLICATION, RT_CK_HIT, and RT_CK_SOLTAB.

void rt_nmg_free ( struct soltab stp)

Definition at line 279 of file nmg.c.

References BU_PUT, nmg_km(), nmg_specific::nmg_model, and soltab::st_specific.

Here is the call graph for this function:

int rt_nmg_plot ( struct bu_list vhead,
struct rt_db_internal ip,
const struct rt_tess_tol ttol,
const struct bn_tol tol,
const struct rt_view_info info 
)

Definition at line 291 of file nmg.c.

References BU_CK_LIST_HEAD, rt_db_internal::idb_ptr, nmg_m_to_vlist(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

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

XXX This routine "destroys" the internal nmg solid. This means that once you tessellate an NMG solid, your in-memory copy becomes invalid, and you can't do anything else with it until you get a new copy from disk.

Returns - -1 failure 0 OK. *r points to nmgregion that holds this tessellation.

Definition at line 317 of file nmg.c.

References BU_LIST_FIRST, BU_LIST_IS_EMPTY, BU_LIST_NEXT_NOT_HEAD, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, rt_db_internal::idb_ptr, nmg_merge_models(), nmg_merge_regions(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_export4_fastf ( const fastf_t fp,
int  count,
int  pt_type,
double  scale 
)

Format a variable sized array of fastf_t's into external format (IEEE big endian double precision) with a 2 element header.

    +-----------+
    |  magic    |
    +-----------+
    |  count    |
    +-----------+
    |           |
    ~  doubles  ~
    ~    :      ~
    |           |
    +-----------+

Increments the pointer to the next free byte in the external array, and increments the subscript number of the next free array.

Note that this subscript number is consistent with the rest of the NMG external subscript numbering, so that the first disk_double_array subscript will be one larger than the largest disk_vertex_g subscript, and in the external record the array of fastf_t arrays will follow the array of disk_vertex_g structures.

Returns subscript number of this array, in the external form.

Definition at line 807 of file nmg.c.

References bu_cv_htond(), bu_free(), bu_malloc(), DISK_DOUBLE_ARRAY_MAGIC, and ZERO.

Referenced by rt_nmg_edisk().

Here is the call graph for this function:

fastf_t* rt_nmg_import4_fastf ( const unsigned char *  base,
struct nmg_exp_counts ecnt,
long int  subscript,
const matp_t  mat,
int  len,
int  pt_type 
)

Definition at line 859 of file nmg.c.

References bu_bomb(), bu_cv_ntohd(), bu_free(), bu_log(), bu_malloc(), nmg_exp_counts::byte_offset, DISK_DOUBLE_ARRAY_MAGIC, and NMG_KIND_DOUBLE_ARRAY.

Referenced by rt_nmg_idisk().

Here is the call graph for this function:

HIDDEN int reindex ( void *  p,
struct nmg_exp_counts ecnt 
)

Depends on ecnt[0].byte_offset having been set to maxindex.

There are some special values for the disk index returned here: >0 normal structure index. 0 substitute a null pointer when imported. -1 substitute pointer to within-struct list head when imported.

Definition at line 949 of file nmg.c.

References bu_bomb(), bu_identify_magic(), bu_log(), DISK_INDEX_LISTHEAD, nmg_exp_counts::new_subscript, and nmg_index_of_struct().

Referenced by rt_nmg_edisk().

Here is the call graph for this function:

void rt_nmg_edisk ( void *  op,
void *  ip,
struct nmg_exp_counts ecnt,
int  idx,
double  local2mm 
)

Export a given structure from memory to disk format

Scale geometry by 'local2mm'

Definition at line 1001 of file nmg.c.

References disk_vertexuse::a, bu_cv_htond(), bu_log(), disk_edge_g_cnurb::c_size, disk_vertex_g::coord, disk_face_g_snurb::ctl_points, disk_edge_g_cnurb::ctl_points, DISK_EDGE_G_CNURB_MAGIC, DISK_EDGE_G_LSEG_MAGIC, DISK_EDGE_MAGIC, DISK_EDGEUSE_MAGIC, DISK_FACE_G_PLANE_MAGIC, DISK_FACE_G_SNURB_MAGIC, DISK_FACE_MAGIC, DISK_FACEUSE_MAGIC, DISK_LOOP_G_MAGIC, DISK_LOOP_MAGIC, DISK_LOOPUSE_MAGIC, DISK_MODEL_MAGIC, DISK_REGION_A_MAGIC, DISK_REGION_MAGIC, DISK_SHELL_A_MAGIC, DISK_SHELL_MAGIC, DISK_VERTEX_G_MAGIC, DISK_VERTEX_MAGIC, DISK_VERTEXUSE_A_CNURB_MAGIC, DISK_VERTEXUSE_A_PLANE_MAGIC, DISK_VERTEXUSE_MAGIC, disk_loopuse::down_hd, disk_edge_g_lseg::e_dir, e_p, disk_edge_g_lseg::e_pt, disk_shell::eu_hd, disk_edge_g_lseg::eu_hd2, disk_edge_g_cnurb::eu_hd2, eu_p, eumate_p, disk_face_g_plane::f_hd, disk_face_g_snurb::f_hd, disk_faceuse::f_p, disk_face::flip, disk_shell::fu_hd, disk_face::fu_p, disk_faceuse::fumate_p, disk_face::g, disk_edgeuse::g, INDEX, INDEXL, disk_edge::is_real, disk_edge_g_cnurb::k_size, disk_edge_g_cnurb::knots, disk_nmgregion::l, disk_shell::l, disk_face::l, disk_faceuse::l, disk_loopuse::l, disk_edgeuse::l, disk_vertexuse::l, disk_edgeuse::l2, disk_loopuse::l_p, disk_loop::lg_p, lu, disk_shell::lu_hd, disk_faceuse::lu_hd, disk_loop::lu_p, disk_loopuse::lumate_p, disk_nmgregion::m_p, disk_nmgregion_a::max_pt, disk_shell_a::max_pt, disk_loop_g::max_pt, disk_nmgregion_a::min_pt, disk_shell_a::min_pt, disk_loop_g::min_pt, disk_face_g_plane::N, disk_vertexuse_a_plane::N, NMG_CK_LOOPUSE(), NMG_CK_SHELL(), NMG_KIND_EDGE, NMG_KIND_EDGE_G_CNURB, NMG_KIND_EDGE_G_LSEG, NMG_KIND_EDGEUSE, NMG_KIND_FACE, NMG_KIND_FACE_G_PLANE, NMG_KIND_FACE_G_SNURB, NMG_KIND_FACEUSE, NMG_KIND_LOOP, NMG_KIND_LOOP_G, NMG_KIND_LOOPUSE, NMG_KIND_MODEL, NMG_KIND_NMGREGION, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL, NMG_KIND_SHELL_A, NMG_KIND_VERTEX, NMG_KIND_VERTEX_G, NMG_KIND_VERTEXUSE, NMG_KIND_VERTEXUSE_A_CNURB, NMG_KIND_VERTEXUSE_A_PLANE, disk_edge_g_cnurb::order, disk_faceuse::orientation, disk_loopuse::orientation, disk_edgeuse::orientation, disk_vertexuse_a_cnurb::param, nmg_exp_counts::per_struct_index, disk_face_g_snurb::pt_type, disk_edge_g_cnurb::pt_type, PUTMAGIC, disk_model::r_hd, disk_shell::r_p, disk_nmgregion::ra_p, radial_p, reindex(), rt_nmg_export4_fastf(), s, disk_nmgregion::s_hd, disk_faceuse::s_p, disk_shell::sa_p, disk_face_g_snurb::u_knots, disk_face_g_snurb::u_order, disk_face_g_snurb::u_size, disk_loopuse::up, disk_edgeuse::up, disk_vertexuse::up, disk_face_g_snurb::us_size, OSL::Strings::v, disk_face_g_snurb::v_knots, disk_face_g_snurb::v_order, disk_vertexuse::v_p, disk_face_g_snurb::v_size, disk_model::version, disk_vertex::vg_p, disk_face_g_snurb::vs_size, disk_vertex::vu_hd, disk_shell::vu_p, and disk_edgeuse::vu_p.

Referenced by rt_nmg_export4_internal(), and rt_nmg_export5().

Here is the call graph for this function:

int rt_nmg_idisk ( void *  op,
void *  ip,
struct nmg_exp_counts ecnt,
int  idx,
uint32_t **  ptrs,
const fastf_t mat,
const unsigned char *  basep 
)

Import a given structure from disk to memory format.

Transform geometry by given matrix.

Definition at line 1406 of file nmg.c.

References disk_vertexuse::a, bn_rotate_bbox(), bn_rotate_plane(), bu_bomb(), bu_cv_ntohd(), BU_LIST_NULL, bu_log(), disk_edge_g_cnurb::c_size, disk_vertex_g::coord, disk_face_g_snurb::ctl_points, disk_edge_g_cnurb::ctl_points, DISK_EDGE_G_CNURB_MAGIC, DISK_EDGE_G_LSEG_MAGIC, DISK_EDGE_MAGIC, DISK_EDGEUSE_MAGIC, DISK_FACE_G_PLANE_MAGIC, DISK_FACE_G_SNURB_MAGIC, DISK_FACE_MAGIC, DISK_FACEUSE_MAGIC, DISK_LOOP_G_MAGIC, DISK_LOOP_MAGIC, DISK_LOOPUSE_MAGIC, DISK_MODEL_MAGIC, DISK_REGION_A_MAGIC, DISK_REGION_MAGIC, DISK_SHELL_A_MAGIC, DISK_SHELL_MAGIC, DISK_VERTEX_G_MAGIC, DISK_VERTEX_MAGIC, DISK_VERTEXUSE_A_CNURB_MAGIC, DISK_VERTEXUSE_A_PLANE_MAGIC, DISK_VERTEXUSE_MAGIC, disk_loopuse::down_hd, disk_edge_g_lseg::e_dir, e_p, disk_edge_g_lseg::e_pt, disk_shell::eu_hd, disk_edge_g_lseg::eu_hd2, disk_edge_g_cnurb::eu_hd2, eu_p, eumate_p, disk_face_g_plane::f_hd, disk_face_g_snurb::f_hd, disk_faceuse::f_p, disk_face::flip, disk_shell::fu_hd, disk_face::fu_p, disk_faceuse::fumate_p, disk_face::g, disk_edgeuse::g, INDEX, INDEXL_HD, INDEXL_HD2, disk_edge::is_real, disk_edge_g_cnurb::k_size, nmg_exp_counts::kind, disk_edge_g_cnurb::knots, disk_nmgregion::l, disk_shell::l, disk_face::l, disk_faceuse::l, disk_loopuse::l, disk_edgeuse::l, disk_vertexuse::l, disk_edgeuse::l2, disk_loopuse::l_p, disk_loop::lg_p, lu, disk_shell::lu_hd, disk_faceuse::lu_hd, disk_loop::lu_p, disk_loopuse::lumate_p, disk_nmgregion::m_p, disk_model::magic, disk_nmgregion::magic, disk_nmgregion_a::magic, disk_shell::magic, disk_shell_a::magic, disk_face::magic, disk_face_g_plane::magic, disk_face_g_snurb::magic, disk_faceuse::magic, disk_loop::magic, disk_loop_g::magic, disk_loopuse::magic, disk_edge::magic, disk_edge_g_lseg::magic, disk_edge_g_cnurb::magic, disk_edgeuse::magic, disk_vertex::magic, disk_vertex_g::magic, disk_vertexuse::magic, disk_vertexuse_a_plane::magic, disk_vertexuse_a_cnurb::magic, disk_nmgregion_a::max_pt, disk_shell_a::max_pt, disk_loop_g::max_pt, disk_nmgregion_a::min_pt, disk_shell_a::min_pt, disk_loop_g::min_pt, disk_face_g_plane::N, disk_vertexuse_a_plane::N, NMG_CK_DISKMAGIC, NMG_CK_LOOPUSE(), NMG_CK_SHELL(), NMG_KIND_EDGE, NMG_KIND_EDGE_G_CNURB, NMG_KIND_EDGE_G_LSEG, NMG_KIND_EDGEUSE, NMG_KIND_FACE, NMG_KIND_FACE_G_PLANE, NMG_KIND_FACE_G_SNURB, NMG_KIND_FACEUSE, NMG_KIND_LOOP, NMG_KIND_LOOP_G, NMG_KIND_LOOPUSE, NMG_KIND_MODEL, NMG_KIND_NMGREGION, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL, NMG_KIND_SHELL_A, NMG_KIND_VERTEX, NMG_KIND_VERTEX_G, NMG_KIND_VERTEXUSE, NMG_KIND_VERTEXUSE_A_CNURB, NMG_KIND_VERTEXUSE_A_PLANE, disk_edge_g_cnurb::order, disk_faceuse::orientation, disk_loopuse::orientation, disk_edgeuse::orientation, disk_vertexuse_a_cnurb::param, disk_face_g_snurb::pt_type, disk_edge_g_cnurb::pt_type, disk_model::r_hd, disk_shell::r_p, disk_nmgregion::ra_p, radial_p, rt_nmg_import4_fastf(), s, disk_nmgregion::s_hd, disk_faceuse::s_p, disk_shell::sa_p, disk_face_g_snurb::u_knots, disk_face_g_snurb::u_order, disk_face_g_snurb::u_size, disk_loopuse::up, disk_edgeuse::up, disk_vertexuse::up, disk_face_g_snurb::us_size, OSL::Strings::v, disk_face_g_snurb::v_knots, disk_face_g_snurb::v_order, disk_vertexuse::v_p, disk_face_g_snurb::v_size, disk_vertex::vg_p, disk_face_g_snurb::vs_size, disk_vertex::vu_hd, disk_shell::vu_p, and disk_edgeuse::vu_p.

Referenced by rt_nmg_import4_internal().

Here is the call graph for this function:

HIDDEN struct model* rt_nmg_ialloc ( uint32_t **  ptrs,
struct nmg_exp_counts ecnt,
int *  kind_counts 
)
void rt_nmg_i2alloc ( struct nmg_exp_counts ecnt,
unsigned char *  cp,
int *  kind_counts 
)

Find the locations of all the variable-sized fastf_t arrays in the input record. Record that position as a byte offset from the very front of the input record in ecnt[], indexed by subscript number.

No storage is allocated here, that will be done by rt_nmg_import4_fastf() on the fly. A separate call to bu_malloc() will be used, so that nmg_keg(), etc., can kill each array as appropriate.

Definition at line 2034 of file nmg.c.

References nmg_exp_counts::byte_offset, DISK_DOUBLE_ARRAY_MAGIC, nmg_exp_counts::kind, NMG_CK_DISKMAGIC, NMG_KIND_DOUBLE_ARRAY, and NMG_N_KINDS.

Referenced by rt_nmg_import4_internal().

int rt_nmg_import4_internal ( struct rt_db_internal ip,
const struct bu_external ep,
const fastf_t mat,
int  rebound,
const struct bn_tol tol 
)

Import an NMG from the database format to the internal format. Apply modeling transformations as well.

Special subscripts are used in the disk file: -1 indicates a pointer to the rt_list structure which heads a linked list, and is not the first struct element. 0 indicates that a null pointer should be used.

Definition at line 2079 of file nmg.c.

References BN_CK_TOL, bu_calloc(), BU_CK_EXTERNAL, bu_free(), bu_log(), DISK_MODEL_VERSION, bu_external::ext_buf, ID_NMG, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, if(), nmg_exp_counts::kind, nmg_face_bb(), NMG_KIND_DOUBLE_ARRAY, NMG_KIND_FACE, NMG_N_KINDS, nmg_rebound(), OBJ, RT_CK_DB_INTERNAL, rt_nmg_i2alloc(), rt_nmg_ialloc(), and rt_nmg_idisk().

Referenced by rt_nmg_import4().

Here is the call graph for this function:

int rt_nmg_export4_internal ( struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
int  compact 
)

The name is added by the caller, in the usual place.

When the "compact" flag is set, bounding boxes from (at present) nmgregion_a shell_a loop_g are not converted for storage in the database. They should be re-generated at import time.

If the "compact" flag is not set, then the NMG model is saved, verbatim.

The overall layout of the on-disk NMG is like this:

 +---------------------------+
 |  NMG header granule       |
 |    solid name             |
 |    # additional granules  |
 |    format version         |
 |    kind_count[] array     |
 +---------------------------+
 |                           |
 |                           |
 ~     N_count granules      ~
 ~              :            ~
 |              :            |
 |                           |
 +---------------------------+

In the additional granules, all structures of "kind" 0 (model) go first, followed by all structures of kind 1 (nmgregion), etc. As each structure is output, it is assigned a subscript number, starting with #1 for the model structure. All pointers are converted to the matching subscript numbers. An on-disk subscript of zero indicates a corresponding NULL pointer in memory. All integers are converted to network (Big-Endian) byte order. All floating point values are stored in network (Big-Endian IEEE) format.

Definition at line 2218 of file nmg.c.

References bu_calloc(), BU_CK_EXTERNAL, bu_free(), bu_log(), nmg_exp_counts::byte_offset, DISK_INDEX_NULL, DISK_MODEL_VERSION, bu_external::ext_buf, bu_external::ext_nbytes, nmg_exp_counts::first_fastf_relpos, ID_NMG, rt_db_internal::idb_ptr, nmg_exp_counts::kind, memset(), nmg_exp_counts::new_subscript, nmg_index_of_struct(), NMG_KIND_DOUBLE_ARRAY, NMG_KIND_EDGE_G_CNURB, NMG_KIND_FACE_G_SNURB, NMG_KIND_LOOP_G, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL_A, nmg_m_struct_count(), NMG_N_KINDS, nmg_exp_counts::per_struct_index, RT_CK_DB_INTERNAL, rt_nmg_edisk(), and rt_nmg_magic_to_kind().

Referenced by rt_nmg_export4().

Here is the call graph for this function:

int rt_nmg_import4 ( struct rt_db_internal ip,
const struct bu_external ep,
const fastf_t mat,
const struct db_i dbip 
)

Import an NMG from the database format to the internal format. Apply modeling transformations as well.

Definition at line 2398 of file nmg.c.

References BN_TOL_MAGIC, BU_CK_EXTERNAL, bu_log(), bn_tol::dist, bn_tol::dist_sq, bu_external::ext_buf, rt_db_internal::idb_ptr, if(), bn_tol::magic, rt_g::NMG_debug, nmg_vmodel(), bn_tol::para, bn_tol::perp, RT_CK_DBI, RT_G_DEBUG, rt_nmg_import4_internal(), and RTG.

Here is the call graph for this function:

int rt_nmg_import5 ( struct rt_db_internal ip,
struct bu_external ep,
const mat_t  mat,
const struct db_i dbip 
)

Definition at line 2439 of file nmg.c.

References BN_TOL_MAGIC, BU_CK_EXTERNAL, bu_log(), DISK_MODEL_VERSION, bn_tol::dist, bn_tol::dist_sq, bu_external::ext_buf, bn_tol::magic, NMG_N_KINDS, bn_tol::para, bn_tol::perp, RT_CK_DBI, and SIZEOF_NETWORK_LONG.

Here is the call graph for this function:

int rt_nmg_export4 ( struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip 
)

The name is added by the caller, in the usual place.

Definition at line 2536 of file nmg.c.

References ID_NMG, rt_db_internal::idb_ptr, nmg_vmodel(), RT_CK_DB_INTERNAL, RT_CK_DBI, and rt_nmg_export4_internal().

Here is the call graph for this function:

int rt_nmg_describe ( struct bu_vls str,
const struct rt_db_internal ip,
int  verbose,
double  mm2local 
)

Make human-readable formatted presentation of this solid. First line describes type of solid. Additional lines are indented one tab, and give parameter values.

Definition at line 2733 of file nmg.c.

References bu_vls_printf(), and rt_db_internal::idb_ptr.

Here is the call graph for this function:

void rt_nmg_ifree ( struct rt_db_internal ip)

Free the storage associated with the rt_db_internal version of this solid.

Definition at line 2753 of file nmg.c.

References rt_db_internal::idb_ptr, nmg_km(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_get ( struct bu_vls logstr,
const struct rt_db_internal intern,
const char *  attr 
)

Definition at line 2769 of file nmg.c.

References BRLCAD_ERROR, BRLCAD_OK, BU_LIST_FIRST, BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_FOR_BACKWARDS, BU_LIST_NON_EMPTY, bu_ptbl_free(), BU_PTBL_GET, bu_ptbl_init(), BU_PTBL_LEN, bu_ptbl_locate(), BU_STR_EQUAL, bu_vls_printf(), bu_vls_strcat(), bu_vls_strcpy(), rt_db_internal::idb_ptr, lu, nmg_vertex_tabulate(), NMG_VERTEXUSE_MAGIC, s, OSL::Strings::v, and V3ARGS.

Here is the call graph for this function:

int rt_nmg_adjust ( struct bu_vls logstr,
struct rt_db_internal intern,
int  argc,
const char **  argv 
)
void rt_nmg_make ( const struct rt_functab ftp,
struct rt_db_internal intern 
)

Definition at line 3029 of file nmg.c.

References ID_NMG, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, and nmg_mm().

Here is the call graph for this function:

int rt_nmg_params ( struct pc_pc_set ps,
const struct rt_db_internal ip 
)

Definition at line 3042 of file nmg.c.

References RT_CK_DB_INTERNAL.

void rt_nmg_surf_area ( fastf_t area,
const struct rt_db_internal ip 
)

Definition at line 3099 of file nmg.c.

References poly_face::area, bu_calloc(), bu_free(), BU_LIST_FOR, BU_PTBL_LEN, rt_db_internal::idb_ptr, bu_ptbl::l, bu_list::magic, nmg_face_tabulate(), poly_face::pts, and s.

Here is the call graph for this function:

void rt_nmg_centroid ( point_t *  cent,
const struct rt_db_internal ip 
)

Definition at line 3137 of file nmg.c.

References poly_face::area, bn_polygon_centroid(), bu_calloc(), bu_free(), BU_LIST_FIRST, BU_PTBL_LEN, poly_face::cent_pyramid, rt_db_internal::idb_ptr, bu_ptbl::l, bu_list::magic, nmg_face_tabulate(), poly_face::plane_eqn, poly_face::pts, s, and poly_face::vol_pyramid.

Here is the call graph for this function:

void rt_nmg_volume ( fastf_t volume,
const struct rt_db_internal ip 
)

Definition at line 3200 of file nmg.c.

References poly_face::area, bu_calloc(), bu_free(), BU_LIST_FOR, BU_PTBL_LEN, rt_db_internal::idb_ptr, bu_ptbl::l, bu_list::magic, nmg_face_tabulate(), poly_face::plane_eqn, poly_face::pts, and s.

Here is the call graph for this function:

Variable Documentation

const int rt_nmg_disk_sizes[NMG_N_KINDS]
Initial value:
= {
sizeof(struct disk_model),
sizeof(struct disk_nmgregion),
sizeof(struct disk_nmgregion_a),
sizeof(struct disk_shell),
sizeof(struct disk_shell_a),
sizeof(struct disk_faceuse),
sizeof(struct disk_face),
sizeof(struct disk_face_g_plane),
sizeof(struct disk_face_g_snurb),
sizeof(struct disk_loopuse),
sizeof(struct disk_loop),
sizeof(struct disk_loop_g),
sizeof(struct disk_edgeuse),
sizeof(struct disk_edge),
sizeof(struct disk_edge_g_lseg),
sizeof(struct disk_edge_g_cnurb),
sizeof(struct disk_vertexuse),
sizeof(struct disk_vertexuse_a_plane),
sizeof(struct disk_vertexuse_a_cnurb),
sizeof(struct disk_vertex),
sizeof(struct disk_vertex_g),
0,
0,
0,
0,
0
}
Definition: nmg.c:489
Definition: nmg.c:441
Definition: nmg.c:518

Definition at line 646 of file nmg.c.

const char rt_nmg_kind_names[NMG_N_KINDS+2][18]
Initial value:
= {
"model",
"nmgregion",
"nmgregion_a",
"shell",
"shell_a",
"faceuse",
"face",
"face_g_plane",
"face_g_snurb",
"loopuse",
"loop",
"loop_g",
"edgeuse",
"edge",
"edge_g_lseg",
"edge_g_cnurb",
"vertexuse",
"vertexuse_a_plane",
"vertexuse_a_cnurb",
"vertex",
"vertex_g",
"k21",
"k22",
"k23",
"k24",
"double_array",
"k26-OFF_END",
"k27-OFF_END"
}

Definition at line 674 of file nmg.c.