Class GeomUtil
Utility of Geometry.
public static class GeomUtil
- Inheritance
-
GeomUtil
- Inherited Members
Methods
ExpandToBox3d(IExpandToBox3d, Mat4d, Box3d)
Expands the destination bounding box with the transformed bounding box of source under matrix mat.
public static void ExpandToBox3d(this IExpandToBox3d src, Mat4d mat, Box3d dst)
Parameters
srcIExpandToBox3dThe source geometry
matMat4dThe transformation matrix
dstBox3dThe destination bounding box
GetBox3d(IExpandToBox3d)
Gets a Box3d representation of the specified object that implements IExpandToBox3d.
public static Box3d GetBox3d(this IExpandToBox3d src)
Parameters
srcIExpandToBox3dThe source object that implements IExpandToBox3d.
Returns
- Box3d
A Box3d representation of the source object.
GetNearestPointOnLineSegment(Vec2d, Vec2d, Vec2d)
Get the nearest point on a line segment to a given point.
public static Vec2d GetNearestPointOnLineSegment(Vec2d point, Vec2d lineStart, Vec2d lineEnd)
Parameters
pointVec2dThe point to find the nearest point from
lineStartVec2dStart point of the line segment
lineEndVec2dEnd point of the line segment
Returns
- Vec2d
The nearest point on the line segment
GetNearestPointOnLineSegment(Vec3d, Vec3d, Vec3d)
Get the nearest point on a line segment to a given point.
public static Vec3d GetNearestPointOnLineSegment(Vec3d point, Vec3d lineStart, Vec3d lineEnd)
Parameters
pointVec3dThe point to find the nearest point from
lineStartVec3dStart point of the line segment
lineEndVec3dEnd point of the line segment
Returns
- Vec3d
The nearest point on the line segment
GetRayIntersection(Vec3d, Vec3d, Vec3d, Vec3d)
Calculates the intersection point of two rays in 3D space.
public static Vec3d GetRayIntersection(Vec3d rayABegin, Vec3d rayAVec, Vec3d rayBBegin, Vec3d rayBVec)
Parameters
rayABeginVec3dThe starting point of the first ray.
rayAVecVec3dThe direction vector of the first ray.
rayBBeginVec3dThe starting point of the second ray.
rayBVecVec3dThe direction vector of the second ray.
Returns
- Vec3d
The intersection point of the two rays, or null if they don't intersect.
IntersectLineSegmentCircle(Vec2d, Vec2d, double, out Vec2d, out Vec2d)
Intersect line segment and circle.
public static double IntersectLineSegmentCircle(Vec2d p0, Vec2d p1, double rr, out Vec2d pA, out Vec2d pB)
Parameters
p0Vec2dline segment begin point
p1Vec2dline segment end point
rrdoubleradius*radius
pAVec2dfirst intersect point along
p0top1pBVec2dsecond intersect point along
p0top1
Returns
- double
determinant