Table of Contents

Class GeomUtil

Namespace
Hi.Geom
Assembly
HiGeom.dll

Utility of Geometry.

public static class GeomUtil
Inheritance
GeomUtil
Inherited Members

Methods

ExpandToBox3d(IExpandToBox3d, Mat4d, Box3d)

public static void ExpandToBox3d(this IExpandToBox3d src, Mat4d mat, Box3d dst)

Parameters

src IExpandToBox3d
mat Mat4d
dst Box3d

GetBox3d(IExpandToBox3d)

Gets a Box3d representation of the specified object that implements IExpandToBox3d.

public static Box3d GetBox3d(this IExpandToBox3d src)

Parameters

src IExpandToBox3d

The 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

point Vec2d

The point to find the nearest point from

lineStart Vec2d

Start point of the line segment

lineEnd Vec2d

End 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

point Vec3d

The point to find the nearest point from

lineStart Vec3d

Start point of the line segment

lineEnd Vec3d

End 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

rayABegin Vec3d

The starting point of the first ray.

rayAVec Vec3d

The direction vector of the first ray.

rayBBegin Vec3d

The starting point of the second ray.

rayBVec Vec3d

The 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

p0 Vec2d

line segment begin point

p1 Vec2d

line segment end point

rr double

radius*radius

pA Vec2d

first intersect point along p0 to p1

pB Vec2d

second intersect point along p0 to p1

Returns

double

determinant