Table of Contents

Class Flat3d

Namespace
Hi.Geom
Assembly
HiGeom.dll

Represents a 3D plane defined by a unit normal vector and its signed distance from the origin. The plane equation is: Ax + By + Cz + d = 0, where (A,B,C) is the normal vector and d is the distance to origin.

public class Flat3d : IFlat3d, IBinaryIo, IWriteBin, IEquatable<Flat3d>
Inheritance
Flat3d
Implements
Inherited Members
Extension Methods

Constructors

Flat3d()

Initializes a new instance of the Flat3d class.

public Flat3d()

Flat3d(IFlat3d)

public Flat3d(IFlat3d src)

Parameters

src IFlat3d

Flat3d(Vec3d, double)

Initializes a new instance of the Flat3d class with a normal vector and distance to origin.

public Flat3d(Vec3d normal, double distanceToOrigin)

Parameters

normal Vec3d

The unit normal vector of the plane.

distanceToOrigin double

The signed distance from origin to the plane.

Properties

DistanceToOrigin

The signed distance from the origin (0,0,0) to this plane. A positive distance means the origin is on the same side as the normal vector.

public double DistanceToOrigin { get; set; }

Property Value

double

Normal

The unit normal to the plane.

public Vec3d Normal { get; set; }

Property Value

Vec3d

Methods

DistanceTo(Vec3d)

Gets the distance from a point to this plane.

public double DistanceTo(Vec3d point)

Parameters

point Vec3d

The point to calculate distance to.

Returns

double

The signed distance from the point to the plane.

Equals(Flat3d)

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

public bool Equals(Flat3d other)

Parameters

other Flat3d

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.

FromPointAndNormal(Vec3d, Vec3d)

Creates a plane from a point and normal vector.

public static Flat3d FromPointAndNormal(Vec3d point, Vec3d normal)

Parameters

point Vec3d

A point on the plane.

normal Vec3d

The normal vector of the plane.

Returns

Flat3d

A new plane instance.

GetDistanceToOrigin()

Signed Distance To Origin.

public double GetDistanceToOrigin()

Returns

double

Signed Distance To Origin.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetLocate()

Gets a point on the plane closest to the origin.

public Vec3d GetLocate()

Returns

Vec3d

GetNormal()

Gets the normal vector of the flat surface.

public Vec3d GetNormal()

Returns

Vec3d

The unit normal vector

ProjectPoint(Vec3d)

Projects a point onto this plane.

public Vec3d ProjectPoint(Vec3d point)

Parameters

point Vec3d

The point to project.

Returns

Vec3d

The projected point on the plane.

ReadBin(BinaryReader)

Reads binary data to initialize the object.

public void ReadBin(BinaryReader reader)

Parameters

reader BinaryReader

The binary reader to read from

ToString()

Returns a string representation of the plane.

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