BRL-CAD
Arb_edit

Files

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

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
 

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)
 

Detailed Description

Macro Definition Documentation

#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 65 of file arb_edit.h.

Referenced by analyze_arb8(), arb_edit(), rt_arb_calc_planes(), and rt_arb_edit().

#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 108 of file arb_edit.h.

Referenced by arb_edit(), and rt_arb_edit().

#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 142 of file arb_edit.h.

Referenced by ged_move_arb_edge(), rt_arb_check_points(), and rt_arb_get_edge_list().

#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 177 of file arb_edit.h.

Referenced by arb_edit(), and rt_arb_edit().

#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 211 of file arb_edit.h.

Referenced by ged_move_arb_edge(), rt_arb_check_points(), and rt_arb_get_edge_list().

#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 244 of file arb_edit.h.

Referenced by arb_edit(), and rt_arb_edit().

#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 275 of file arb_edit.h.

Referenced by ged_move_arb_edge().

#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 305 of file arb_edit.h.

Referenced by arb_edit(), and rt_arb_edit().

#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 334 of file arb_edit.h.

Referenced by ged_move_arb_edge(), rt_arb_check_points(), and rt_arb_get_edge_list().

#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 359 of file arb_edit.h.

Referenced by arb_edit(), and rt_arb_edit().

#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 380 of file arb_edit.h.

Referenced by ged_move_arb_edge(), and rt_arb_get_edge_list().

Function Documentation

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

Definition at line 39 of file arb_edit.c.

Referenced by arb_extrude().

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] 
)

Definition at line 61 of file arb_edit.c.

References bn_isect_line3_plane().

Referenced by arb_edit().

Here is the call graph for this function:

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

Definition at line 83 of file arb_edit.c.

References bn_mk_plane_3pts(), bu_vls_free(), BU_VLS_INIT_ZERO, ext4to6(), rt_arb_calc_planes(), and rt_arb_get_cgtype().

Here is the call graph for this function:

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

Definition at line 242 of file arb_edit.c.

References ARB_VERT_LOC, bu_strncmp(), rt_arb_get_cgtype(), and VSETALL.

Here is the call graph for this function:

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 
)

Definition at line 424 of file arb_edit.c.

References BU_STR_EQUAL, bu_vls_free(), BU_VLS_INIT_ZERO, rt_arb_calc_planes(), and rt_arb_get_cgtype().

Referenced by edarb_mirface().

Here is the call graph for this function:

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 
)

Definition at line 568 of file arb_edit.c.

References bn_mk_plane_3pts(), bu_vls_free(), BU_VLS_INIT_ZERO, earb4_edit_array, earb5_edit_array, earb6_edit_array, earb7_edit_array, earb8_edit_array, mv_edge(), rt_arb_3face_intersect(), rt_arb_calc_planes(), rt_arb_faces, rt_arb_get_cgtype(), and ZERO.

Here is the call graph for this function: