#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "machine.h"
#include "vmath.h"
#include "nmg.h"
#include "raytrace.h"
#include "plot3.h"
Include dependency graph for nmg_tri.c:
Go to the source code of this file.
Data Structures | |
struct | pt2d |
struct | trap |
Defines | |
#define | TOL_2D 1.0e-10 |
#define | P_GT_V(_p, _v) (((_p)->coord[Y] - (_v)->coord[Y]) > TOL_2D || (NEAR_ZERO((_p)->coord[Y] - (_v)->coord[Y], TOL_2D) && (_p)->coord[X] < (_v)->coord[X])) |
#define | P_LT_V(_p, _v) (((_p)->coord[Y] - (_v)->coord[Y]) < (-TOL_2D) || (NEAR_ZERO((_p)->coord[Y] - (_v)->coord[Y], TOL_2D) && (_p)->coord[X] > (_v)->coord[X])) |
#define | P_GE_V(_p, _v) (((_p)->coord[Y] - (_v)->coord[Y]) > TOL_2D || (NEAR_ZERO((_p)->coord[Y] - (_v)->coord[Y], TOL_2D) && (_p)->coord[X] <= (_v)->coord[X])) |
#define | P_LE_V(_p, _v) (((_p)->coord[Y] - (_v)->coord[Y]) < (-TOL_2D) || (NEAR_ZERO((_p)->coord[Y] - (_v)->coord[Y], TOL_2D) && (_p)->coord[X] >= (_v)->coord[X])) |
#define | NMG_PT2D_MAGIC 0x2d2d2d2d |
#define | NMG_TRAP_MAGIC 0x1ab1ab |
#define | NMG_CK_PT2D(_p) NMG_CKMAG(_p, NMG_PT2D_MAGIC, "pt2d") |
#define | NMG_CK_TRAP(_p) |
#define | NMG_TBL2D_MAGIC 0x3e3e3e3e |
#define | NMG_CK_TBL2D(_p) NMG_CKMAG(_p, NMG_TBL2D_MAGIC, "tbl2d") |
#define | PT2D_NEXT(tbl, pt) pt2d_pn(tbl, pt, 1) |
#define | PT2D_PREV(tbl, pt) pt2d_pn(tbl, pt, -1) |
#define | POLY_SIDE 1 |
#define | HOLE_START 2 |
#define | POLY_START 3 |
#define | HOLE_END 4 |
#define | POLY_END 5 |
#define | HOLE_POINT 6 |
#define | POLY_POINT 7 |
Functions | |
int | PvsV (struct trap *p, struct trap *v) |
bu_list * | nmg_flatten_face (struct faceuse *fu, fastf_t *TformMat) |
edgeuse * | pick_eu (struct edgeuse *eu_p, struct faceuse *fu, fastf_t *dir, int find_max) |
void | nmg_find_first_last_use_of_v_in_fu (struct vertex *v, struct vertexuse **first_vu, struct vertexuse **last_vu, fastf_t *dir, struct faceuse *fu, const struct bn_tol *tol) |
void | nmg_triangulate_fu (struct faceuse *fu, const struct bn_tol *tol) |
void | nmg_triangulate_shell (struct shell *s, const struct bn_tol *tol) |
void | nmg_triangulate_model (struct model *m, const struct bn_tol *tol) |
Author - Lee A. Butler
Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5068 USA
Definition in file nmg_tri.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: {NMG_CKMAG(_p, NMG_TRAP_MAGIC, "trap");\ if ( ! BU_LIST_PREV(bu_list, &(_p)->l) ) {\ bu_log("%s %d bad prev pointer of trapezoid 0x%08x\n",\ __FILE__, __LINE__, &(_p)->l);\ rt_bomb("NMG_CK_TRAP: aborting");\ } else if (! BU_LIST_NEXT(bu_list, &(_p)->l) ) {\ bu_log("%s %d bad next pointer of trapezoid 0x%08x\n",\ __FILE__, __LINE__, &(_p)->l);\ rt_bomb("NMG_CL_TRAP: aborting");\ }} Definition at line 67 of file nmg_tri.c. Referenced by PvsV(). |
|
Definition at line 78 of file nmg_tri.c. Referenced by nmg_flatten_face(). |
|
|
|
|
|
|
|
|
|
Definition at line 531 of file nmg_tri.c. Referenced by nmg_triangulate_fu(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 108 of file nmg_tri.c. References pt2d::coord, NMG_CK_TRAP, trap::top, X, and Y. |
|
N M G _ F L A T T E N _ F A C E Create the 2D coordinate table for the vertexuses of a face. --------- ----------------------------------- |pt2d --+-----> | struct pt2d.{magic,coord[3]} | --------- ----------------------------------- | struct pt2d.{magic,coord[3]} | ----------------------------------- | struct pt2d.{magic,coord[3]} | ----------------------------------- When the caller is done, nmg_free_2d_map() should be called to dispose of the map Definition at line 432 of file nmg_tri.c. References bn_mat_fromto(), bn_mat_print(), bu_calloc(), BU_LIST_FIRST, BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_INIT, BU_LIST_MAGIC_SET, bu_log(), vertex_g::coord, DEBUG_TRI, loopuse::down_hd, edgeuse::eumate_p, faceuse::lu_hd, NMG_CK_FACEUSE, NMG_EDGEUSE_MAGIC, NMG_GET_FU_NORMAL, NMG_TBL2D_MAGIC, NMG_VERTEXUSE_MAGIC, loopuse::orientation, OT_BOOLPLACE, OT_NONE, OT_OPPOSITE, OT_SAME, OT_UNSPEC, rt_bomb(), V3ARGS, vertexuse::v_p, vertex::vg_p, and edgeuse::vu_p. Referenced by nmg_triangulate_fu(). Here is the call graph for this function: ![]() |
|
Support routine for nmg_find_first_last_use_of_v_in_fu Given and edgeuse and a faceuse, pick the use of the edge in the faceuse whose left vector has the largest/smallest dot product with the given direction vector. The parameter "find_max" determines whether we return the edgeuse with the largest (find_max != 0) or the smallest (find_max == 0) left-dot-product. Definition at line 1311 of file nmg_tri.c. References BU_LIST_PNEXT_CIRC, bu_log(), vertex_g::coord, edgeuse::eumate_p, nmg_find_eu_leftvec(), nmg_find_fu_of_eu(), NULL, edgeuse::radial_p, rt_bomb(), V3ARGS, vertexuse::v_p, VDOT, vertex::vg_p, VSUB2, edgeuse::vu_p, and VUNITIZE. Referenced by nmg_find_first_last_use_of_v_in_fu(). Here is the call graph for this function: ![]() |
|
Given a pointer to a vertexuse in a face and a ray, find the "first" and "last" uses of the vertex along the ray in the face. Consider the diagram below where 4 OT_SAME loopuses meet at a single vertex. The ray enters from the upper left and proceeds to the lower right. The ray encounters vertexuse (represented by "o" below) number 1 first and vertexuse 3 last. edge A | \ ^|| \ ||| 1||V2 ------->o|o-------> edge D --------------.-------------edge B <-------o|o<------ 4^||3 ||| \ ||| \ ||V \| | - edge C The primary purpose of this routine is to find the vertexuses that should be the parameters to nmg_cut_loop() and nmg_join_loop(). Definition at line 1419 of file nmg_tri.c. References BU_LIST_PNEXT_CIRC, BU_LIST_PPREV_CIRC, bu_log(), vertex_g::coord, vertexuse::eu_p, edgeuse::eumate_p, NMG_CK_EDGEUSE, NMG_CK_FACEUSE, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NULL, pick_eu(), rt_bomb(), vertexuse::up, V3ARGS, vertexuse::v_p, vertex::vg_p, edgeuse::vu_p, and VUNITIZE. Here is the call graph for this function: ![]() |