BRL-CAD
Arbitrary Polyhedron (4 to 8 defining points)
Collaboration diagram for Arbitrary Polyhedron (4 to 8 defining points):

Files

file  arb_edit.h
 Editing operations for arb primitives.
 
file  arb8.h
 

Data Structures

struct  rt_arb_internal
 

Macros

#define rt_arb_faces
 
#define earb8_edit_array
 
#define arb8_edge_vertex_mapping
 
#define earb7_edit_array
 
#define arb7_edge_vertex_mapping
 
#define earb6_edit_array
 
#define arb6_edge_vertex_mapping
 
#define earb5_edit_array
 
#define arb5_edge_vertex_mapping
 
#define earb4_edit_array
 
#define arb4_edge_vertex_mapping
 
#define RT_ARB_CK_MAGIC(_p)   BU_CKMAG(_p, RT_ARB_INTERNAL_MAGIC, "rt_arb_internal")
 

Functions

void ext4to6 (int pt1, int pt2, int pt3, struct rt_arb_internal *arb, fastf_t peqn[7][4])
 
int mv_edge (struct rt_arb_internal *arb, const vect_t thru, const int bp1, const int bp2, const int end1, const int end2, const vect_t dir, const struct bn_tol *tol, fastf_t peqn[7][4])
 
int arb_extrude (struct rt_arb_internal *arb, int face, fastf_t dist, const struct bn_tol *tol, fastf_t peqn[7][4])
 
int arb_permute (struct rt_arb_internal *arb, const char *encoded_permutation, const struct bn_tol *tol)
 
int arb_mirror_face_axis (struct rt_arb_internal *arb, fastf_t peqn[7][4], const int face, const char *axis, const struct bn_tol *tol)
 
int arb_edit (struct rt_arb_internal *arb, fastf_t peqn[7][4], int edge, int newedge, vect_t pos_model, const struct bn_tol *tol)
 
int rt_arb_get_cgtype (int *cgtype, struct rt_arb_internal *arb, const struct bn_tol *tol, int *uvec, int *svec)
 
int rt_arb_std_type (const struct rt_db_internal *ip, const struct bn_tol *tol)
 
void rt_arb_centroid (point_t *cent, const struct rt_db_internal *ip)
 
int rt_arb_calc_points (struct rt_arb_internal *arb, int cgtype, const plane_t planes[6], const struct bn_tol *tol)
 
int rt_arb_check_points (struct rt_arb_internal *arb, int cgtype, const struct bn_tol *tol)
 
int rt_arb_3face_intersect (point_t point, const plane_t planes[6], int type, int loc)
 
int rt_arb_calc_planes (struct bu_vls *error_msg_ret, struct rt_arb_internal *arb, int type, plane_t planes[6], const struct bn_tol *tol)
 
int rt_arb_move_edge (struct bu_vls *error_msg_ret, struct rt_arb_internal *arb, vect_t thru, int bp1, int bp2, int end1, int end2, const vect_t dir, plane_t planes[6], const struct bn_tol *tol)
 
int rt_arb_edit (struct bu_vls *error_msg_ret, struct rt_arb_internal *arb, int arb_type, int edit_type, vect_t pos_model, plane_t planes[6], const struct bn_tol *tol)
 
int rt_arb_find_e_nearest_pt2 (int *edge, int *vert1, int *vert2, const struct rt_db_internal *ip, const point_t pt2, const mat_t mat, fastf_t ptol)
 

Detailed Description

Macro Definition Documentation

◆ rt_arb_faces

#define rt_arb_faces
Value:
{ \
{0,1,2,3, 0,1,4,5, 1,2,4,5, 0,2,4,5, -1,-1,-1,-1, -1,-1,-1,-1}, \
{0,1,2,3, 4,0,1,5, 4,1,2,5, 4,2,3,5, 4,3,0,5, -1,-1,-1,-1}, \
{0,1,2,3, 1,2,6,4, 0,4,6,3, 4,1,0,5, 6,2,3,7, -1,-1,-1,-1}, \
{0,1,2,3, 4,5,6,7, 0,3,4,7, 1,2,6,5, 0,1,5,4, 3,2,6,4}, \
{0,1,2,3, 4,5,6,7, 0,4,7,3, 1,2,6,5, 0,1,5,4, 3,2,6,7}, \
}

face definitions for each arb type

row 1: ARB4 row 2: ARB5 row 3: ARB6 row 4: ARB7 row 5: ARB8

To use this array, define it as follows:

const int arb_faces[5][24] = rt_arb_faces;

Definition at line 54 of file arb_edit.h.

◆ earb8_edit_array

#define earb8_edit_array
Value:
{ \
{0,1, 2,3, 0,0,1,2, 4,0,1,4, -1,0,0,0, 3,5}, \
{1,2, 4,5, 0,0,1,2, 3,1,2,5, -1,0,0,0, 3,6}, \
{2,3, 3,2, 0,0,2,3, 5,2,3,6, -1,0,0,0, 1,7}, \
{0,3, 4,5, 0,0,1,3, 2,0,3,4, -1,0,0,0, 2,7}, \
{0,4, 0,1, 2,0,4,3, 4,0,1,4, -1,0,0,0, 7,5}, \
{1,5, 0,1, 4,0,1,5, 3,1,2,5, -1,0,0,0, 4,6}, \
{4,5, 2,3, 4,0,5,4, 1,4,5,6, -1,0,0,0, 1,7}, \
{5,6, 4,5, 3,1,5,6, 1,4,5,6, -1,0,0,0, 2,7}, \
{6,7, 3,2, 5,2,7,6, 1,4,6,7, -1,0,0,0, 3,4}, \
{4,7, 4,5, 2,0,7,4, 1,4,5,7, -1,0,0,0, 3,6}, \
{2,6, 0,1, 3,1,2,6, 5,2,3,6, -1,0,0,0, 5,7}, \
{3,7, 0,1, 2,0,3,7, 5,2,3,7, -1,0,0,0, 4,6}, \
}

edit array for arb8's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 14 row 5: edge 15 row 6: edge 26 row 7: edge 56 row 8: edge 67 row 9: edge 78 row 10: edge 58 row 11: edge 37 row 12: edge 48

To use this array, define it as follows:

const short earb8[12][18] = earb8_edit_array;

Definition at line 97 of file arb_edit.h.

◆ arb8_edge_vertex_mapping

#define arb8_edge_vertex_mapping
Value:
{ \
{0,1}, \
{1,2}, \
{2,3}, \
{0,3}, \
{0,4}, \
{1,5}, \
{4,5}, \
{5,6}, \
{6,7}, \
{4,7}, \
{2,6}, \
{3,7}, \
}

edge/vertex mapping for arb8's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 14 row 5: edge 15 row 6: edge 26 row 7: edge 56 row 8: edge 67 row 9: edge 78 row 10: edge 58 row 11: edge 37 row 12: edge 48

To use this mapping , define it as follows: const short arb8_evm[12][2] = arb8_edge_vertex_mapping;

Definition at line 131 of file arb_edit.h.

◆ earb7_edit_array

#define earb7_edit_array
Value:
{ \
{0,1, 2,3, 0,0,1,2, 4,0,1,4, -1,0,0,0, 3,5}, \
{1,2, 4,5, 0,0,1,2, 3,1,2,5, -1,0,0,0, 3,6}, \
{2,3, 3,2, 0,0,2,3, 5,2,3,6, -1,0,0,0, 1,4}, \
{0,3, 4,5, 0,0,1,3, 2,0,3,4, -1,0,0,0, 2,-1}, \
{0,4, 0,5, 4,0,5,4, 2,0,3,4, 1,4,5,6, 1,-1}, \
{1,5, 0,1, 4,0,1,5, 3,1,2,5, -1,0,0,0, 4,6}, \
{4,5, 5,3, 2,0,3,4, 4,0,5,4, 1,4,5,6, 1,-1}, \
{5,6, 4,5, 3,1,6,5, 1,4,5,6, -1,0,0,0, 2, -1}, \
{2,6, 0,1, 5,2,3,6, 3,1,2,6, -1,0,0,0, 4,5}, \
{4,6, 4,3, 2,0,3,4, 5,3,4,6, 1,4,5,6, 2,-1}, \
{3,4, 0,1, 4,0,1,4, 2,0,3,4, 5,2,3,4, 5,6}, \
{-1,-1, -1,-1, 5,2,3,4, 4,0,1,4, 8,2,1,-1, 6,5}, \
}

edit array for arb7's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 41 row 5: edge 15 row 6: edge 26 row 7: edge 56 row 8: edge 67 row 9: edge 37 row 10: edge 57 row 11: edge 45 row 12: point 5

To use this array, define it as follows:

const short earb7[12][18] = earb7_edit_array;

Definition at line 166 of file arb_edit.h.

◆ arb7_edge_vertex_mapping

#define arb7_edge_vertex_mapping
Value:
{ \
{0,1}, \
{1,2}, \
{2,3}, \
{0,3}, \
{0,4}, \
{1,5}, \
{4,5}, \
{5,6}, \
{2,6}, \
{4,6}, \
{3,4}, \
{4,4}, \
}

edge/vertex mapping for arb7's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 41 row 5: edge 15 row 6: edge 26 row 7: edge 56 row 8: edge 67 row 9: edge 37 row 10: edge 57 row 11: edge 45 row 12: point 5

To use this mapping , define it as follows: const short arb7_evm[12][2] = arb7_edge_vertex_mapping;

Definition at line 200 of file arb_edit.h.

◆ earb6_edit_array

#define earb6_edit_array
Value:
{ \
{0,1, 2,1, 3,0,1,4, 0,0,1,2, -1,0,0,0, 3,-1}, \
{1,2, 3,4, 1,1,2,5, 0,0,1,2, -1,0,0,0, 3,4}, \
{2,3, 1,2, 4,2,3,5, 0,0,2,3, -1,0,0,0, 1,-1}, \
{0,3, 3,4, 2,0,3,5, 0,0,1,3, -1,0,0,0, 4,2}, \
{0,4, 0,1, 3,0,1,4, 2,0,3,4, -1,0,0,0, 6,-1}, \
{1,4, 0,2, 3,0,1,4, 1,1,2,4, -1,0,0,0, 6,-1}, \
{2,6, 0,2, 4,6,2,3, 1,1,2,6, -1,0,0,0, 4,-1}, \
{3,6, 0,1, 4,6,2,3, 2,0,3,6, -1,0,0,0, 4,-1}, \
{-1,-1, -1,-1, 2,0,3,4, 1,1,2,4, 3,0,1,4, 6,-1}, \
{-1,-1, -1,-1, 2,0,3,6, 1,1,2,6, 4,2,3,6, 4,-1}, \
}

edit array for arb6's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 14 row 5: edge 15 row 6: edge 25 row 7: edge 36 row 8: edge 46 row 9: point 5 row 10: point 6

To use this array, define it as follows:

const short earb6[10][18] = earb6_edit_array;

Definition at line 233 of file arb_edit.h.

◆ arb6_edge_vertex_mapping

#define arb6_edge_vertex_mapping
Value:
{ \
{0,1}, \
{1,2}, \
{2,3}, \
{0,3}, \
{0,4}, \
{1,4}, \
{2,5}, \
{3,5}, \
{4,4}, \
{7,7}, \
}

edge/vertex mapping for arb6's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 14 row 5: edge 15 row 6: edge 25 row 7: edge 36 row 8: edge 46 row 9: point 5 row 10: point 6

To use this mapping , define it as follows:

const short arb6_evm[10][2] = arb6_edge_vertex_mapping;

Definition at line 264 of file arb_edit.h.

◆ earb5_edit_array

#define earb5_edit_array
Value:
{ \
{0,1, 4,2, 0,0,1,2, 1,0,1,4, -1,0,0,0, 3,-1}, \
{1,2, 1,3, 0,0,1,2, 2,1,2,4, -1,0,0,0, 3,-1}, \
{2,3, 2,4, 0,0,2,3, 3,2,3,4, -1,0,0,0, 1,-1}, \
{0,3, 1,3, 0,0,1,3, 4,0,3,4, -1,0,0,0, 2,-1}, \
{0,4, 0,2, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{1,4, 0,3, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{2,4, 0,4, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{3,4, 0,1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{-1,-1, -1,-1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
}

edit array for arb5's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 14 row 5: edge 15 row 6: edge 25 row 7: edge 35 row 8: edge 45 row 9: point 5

To use this array, define it as follows:

const short earb5[9][18] = earb5_edit_array;

Definition at line 294 of file arb_edit.h.

◆ arb5_edge_vertex_mapping

#define arb5_edge_vertex_mapping
Value:
{ \
{0,1}, \
{1,2}, \
{2,3}, \
{0,3}, \
{0,4}, \
{1,4}, \
{2,4}, \
{3,4}, \
{4,4}, \
}

edge/vertex mapping for arb5's

row 1: edge 12 row 2: edge 23 row 3: edge 34 row 4: edge 14 row 5: edge 15 row 6: edge 25 row 7: edge 35 row 8: edge 45 row 9: point 5

To use this mapping , define it as follows:

const short arb5_evm[9][2] = arb5_edge_vertex_mapping;

Definition at line 323 of file arb_edit.h.

◆ earb4_edit_array

#define earb4_edit_array
Value:
{ \
{-1,-1, -1,-1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{-1,-1, -1,-1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{-1,-1, -1,-1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{-1,-1, -1,-1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
{-1,-1, -1,-1, 9,0,0,0, 9,0,0,0, 9,0,0,0, -1,-1}, \
}

edit array for arb4's

row 1: point 1 row 2: point 2 row 3: point 3 row 4: dummy row 5: point 4

To use this array, define it as follows:

const short earb4[5][18] = earb4_edit_array;

Definition at line 348 of file arb_edit.h.

◆ arb4_edge_vertex_mapping

#define arb4_edge_vertex_mapping
Value:
{ \
{0,0}, \
{1,1}, \
{2,2}, \
{3,3}, \
{4,4}, \
}

edge/vertex mapping for arb4's

row 1: point 1 row 2: point 2 row 3: point 3 row 4: dummy row 5: point 4

To use this mapping , define it as follows:

const short arb4_evm[5][2] = arb4_edge_vertex_mapping;

Definition at line 369 of file arb_edit.h.

◆ RT_ARB_CK_MAGIC

#define RT_ARB_CK_MAGIC (   _p)    BU_CKMAG(_p, RT_ARB_INTERNAL_MAGIC, "rt_arb_internal")

Definition at line 195 of file geom.h.

Function Documentation

◆ ext4to6()

void ext4to6 ( int  pt1,
int  pt2,
int  pt3,
struct rt_arb_internal arb,
fastf_t  peqn[7][4] 
)

EXT4TO6(): extrudes face pt1 pt2 pt3 of an ARB4 "distance" to produce ARB6

◆ mv_edge()

int mv_edge ( struct rt_arb_internal arb,
const vect_t  thru,
const int  bp1,
const int  bp2,
const int  end1,
const int  end2,
const vect_t  dir,
const struct bn_tol tol,
fastf_t  peqn[7][4] 
)

◆ arb_extrude()

int arb_extrude ( struct rt_arb_internal arb,
int  face,
fastf_t  dist,
const struct bn_tol tol,
fastf_t  peqn[7][4] 
)

◆ arb_permute()

int arb_permute ( struct rt_arb_internal arb,
const char *  encoded_permutation,
const struct bn_tol tol 
)

◆ arb_mirror_face_axis()

int arb_mirror_face_axis ( struct rt_arb_internal arb,
fastf_t  peqn[7][4],
const int  face,
const char *  axis,
const struct bn_tol tol 
)

◆ arb_edit()

int arb_edit ( struct rt_arb_internal arb,
fastf_t  peqn[7][4],
int  edge,
int  newedge,
vect_t  pos_model,
const struct bn_tol tol 
)

◆ rt_arb_get_cgtype()

int rt_arb_get_cgtype ( int *  cgtype,
struct rt_arb_internal arb,
const struct bn_tol tol,
int *  uvec,
int *  svec 
)

◆ rt_arb_std_type()

int rt_arb_std_type ( const struct rt_db_internal ip,
const struct bn_tol tol 
)

◆ rt_arb_centroid()

void rt_arb_centroid ( point_t cent,
const struct rt_db_internal ip 
)

◆ rt_arb_calc_points()

int rt_arb_calc_points ( struct rt_arb_internal arb,
int  cgtype,
const plane_t  planes[6],
const struct bn_tol tol 
)

◆ rt_arb_check_points()

int rt_arb_check_points ( struct rt_arb_internal arb,
int  cgtype,
const struct bn_tol tol 
)

◆ rt_arb_3face_intersect()

int rt_arb_3face_intersect ( point_t  point,
const plane_t  planes[6],
int  type,
int  loc 
)

◆ rt_arb_calc_planes()

int rt_arb_calc_planes ( struct bu_vls error_msg_ret,
struct rt_arb_internal arb,
int  type,
plane_t  planes[6],
const struct bn_tol tol 
)

◆ rt_arb_move_edge()

int rt_arb_move_edge ( struct bu_vls error_msg_ret,
struct rt_arb_internal arb,
vect_t  thru,
int  bp1,
int  bp2,
int  end1,
int  end2,
const vect_t  dir,
plane_t  planes[6],
const struct bn_tol tol 
)

◆ rt_arb_edit()

int rt_arb_edit ( struct bu_vls error_msg_ret,
struct rt_arb_internal arb,
int  arb_type,
int  edit_type,
vect_t  pos_model,
plane_t  planes[6],
const struct bn_tol tol 
)

◆ rt_arb_find_e_nearest_pt2()

int rt_arb_find_e_nearest_pt2 ( int *  edge,
int *  vert1,
int *  vert2,
const struct rt_db_internal ip,
const point_t  pt2,
const mat_t  mat,
fastf_t  ptol 
)