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_t, ref box3d_t)

Expands the destination bounding box with the transformed bounding box of source under matrix mat.

public static void ExpandToBox3d(this IExpandToBox3d src, mat4d_t mat, ref box3d_t dst)

Parameters

src IExpandToBox3d

The source geometry

mat mat4d_t

The transformation matrix

dst box3d_t

The destination bounding box

GetBox3d(IExpandToBox3d)

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

public static box3d_t GetBox3d(this IExpandToBox3d src)

Parameters

src IExpandToBox3d

The source object that implements IExpandToBox3d.

Returns

box3d_t

A box3d_t representation of the source object.

GetNearestPointOnLineSegment(vec2d_t, vec2d_t, vec2d_t)

Get the nearest point on a line segment to a given point.

public static vec2d_t GetNearestPointOnLineSegment(vec2d_t point, vec2d_t lineStart, vec2d_t lineEnd)

Parameters

point vec2d_t

The point to find the nearest point from

lineStart vec2d_t

Start point of the line segment

lineEnd vec2d_t

End point of the line segment

Returns

vec2d_t

The nearest point on the line segment

GetNearestPointOnLineSegment(vec3d_t, vec3d_t, vec3d_t)

Get the nearest point on a line segment to a given point.

public static vec3d_t GetNearestPointOnLineSegment(vec3d_t point, vec3d_t lineStart, vec3d_t lineEnd)

Parameters

point vec3d_t

The point to find the nearest point from

lineStart vec3d_t

Start point of the line segment

lineEnd vec3d_t

End point of the line segment

Returns

vec3d_t

The nearest point on the line segment

GetRayIntersection(vec3d_t, vec3d_t, vec3d_t, vec3d_t)

Calculates the intersection point of two rays in 3D space.

public static vec3d_t GetRayIntersection(vec3d_t rayABegin, vec3d_t rayAVec, vec3d_t rayBBegin, vec3d_t rayBVec)

Parameters

rayABegin vec3d_t

The starting point of the first ray.

rayAVec vec3d_t

The direction vector of the first ray.

rayBBegin vec3d_t

The starting point of the second ray.

rayBVec vec3d_t

The direction vector of the second ray.

Returns

vec3d_t

The point on the second line (rayBBegin + rayBVec*t, t may be negative) where the two infinite lines meet; for skew lines it is the point on the second line whose offset from the first has no component along their cross product. When the direction vectors are parallel (their cross product is zero) every component is NaN; test the cross product before calling when the parallel case matters.

IntersectLineSegmentCircle(vec2d_t, vec2d_t, double, out vec2d_t?, out vec2d_t?)

Intersect line segment and circle.

public static double IntersectLineSegmentCircle(vec2d_t p0, vec2d_t p1, double rr, out vec2d_t? pA, out vec2d_t? pB)

Parameters

p0 vec2d_t

line segment begin point

p1 vec2d_t

line segment end point

rr double

radius*radius

pA vec2d_t?

first intersect point along p0 to p1; null when the determinant is not positive or that root lies outside the segment

pB vec2d_t?

second intersect point along p0 to p1; null when the determinant is not positive or that root lies outside the segment

Returns

double

determinant