Classes | |
class | VolMap |
Class representing a 3-D mapping function (e.g. shape function for volume element) More... | |
class | LinearHexMap |
Shape function for trilinear hexahedron. More... | |
Enumerations | |
enum | intersection_type { NONE = 0 , INTERIOR , NODE0 , NODE1 , NODE2 , EDGE0 , EDGE1 , EDGE2 } |
Plücker test for intersection between a ray and a triangle. More... | |
Functions | |
static void | min_max_3 (double a, double b, double c, double &min, double &max) |
static double | dot_abs (const CartVect &u, const CartVect &v) |
bool | segment_box_intersect (CartVect box_min, CartVect box_max, const CartVect &seg_pt, const CartVect &seg_unit_dir, double &seg_start, double &seg_end) |
bool | first (const CartVect &a, const CartVect &b) |
double | plucker_edge_test (const CartVect &vertexa, const CartVect &vertexb, const CartVect &ray, const CartVect &ray_normal) |
bool | plucker_ray_tri_intersect (const CartVect vertices[3], const CartVect &origin, const CartVect &direction, double &dist_out, const double *nonneg_ray_len, const double *neg_ray_len, const int *orientation, intersection_type *type) |
bool | ray_tri_intersect (const CartVect vertices[3], const CartVect &ray_point, const CartVect &ray_unit_direction, double &t_out, const double *ray_length=0) |
Test for intersection between a ray and a triangle. More... | |
bool | ray_box_intersect (const CartVect &box_min, const CartVect &box_max, const CartVect &ray_pt, const CartVect &ray_dir, double &t_enter, double &t_exit) |
Find range of overlap between ray and axis-aligned box. More... | |
bool | box_plane_overlap (const CartVect &plane_normal, double plane_coeff, CartVect box_min_corner, CartVect box_max_corner) |
Test if plane intersects axis-aligned box. More... | |
bool | box_tri_overlap (const CartVect triangle_corners[3], const CartVect &box_center, const CartVect &box_half_dims) |
Test if triangle intersects axis-aligned box. More... | |
bool | box_tri_overlap (const CartVect triangle_corners[3], const CartVect &box_min_corner, const CartVect &box_max_corner, double tolerance) |
Test if triangle intersects axis-aligned box. More... | |
bool | box_elem_overlap (const CartVect *elem_corners, EntityType elem_type, const CartVect &box_center, const CartVect &box_half_dims, int nodecount=0) |
Test if the specified element intersects an axis-aligned box. More... | |
static CartVect | quad_norm (const CartVect &v1, const CartVect &v2, const CartVect &v3, const CartVect &v4) |
static CartVect | tri_norm (const CartVect &v1, const CartVect &v2, const CartVect &v3) |
bool | box_linear_elem_overlap (const CartVect *elem_corners, EntityType elem_type, const CartVect &box_center, const CartVect &box_half_dims) |
Test if the specified element intersects an axis-aligned box. More... | |
bool | box_linear_elem_overlap (const CartVect *elem_corners, EntityType elem_type, const CartVect &box_half_dims) |
Test if the specified element intersects an axis-aligned box. More... | |
bool | box_hex_overlap (const CartVect *elem_corners, const CartVect ¢er, const CartVect &dims) |
static bool | box_tet_overlap_edge (const CartVect &dims, const CartVect &edge, const CartVect &ve, const CartVect &v1, const CartVect &v2) |
bool | box_tet_overlap (const CartVect *corners_in, const CartVect ¢er, const CartVect &dims) |
void | closest_location_on_tri (const CartVect &location, const CartVect *vertices, CartVect &closest_out) |
find closest location on triangle More... | |
void | closest_location_on_tri (const CartVect &location, const CartVect *vertices, double tolerance, CartVect &closest_out, int &closest_topo) |
find closest topological location on triangle More... | |
void | closest_location_on_polygon (const CartVect &location, const CartVect *vertices, int num_vertices, CartVect &closest_out) |
find closest location on polygon More... | |
void | closest_location_on_box (const CartVect &min, const CartVect &max, const CartVect &point, CartVect &closest) |
bool | box_point_overlap (const CartVect &box_min_corner, const CartVect &box_max_corner, const CartVect &point, double tolerance) |
bool | boxes_overlap (const CartVect &box_min1, const CartVect &box_max1, const CartVect &box_min2, const CartVect &box_max2, double tolerance) |
bool | bounding_boxes_overlap (const CartVect *list1, int num1, const CartVect *list2, int num2, double tolerance) |
bool | bounding_boxes_overlap_2d (const double *list1, int num1, const double *list2, int num2, double tolerance) |
bool | nat_coords_trilinear_hex (const CartVect *corner_coords, const CartVect &x, CartVect &xi, double tol) |
bool | point_in_trilinear_hex (const CartVect *hex, const CartVect &xyz, double etol) |
bool | box_hex_overlap (const CartVect hexv[8], const CartVect &box_center, const CartVect &box_dims) |
bool | box_tet_overlap (const CartVect tet_corners[4], const CartVect &box_center, const CartVect &box_dims) |
Variables | |
const intersection_type | type_list [] = { INTERIOR, EDGE0, EDGE1, NODE1, EDGE2, NODE0, NODE2 } |
Plücker test for intersection between a ray and a triangle.
vertices | Nodes of the triangle. |
ray_point | The start point of the ray. |
ray_unit_direction | The direction of the ray. Must be a unit vector. |
t_out | Output: The distance along the ray from ray_point in the direction of ray_unit_direction at which the ray intersected the triangle. |
nonneg_ray_length | Optional: If non-null, a maximum length for the ray, converting this function to a segment-tri-intersect test. |
neg_ray_length | Optional: If non-null, a maximum length for the ray behind the origin, converting this function to a segment-tri-intersect test. |
orientation | Optional: Reject intersections without the specified orientation of ray with respect to triangle normal vector. Indicate desired orientation by passing 1 (forward), -1 (reverse), or 0 (no preference). |
int_type | Optional Output: The type of intersection; used to identify edge/node intersections. |
Enumerator | |
---|---|
NONE | |
INTERIOR | |
NODE0 | |
NODE1 | |
NODE2 | |
EDGE0 | |
EDGE1 | |
EDGE2 |
Definition at line 105 of file GeomUtil.hpp.
bool moab::GeomUtil::bounding_boxes_overlap | ( | const CartVect * | list1, |
int | num1, | ||
const CartVect * | list2, | ||
int | num2, | ||
double | tolerance | ||
) |
Definition at line 1351 of file GeomUtil.cpp.
References boxes_overlap(), and moab::tolerance.
Referenced by moab::Intx2MeshInPlane::computeIntersectionBetweenTgtAndSrc(), moab::Intx2MeshOnSphere::computeIntersectionBetweenTgtAndSrc(), and moab::IntxRllCssphere::computeIntersectionBetweenTgtAndSrc().
bool moab::GeomUtil::bounding_boxes_overlap_2d | ( | const double * | list1, |
int | num1, | ||
const double * | list2, | ||
int | num2, | ||
double | tolerance | ||
) |
Definition at line 1379 of file GeomUtil.cpp.
References moab::tolerance.
Referenced by moab::Intx2MeshOnSphere::computeIntersectionBetweenTgtAndSrc().
bool moab::GeomUtil::box_elem_overlap | ( | const CartVect * | elem_corners, |
EntityType | elem_type, | ||
const CartVect & | box_center, | ||
const CartVect & | box_half_dims, | ||
int | nodecount = 0 |
||
) |
Test if the specified element intersects an axis-aligned box.
Test if element intersects axis-aligned box. Use element-specific optimization if available, otherwise call box_general_elem_overlap.
elem_corners | The coordinates of the element vertices |
elem_type | The toplogy of the element. |
box_center | The center of the axis-aligned box |
box_half_dims | Half of the width of the box in each axial direction. |
Definition at line 519 of file GeomUtil.cpp.
References box_hex_overlap(), box_linear_elem_overlap(), box_tet_overlap(), box_tri_overlap(), center(), MBHEX, MBPOLYGON, MBPOLYHEDRON, MBTET, and MBTRI.
Referenced by moab::AdaptiveKDTree::intersect_children_with_elems().
bool moab::GeomUtil::box_hex_overlap | ( | const CartVect * | elem_corners, |
const CartVect & | center, | ||
const CartVect & | dims | ||
) |
Definition at line 744 of file GeomUtil.cpp.
References center(), moab::cross(), moab::dot(), dot_abs(), and quad_norm().
Referenced by box_elem_overlap().
bool moab::GeomUtil::box_hex_overlap | ( | const CartVect | hexv[8], |
const CartVect & | box_center, | ||
const CartVect & | box_dims | ||
) |
bool moab::GeomUtil::box_linear_elem_overlap | ( | const CartVect * | elem_corners, |
EntityType | elem_type, | ||
const CartVect & | box_center, | ||
const CartVect & | box_half_dims | ||
) |
Test if the specified element intersects an axis-aligned box.
Uses MBCN and separating axis theorem for general algorithm that works for all fixed-size elements (not poly*).
elem_corners | The coordinates of the element vertices |
elem_type | The toplogy of the element. |
box_center | The center of the axis-aligned box |
box_half_dims | Half of the width of the box in each axial direction. |
Definition at line 564 of file GeomUtil.cpp.
References moab::CN::VerticesPerEntity().
Referenced by box_elem_overlap().
bool moab::GeomUtil::box_linear_elem_overlap | ( | const CartVect * | elem_corners, |
EntityType | elem_type, | ||
const CartVect & | box_half_dims | ||
) |
Test if the specified element intersects an axis-aligned box.
Uses MBCN and separating axis theorem for general algorithm that works for all fixed-size elements (not poly*). Box and element vertices must be translated such that box center is at origin.
elem_corners | The coordinates of the element vertices, in local coordinate system of box. |
elem_type | The toplogy of the element. |
box_half_dims | Half of the width of the box in each axial direction. |
Definition at line 577 of file GeomUtil.cpp.
References moab::cross(), moab::dot(), dot_abs(), MBQUAD, MBTRI, moab::CN::NumSubEntities(), quad_norm(), moab::CN::SubEntityType(), moab::CN::SubEntityVertexIndices(), tri_norm(), and moab::CN::VerticesPerEntity().
bool moab::GeomUtil::box_plane_overlap | ( | const CartVect & | plane_normal, |
double | plane_coeff, | ||
CartVect | box_min_corner, | ||
CartVect | box_max_corner | ||
) |
Test if plane intersects axis-aligned box.
Test for intersection between an unbounded plane and an axis-aligned box.
plane_normal | Vector in plane normal direction (need not be a unit vector). The N in the plane equation: N . X + D = 0 |
plane_coeff | The scalar 'D' term in the plane equation: N . X + D = 0 |
box_min_corner | The smallest coordinates of the box along each axis. The corner of the box for which all three coordinate values are smaller than those of any other corner. The X, Y, Z values for the planes normal to those axes and bounding the box on the -X, -Y, and -Z sides respectively. |
box_max_corner | The largest coordinates of the box along each axis. The corner of the box for which all three coordinate values are larger than those of any other corner. The X, Y, Z values for the planes normal to those axes and bounding the box on the +X, +Y, and +Z sides respectively. |
Definition at line 399 of file GeomUtil.cpp.
Referenced by box_tri_overlap().
bool moab::GeomUtil::box_point_overlap | ( | const CartVect & | box_min_corner, |
const CartVect & | box_max_corner, | ||
const CartVect & | point, | ||
double | tolerance | ||
) |
Definition at line 1322 of file GeomUtil.cpp.
References closest_location_on_box(), and moab::tolerance.
bool moab::GeomUtil::box_tet_overlap | ( | const CartVect * | corners_in, |
const CartVect & | center, | ||
const CartVect & | dims | ||
) |
Definition at line 945 of file GeomUtil.cpp.
References box_tet_overlap_edge(), center(), moab::dot(), and dot_abs().
Referenced by box_elem_overlap().
bool moab::GeomUtil::box_tet_overlap | ( | const CartVect | tet_corners[4], |
const CartVect & | box_center, | ||
const CartVect & | box_dims | ||
) |
|
inlinestatic |
Definition at line 901 of file GeomUtil.cpp.
References moab::dot(), and min_max_3().
Referenced by box_tet_overlap().
bool moab::GeomUtil::box_tri_overlap | ( | const CartVect | triangle_corners[3], |
const CartVect & | box_center, | ||
const CartVect & | box_half_dims | ||
) |
Test if triangle intersects axis-aligned box.
Test if a triangle intersects an axis-aligned box.
triangle_corners | The corners of the triangle. |
box_center | The center of the box. |
box_hanf_dims | The distance along each axis, respectively, from the box_center to the boundary of the box. |
Definition at line 425 of file GeomUtil.cpp.
References box_plane_overlap(), and CHECK_RANGE.
Referenced by box_elem_overlap(), and box_tri_overlap().
bool moab::GeomUtil::box_tri_overlap | ( | const CartVect | triangle_corners[3], |
const CartVect & | box_min_corner, | ||
const CartVect & | box_max_corner, | ||
double | tolerance | ||
) |
Test if triangle intersects axis-aligned box.
Test if a triangle intersects an axis-aligned box.
triangle_corners | The corners of the triangle. |
box_min_corner | The smallest coordinates of the box along each axis. The corner of the box for which all three coordinate values are smaller than those of any other corner. The X, Y, Z values for the planes normal to those axes and bounding the box on the -X, -Y, and -Z sides respectively. |
box_max_corner | The largest coordinates of the box along each axis. The corner of the box for which all three coordinate values are larger than those of any other corner. The X, Y, Z values for the planes normal to those axes and bounding the box on the +X, +Y, and +Z sides respectively. |
tolerance | The tolerance used in the intersection test. The box size is increased by this amount before the intersection test. |
Definition at line 509 of file GeomUtil.cpp.
References box_tri_overlap(), and moab::tolerance.
bool moab::GeomUtil::boxes_overlap | ( | const CartVect & | box_min1, |
const CartVect & | box_max1, | ||
const CartVect & | box_min2, | ||
const CartVect & | box_max2, | ||
double | tolerance | ||
) |
Definition at line 1333 of file GeomUtil.cpp.
References moab::tolerance.
Referenced by bounding_boxes_overlap().
void moab::GeomUtil::closest_location_on_box | ( | const CartVect & | min, |
const CartVect & | max, | ||
const CartVect & | point, | ||
CartVect & | closest | ||
) |
void moab::GeomUtil::closest_location_on_polygon | ( | const CartVect & | location, |
const CartVect * | vertices, | ||
int | num_vertices, | ||
CartVect & | closest_out | ||
) |
find closest location on polygon
Find closest location on polygon
location | Input position to evaluate from |
vertices | Array of corner vertex coordinates. |
num_vertices | Length of 'vertices' array. |
closest_out | Result position |
Definition at line 1244 of file GeomUtil.cpp.
Referenced by moab::OrientedBoxTreeTool::closest_to_location().
void moab::GeomUtil::closest_location_on_tri | ( | const CartVect & | location, |
const CartVect * | vertices, | ||
CartVect & | closest_out | ||
) |
find closest location on triangle
Find closest location on linear triangle.
location | Input position to evaluate from |
vertices | Array of three corner vertex coordinates. |
closest_out | Result position |
Definition at line 1060 of file GeomUtil.cpp.
Referenced by closest_location_on_tri(), moab::OrientedBoxTreeTool::closest_to_location(), moab::closest_to_triangles(), moab::OrientedBoxTreeTool::sphere_intersect_triangles(), and moab::AdaptiveKDTree::sphere_intersect_triangles().
void moab::GeomUtil::closest_location_on_tri | ( | const CartVect & | location, |
const CartVect * | vertices, | ||
double | tolerance, | ||
CartVect & | closest_out, | ||
int & | closest_topo | ||
) |
find closest topological location on triangle
Find closest location on linear triangle.
location | Input position to evaluate from |
vertices | Array of three corner vertex coordinates. |
tolerance | Tolerance to use when comparing to corners and edges |
closest_out | Result position |
closest_topo | Closest topological entity 0-2 : vertex index 3-5 : edge beginning at closest_topo - 3 6 : triangle interior |
Definition at line 1205 of file GeomUtil.cpp.
References closest_location_on_tri(), and moab::tolerance.
Definition at line 65 of file GeomUtil.cpp.
Referenced by box_hex_overlap(), box_linear_elem_overlap(), and box_tet_overlap().
Definition at line 114 of file GeomUtil.cpp.
Referenced by moab::TypeSequenceManager::append_memory_use(), MetisPartitioner::assemble_taggedsets_graph(), moab::check_range(), moab::TypeSequenceManager::check_valid_handles(), moab::OrientedBox::covariance_data_from_tris(), moab::ParallelComm::create_interface_sets(), moab::ReadHDF5::delete_non_side_elements(), moab::TypeSequenceManager::erase(), moab::MeshSet::FIRST_OF_DIM(), moab::get_adjacencies_union(), moab::Core::get_connectivity(), moab::Core::get_coords(), moab::Core::get_entities_by_dimension(), moab::TypeSequenceManager::get_memory_use(), moab::RangeSetIterator::get_next_by_dimension(), moab::Core::get_number_entities_by_dimension(), moab::MeshSetSequence::get_per_entity_memory_use(), moab::AEntityFactory::get_zero_to_n_elements(), moab::WriteHDF5::initialize_mesh(), moab::Range::insert(), moab::InsertCount::insert(), moab::WriteGMV::local_write_mesh(), moab::Range::lower_bound(), moab::MergeMesh::merge_using_integer_tag(), moab::Range::num_of_dimension(), plucker_edge_test(), moab::DualTool::print_cell(), ProgOptions::printUsage(), moab::ReadHDF5::read_set_data(), moab::ParallelComm::resolve_shared_ents(), moab::FBEngine::separate(), moab::BVHTree::set_interval(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::set_interval(), moab::ParCommGraph::settle_comm_by_ids(), moab::FBEngine::split_surface(), moab::Range::subset_by_dimension(), moab::ParallelMergeMesh::TagSharedElements(), moab::Range::upper_bound(), v_quad_distortion(), v_quad_oddy(), v_tri_scaled_jacobian(), and moab::ReadVtk::vtk_read_polygons().
|
inlinestatic |
bool moab::GeomUtil::nat_coords_trilinear_hex | ( | const CartVect * | corner_coords, |
const CartVect & | x, | ||
CartVect & | xi, | ||
double | tol | ||
) |
Definition at line 1516 of file GeomUtil.cpp.
References moab::GeomUtil::VolMap::solve_inverse().
Referenced by point_in_trilinear_hex().
double moab::GeomUtil::plucker_edge_test | ( | const CartVect & | vertexa, |
const CartVect & | vertexb, | ||
const CartVect & | ray, | ||
const CartVect & | ray_normal | ||
) |
Definition at line 148 of file GeomUtil.cpp.
References first().
Referenced by plucker_ray_tri_intersect().
bool moab::GeomUtil::plucker_ray_tri_intersect | ( | const CartVect | vertices[3], |
const CartVect & | origin, | ||
const CartVect & | direction, | ||
double & | dist_out, | ||
const double * | nonneg_ray_len, | ||
const double * | neg_ray_len, | ||
const int * | orientation, | ||
intersection_type * | type | ||
) |
Definition at line 193 of file GeomUtil.cpp.
References EXIT_EARLY, plucker_edge_test(), and type_list.
Referenced by moab::RayIntersectSets::leaf(), and moab::OrientedBoxTreeTool::ray_intersect_triangles().
bool moab::GeomUtil::point_in_trilinear_hex | ( | const CartVect * | hex, |
const CartVect & | xyz, | ||
double | etol | ||
) |
Definition at line 1521 of file GeomUtil.cpp.
References nat_coords_trilinear_hex().
Referenced by hex_containing_point().
|
inlinestatic |
Definition at line 554 of file GeomUtil.cpp.
Referenced by box_hex_overlap(), and box_linear_elem_overlap().
bool moab::GeomUtil::ray_box_intersect | ( | const CartVect & | box_min, |
const CartVect & | box_max, | ||
const CartVect & | ray_pt, | ||
const CartVect & | ray_dir, | ||
double & | t_enter, | ||
double & | t_exit | ||
) |
Find range of overlap between ray and axis-aligned box.
box_min | Box corner with minimum coordinate values |
box_max | Box corner with minimum coordinate values |
ray_pt | Coordinates of start point of ray |
ray_dir | Directionion vector for ray such that the ray is defined by r(t) = ray_point + t * ray_vect for t > 0. |
t_enter | Output: if return value is true, this value is the parameter location along the ray at which the ray entered the leaf. If return value is false, then this value is undefined. |
t_exit | Output: if return value is true, this value is the parameter location along the ray at which the ray exited the leaf. If return value is false, then this value is undefined. |
Definition at line 347 of file GeomUtil.cpp.
References box_max(), and box_min().
Referenced by moab::AdaptiveKDTreeIter::intersect_ray().
bool moab::GeomUtil::ray_tri_intersect | ( | const CartVect | vertices[3], |
const CartVect & | ray_point, | ||
const CartVect & | ray_unit_direction, | ||
double & | t_out, | ||
const double * | ray_length = 0 |
||
) |
Test for intersection between a ray and a triangle.
ray_point | The start point of the ray. |
ray_unit_direciton | The direction of the ray. Must be a unit vector. |
t_out | Output: The distance along the ray from ray_point in the direction of ray_unit_direction at which the ray itersected the triangle. |
ray_length | Optional: If non-null, a pointer a maximum length for the ray, converting this function to a segment-tri- intersect test. |
Definition at line 299 of file GeomUtil.cpp.
Referenced by moab::AdaptiveKDTree::ray_intersect_triangles().
bool moab::GeomUtil::segment_box_intersect | ( | CartVect | box_min, |
CartVect | box_max, | ||
const CartVect & | seg_pt, | ||
const CartVect & | seg_unit_dir, | ||
double & | seg_start, | ||
double & | seg_end | ||
) |
Given a line segment and an axis-aligned box, return the sub-segment of the line segment that itersects the box.
Can be used to intersect ray with box by passing seg_end as HUGE_VAL or std::numeric_limits<double>::maximum().
box_min | Minimum corner of axis-aligned box |
box_max | Maximum corner of axis-aligned box |
seg_pt | A point in the line containing the segement |
seg_unit_dir | A unit vector in the direction of the line containing the semgent. |
seg_start | The distance from seg_pt in the direction of seg_unit_dir at which the segment begins. As input, the start of the original segment, as output, the start of the sub-segment intersecting the box. Note: seg_start must be less than seg_end |
seg_end | The distance from seg_pt in the direction of seg_unit_dir at which the segment ends. As input, the end of the original segment, as output, the end of the sub-segment intersecting the box. Note: seg_start must be less than seg_end |
Definition at line 70 of file GeomUtil.cpp.
References box_max(), box_min(), and moab::Util::is_finite().
Referenced by moab::AdaptiveKDTree::ray_intersect_triangles().
|
inlinestatic |
Definition at line 559 of file GeomUtil.cpp.
Referenced by box_linear_elem_overlap().
const intersection_type moab::GeomUtil::type_list[] = { INTERIOR, EDGE0, EDGE1, NODE1, EDGE2, NODE0, NODE2 } |
Definition at line 125 of file GeomUtil.hpp.
Referenced by plucker_ray_tri_intersect().