Files
IfcOpenShell/src/ifcgeom/kernels/opencascade/clash_utils.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.3 KiB
C++
Raw Normal View History

2024-02-29 17:17:59 +11:00
#pragma once
#include <gp_Vec.hxx>
#include <array>
2025-09-26 14:24:49 +02:00
#include "../ifc_geomlibrary_api.h"
struct IFC_GEOMLIBRARY_API ray {
2024-02-29 17:17:59 +11:00
float origin[3];
float dir[3];
float dir_inv[3];
};
2025-09-26 14:24:49 +02:00
struct IFC_GEOMLIBRARY_API box {
2024-02-29 17:17:59 +11:00
float corners[2][3];
};
2025-09-26 14:24:49 +02:00
IFC_GEOMLIBRARY_API bool is_intersect_ray_box(const struct ray *ray, const struct box *box);
2024-02-29 17:17:59 +11:00
2025-09-26 14:24:49 +02:00
IFC_GEOMLIBRARY_API bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir,
2024-02-29 17:17:59 +11:00
const gp_Vec& vert0, const gp_Vec& vert1, const gp_Vec& vert2,
Standard_Real& at, Standard_Real& au, Standard_Real& av,
bool cull, float enlarge=0.0f);
2025-09-26 14:24:49 +02:00
IFC_GEOMLIBRARY_API void edgeEdgeDist(gp_Vec& x, gp_Vec& y, // closest points
2024-02-29 17:17:59 +11:00
const gp_Vec& p, const gp_Vec& a, // seg 1 origin, vector
const gp_Vec& q, const gp_Vec& b); // seg 2 origin, vector
2025-09-26 14:24:49 +02:00
IFC_GEOMLIBRARY_API float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array<gp_Vec, 3> p, const std::array<gp_Vec, 3> q);
2024-02-29 17:17:59 +11:00
2025-09-26 14:24:49 +02:00
IFC_GEOMLIBRARY_API bool trianglesIntersect(const gp_Vec& a1, const gp_Vec& b1, const gp_Vec& c1, const gp_Vec& a2, const gp_Vec& b2, const gp_Vec& c2/*, Segment* intersection*/, gp_Vec& int1, gp_Vec& int2, bool ignoreCoplanar);