BRL-CAD
Loading...
Searching...
No Matches
Arbitrary Polyhedron (4 to 8 defining points)
Collaboration diagram for Arbitrary Polyhedron (4 to 8 defining points):

Files

file  arb8.h
 Editing operations for arb primitives.
 

Data Structures

struct  rt_arb_internal
 
struct  rt_arb8_edit
 

Macros

#define RT_ARB_CK_MAGIC(_p)   BU_CKMAG(_p, RT_ARB_INTERNAL_MAGIC, "rt_arb_internal")
 
#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)
 
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)
 
int rt_arb_f_eqn (struct rt_edit *s, int argc, const char **argv)
 
int rt_arb_edgedir (struct rt_edit *s, int argc, const char **argv)
 

Variables

const short int rt_arb_vertices [5][24]
 

Detailed Description

Macro Definition Documentation

◆ 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.

◆ 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}, \
}

The storage for the "specific" ARB types is :

ARB4 0 1 2 0 3 3 3 3 ARB5 0 1 2 3 4 4 4 4 ARB6 0 1 2 3 4 4 5 5 ARB7 0 1 2 3 4 5 6 4 ARB8 0 1 2 3 4 5 6 7 Another summary of how the vertices of ARBs are stored:

Vertices: 1 2 3 4 5 6 7 8 Location-------------------------------------------------------------— ARB8 0 1 2 3 4 5 6 7 ARB7 0 1 2 3 4, 7 5 6 ARB6 0 1 2 3 4, 5 6, 7 ARB5 0 1 2 3 4, 5, 6, 7 ARB4 0, 3 1 2 4, 5, 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 85 of file arb8.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 128 of file arb8.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 162 of file arb8.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 197 of file arb8.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 231 of file arb8.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 264 of file arb8.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 295 of file arb8.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 325 of file arb8.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 354 of file arb8.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 379 of file arb8.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 400 of file arb8.h.

Function Documentation

◆ ext4to6()

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

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

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

◆ arb_permute()

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

◆ 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 
)
extern

◆ 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 
)
extern

◆ 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 
)
extern

determines COMGEOM arb types from GED general arbs

Inputs -

Returns number of distinct edge vectors (number of entries in uvec array)

Implicit returns - *cgtype - Comgeom type (number range 4..8; ARB4 .. ARB8). uvec[8] - indices of unique vertices (return value is the number of valid entries) svec[11] - Entries [0] and [1] are special (they are the counts of duplicates) entries 2-10 are 2 lists of duplicate vertices entry[0] gives length of first list (starts at entry[2]) entry[1] gives length of second list (starts at entry[2+entry[0]])

◆ rt_arb_std_type()

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

Given an ARB in internal form, return its specific ARB type.

Set tol.dist = 0.0001 to obtain past behavior.

Returns - 0 Error in input ARB 4 ARB4 5 ARB5 6 ARB6 7 ARB7 8 ARB8

Implicit return - rt_arb_internal pt[] array reorganized into GIFT "standard" order.

◆ rt_arb_centroid()

void rt_arb_centroid ( point_t cent,
const struct rt_db_internal ip 
)
extern

Find the center point for the arb in the rt_db_internal structure, and return it as a point_t.

◆ 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 
)
extern

Takes the planes[] array and intersects the planes to find the vertices of a GENARB8. The vertices are stored into arb->pt[]. This is an analog of rt_arb_calc_planes().

◆ rt_arb_check_points()

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

◆ rt_arb_3face_intersect()

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

Finds the intersection point of three faces of an ARB.

Returns - 0 success, value is in 'point' -1 failure

◆ 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 
)
extern

Calculate the plane (face) equations for an arb output previously went to es_peqn[i].

Returns - -1 Failure 0 OK

Note - This function migrated from mged/edsol.c.

◆ 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 
)
extern

Moves an arb edge (end1, end2) with bounding planes bp1 and bp2 through point "thru". The edge has (non-unit) slope "dir". Note that the fact that the normals here point in rather than out makes no difference for computing the correct intercepts. After the intercepts are found, they should be checked against the other faces to make sure that they are always "inside".

An ARB edge is moved by finding the direction of the line containing the edge and the 2 "bounding" planes. The new edge is found by intersecting the new line location with the bounding planes. The two "new" planes thus defined are calculated and the affected points are calculated by intersecting planes. This keeps ALL faces planar.

◆ 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 
)
extern

◆ 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 
)
extern

◆ rt_arb_f_eqn()

int rt_arb_f_eqn ( struct rt_edit s,
int  argc,
const char **  argv 
)
extern

◆ rt_arb_edgedir()

int rt_arb_edgedir ( struct rt_edit s,
int  argc,
const char **  argv 
)
extern

Variable Documentation

◆ rt_arb_vertices

const short int rt_arb_vertices[5][24]
extern