Table of Contents

Class Segment3d

Namespace
Hi.Geom
Assembly
HiGeom.dll

Represents a 3D line segment defined by two endpoints.

public class Segment3d : IExpandToBox3d, IEquatable<Segment3d>, IBinaryIo, IWriteBin, IEnumerable<Vec3d>, IEnumerable
Inheritance
Segment3d
Implements
Inherited Members
Extension Methods

Constructors

Segment3d()

public Segment3d()

Segment3d(Vec3d, Vec3d)

public Segment3d(Vec3d begin, Vec3d end)

Parameters

begin Vec3d
end Vec3d

Properties

Arrow

Gets the arrow vector from Begin to End.

public Vec3d Arrow { get; }

Property Value

Vec3d

Begin

public Vec3d Begin { get; set; }

Property Value

Vec3d

Center

Gets the midpoint of the segment.

public Vec3d Center { get; }

Property Value

Vec3d

End

public Vec3d End { get; set; }

Property Value

Vec3d

Length

Gets the length of the segment.

public double Length { get; }

Property Value

double

LengthSquare

public double LengthSquare { get; }

Property Value

double

Methods

ClosestPoint(Vec3d)

Gets the closest point on the segment to the specified point.

public Vec3d ClosestPoint(Vec3d point)

Parameters

point Vec3d

Point to find closest point to.

Returns

Vec3d

Closest point on the segment.

Equals(Segment3d)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Segment3d other)

Parameters

other Segment3d

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ExpandToBox3d(Box3d)

Expands the destination box. This function is usually used to compute the bounding box of elements.

public void ExpandToBox3d(Box3d dst)

Parameters

dst Box3d

Destination box

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Vec3d> GetEnumerator()

Returns

IEnumerator<Vec3d>

An enumerator that can be used to iterate through the collection.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

PointAt(double)

Gets a point on the segment at the specified parameter t (0 <= t <= 1).

public Vec3d PointAt(double t)

Parameters

t double

Parameter value between 0 and 1.

Returns

Vec3d

Point on the segment.

ReadBin(BinaryReader)

Reads binary data to initialize the object.

public void ReadBin(BinaryReader reader)

Parameters

reader BinaryReader

The binary reader to read from

Swap()

public void Swap()

ToString()

Returns a string representation of the segment.

public override string ToString()

Returns

string

WriteBin(BinaryWriter)

Writes the object's data to a binary stream.

public void WriteBin(BinaryWriter writer)

Parameters

writer BinaryWriter

The binary writer to write to