Generated by DocFX

Class Point3

Defines a Vector in Euclidean space with coordinates X, Y, and Z. Referenced from https://github.com/mcneel/rhinocommon/blob/master/dotnet/opennurbs/opennurbs_point.cs

Inheritance
System.Object
Point3
MeshVertex
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public class Point3 : IEquatable<Point3>, IComparable<Point3>, IComparable

Constructors

| Improve this Doc View Source

Point3()

Initializes a new point with zero valued coordinates.

Declaration
public Point3()
| Improve this Doc View Source

Point3(Point3)

Initializes a new point by copying coordinates from another point.

Declaration
public Point3(Point3 point)
Parameters
Type Name Description
Point3 point

A point.

| Improve this Doc View Source

Point3(Point4)

Initializes a new point by copying coordinates from a four-dimensional point. The first three coordinates are divided by the last one. If the W (fourth) dimension of the input point is zero, then it will be discarded.

Declaration
public Point3(Point4 point)
Parameters
Type Name Description
Point4 point

A point.

| Improve this Doc View Source

Point3(Vector3)

Initializes a new point by copying coordinates from the components of a vector.

Declaration
public Point3(Vector3 vector)
Parameters
Type Name Description
Vector3 vector

A vector.

| Improve this Doc View Source

Point3(Double, Double, Double)

Initializes a new point by defining the X, Y and Z coordinates.

Declaration
public Point3(double x, double y, double z)
Parameters
Type Name Description
System.Double x

The value of the X (first) coordinate.

System.Double y

The value of the Y (second) coordinate.

System.Double z

The value of the Z (third) coordinate.

Properties

| Improve this Doc View Source

IsValid

Each coordinate of the point must pass the IsValidDouble(Double) test.

Declaration
public bool IsValid { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Item[Int32]

Declaration
public double this[int i] { get; set; }
Parameters
Type Name Description
System.Int32 i
Property Value
Type Description
System.Double
| Improve this Doc View Source

Origin

Gets the value of a point at location 0,0,0.

Declaration
public static Point3 Origin { get; }
Property Value
Type Description
Point3
| Improve this Doc View Source

Size

Dimension of point.

Declaration
public int Size { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Unset

Gets the value of a point at location RhinoMath.UnsetValue,RhinoMath.UnsetValue,RhinoMath.UnsetValue.

Declaration
public static Point3 Unset { get; }
Property Value
Type Description
Point3
| Improve this Doc View Source

X

Gets or sets the X (first) coordinate of this point.

Declaration
public double X { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Y

Gets or sets the Y (second) coordinate of this point.

Declaration
public double Y { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Z

Gets or sets the Z (third) coordinate of this point.

Declaration
public double Z { get; set; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

Add(Vector3, Point3)

Sums up a point and a vector, and returns a new point.

(Provided for languages that do not support operator overloading. You can use the + operator otherwise)

Declaration
public static Point3 Add(Vector3 vector, Point3 point)
Parameters
Type Name Description
Vector3 vector

A vector.

Point3 point

A point.

Returns
Type Description
Point3

A new point that results from the addition of point and vector.

| Improve this Doc View Source

Centroid(IEnumerable<Point3>)

Calculate the centroid of an arbitrary collection of points

Declaration
public static Point3 Centroid(IEnumerable<Point3> points)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Point3> points

A collection of points.

Returns
Type Description
Point3

The centroid of the points

| Improve this Doc View Source

CompareTo(Point3)

Compares this Point3 with another Point3.

Component evaluation priority is first X, then Y, then Z.

Declaration
public int CompareTo(Point3 other)
Parameters
Type Name Description
Point3 other

The other Point3 to use in comparison.

Returns
Type Description
System.Int32

0: if this is identical to other

-1: if this.X < other.X

-1: if this.X == other.X and this.Y < other.Y

-1: if this.X == other.X and this.Y == other.Y and this.Z < other.Z

+1: otherwise.

| Improve this Doc View Source

CullDuplicates(IEnumerable<Point3>, Double)

Removes duplicates in the supplied set of points.

Declaration
public static Point3[] CullDuplicates(IEnumerable<Point3> points, double tolerance)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Point3> points

A list, an array or any enumerable of Point3.

System.Double tolerance

The minimum distance isBetween points.

Points that fall within this tolerance will be discarded.

.
Returns
Type Description
Point3[]

An array of points without duplicates; or null on error.

| Improve this Doc View Source

DistanceTo(Line)

Calculates the distance of a point to a line.

Declaration
public double DistanceTo(Line line)
Parameters
Type Name Description
Line line

The line from which to calculate the distance.

Returns
Type Description
System.Double

The distance.

| Improve this Doc View Source

DistanceTo(Point3)

Computes the distance isBetween two points.

Declaration
public double DistanceTo(Point3 other)
Parameters
Type Name Description
Point3 other

Other point for distance measurement.

Returns
Type Description
System.Double

The length of the line isBetween this and the other point; or 0 if any of the points is not valid.

| Improve this Doc View Source

EpsilonEquals(Point3, Double)

Check that all values in other are within epsilon of the values in this

Declaration
public bool EpsilonEquals(Point3 other, double epsilon)
Parameters
Type Name Description
Point3 other
System.Double epsilon
Returns
Type Description
System.Boolean

True if the two points have the same coordinates as this; otherwise false.

| Improve this Doc View Source

Equals(Point3)

Determines whether the specified Point3 has the same values as the present point.

Declaration
public bool Equals(Point3 point)
Parameters
Type Name Description
Point3 point

The specified point.

Returns
Type Description
System.Boolean

True if point has the same coordinates as this; otherwise false.

| Improve this Doc View Source

Equals(Object)

Determines whether the specified System.Object is a Point3 and has the same values as the present point.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The specified object.

Returns
Type Description
System.Boolean

true if obj is a Point3 and has the same coordinates as this; otherwise false.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Computes a hash code for the present point.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A non-unique integer that represents this point.

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

InPolygon(Polygon)

Tests whether a point is inside, outside, or coincident with a polygon.

See https://stackoverflow.com/a/63436180

Declaration
public int InPolygon(Polygon polygon)
Parameters
Type Name Description
Polygon polygon

The polygon to test against.

Returns
Type Description
System.Int32

Returns -1 if point is outside the polygon, 0 if it is coincident with a polygon edge, or 1 if it is inside the polygon.

| Improve this Doc View Source

Interpolate(Point3, Point3, Double)

Interpolate isBetween two points returning a new point at the given interpolation parameter.

Declaration
public static Point3 Interpolate(Point3 pA, Point3 pB, double t)
Parameters
Type Name Description
Point3 pA

First point.

Point3 pB

Second point.

System.Double t

Interpolation parameter. If t=0 then this point is set to pA. If t=1 then this point is set to pB. Values of t in isBetween 0.0 and 1.0 result in points isBetween pA and pB.

Returns
Type Description
Point3
| Improve this Doc View Source

IsOnLine(Line, Double)

Test whether a point lies on a line.

Declaration
public bool IsOnLine(Line line, double tolerance = 0.001)
Parameters
Type Name Description
Line line

The line to test against.

System.Double tolerance

Default is use 1e-6

Returns
Type Description
System.Boolean

Returns true if point is on line.

| Improve this Doc View Source

IsOnPlane(Plane, Double)

Test whether a point lies on a plane.

Declaration
public bool IsOnPlane(Plane plane, double tolerance = 0.001)
Parameters
Type Name Description
Plane plane

The plane to test against.

System.Double tolerance

Default is use 1e-6

Returns
Type Description
System.Boolean

Returns true if point is on plane.

| Improve this Doc View Source

PointBetween(Point3, Point3)

Get a point isBetween two points.

Declaration
public static Point3 PointBetween(Point3 p1, Point3 p2)
Parameters
Type Name Description
Point3 p1

First point.

Point3 p2

Second point.

Returns
Type Description
Point3

Point isBetween first and second point.

| Improve this Doc View Source

ProjectToPlan(Plane)

Projects a point onto a plane.

Declaration
public Point3 ProjectToPlan(Plane plane)
Parameters
Type Name Description
Plane plane

Plane to project onto

Returns
Type Description
Point3

The point projected to plane

| Improve this Doc View Source

ToString()

Constructs the string representation for the current point.

Declaration
public override string ToString()
Returns
Type Description
System.String

The point representation in the form X,Y,Z.

Overrides
System.Object.ToString()
| Improve this Doc View Source

Transform(TransformMatrix)

Transforms the point using a transformation matrix.

Declaration
public Point3 Transform(TransformMatrix t)
Parameters
Type Name Description
TransformMatrix t

The transformation matrix.

Returns
Type Description
Point3

The transformed point as a new instance.

Operators

| Improve this Doc View Source

Addition(Point3, Point3)

Sums two Point3 instances.

Declaration
public static Point3 operator +(Point3 point1, Point3 point2)
Parameters
Type Name Description
Point3 point1

A point.

Point3 point2

A point.

Returns
Type Description
Point3

A new point that results from the addition of point1 and point2.

| Improve this Doc View Source

Addition(Point3, Vector3)

Sums up a point and a vector, and returns a new point.

Declaration
public static Point3 operator +(Point3 point, Vector3 vector)
Parameters
Type Name Description
Point3 point

A point.

Vector3 vector

A vector.

Returns
Type Description
Point3

A new point that results from the addition of point and vector.

| Improve this Doc View Source

Addition(Vector3, Point3)

Sums up a point and a vector, and returns a new point.

Declaration
public static Point3 operator +(Vector3 vector, Point3 point)
Parameters
Type Name Description
Vector3 vector

A vector.

Point3 point

A point.

Returns
Type Description
Point3

A new point that results from the addition of point and vector.

| Improve this Doc View Source

Division(Point3, Double)

Divides a Point3 by a number.

Declaration
public static Point3 operator /(Point3 point, double t)
Parameters
Type Name Description
Point3 point

A point.

System.Double t

A number.

Returns
Type Description
Point3

A new point that is coordinate-wise divided by t.

| Improve this Doc View Source

Equality(Point3, Point3)

Determines whether two Point3 have equal values.

Declaration
public static bool operator ==(Point3 a, Point3 b)
Parameters
Type Name Description
Point3 a

The first point.

Point3 b

The second point.

Returns
Type Description
System.Boolean

true if the coordinates of the two points are exactly equal; otherwise false.

| Improve this Doc View Source

GreaterThan(Point3, Point3)

Determines whether the first specified point comes after (has superior sorting value than) the second point.

Coordinates evaluation priority is first X, then Y, then Z.

Declaration
public static bool operator>(Point3 a, Point3 b)
Parameters
Type Name Description
Point3 a

The first point.

Point3 b

The second point.

Returns
Type Description
System.Boolean

true if a.X is larger than b.X, or a.X == b.X and a.Y is larger than b.Y, or a.X == b.X and a.Y == b.Y and a.Z is larger than b.Z; otherwise, false.

| Improve this Doc View Source

GreaterThanOrEqual(Point3, Point3)

Determines whether the first specified point comes after (has superior sorting value than) the second point, or it is equal to it.

Coordinates evaluation priority is first X, then Y, then Z.

Declaration
public static bool operator >=(Point3 a, Point3 b)
Parameters
Type Name Description
Point3 a

The first point.

Point3 b

The second point.

Returns
Type Description
System.Boolean

true if a.X is larger than b.X, or a.X == b.X and a.Y is larger than b.Y, or a.X == b.X and a.Y == b.Y and a.Z >= b.Z; otherwise, false.

| Improve this Doc View Source

Implicit(Point3 to Point4)

Converts a point in a control point, without needing casting.

Declaration
public static implicit operator Point4(Point3 point)
Parameters
Type Name Description
Point3 point

The point.

Returns
Type Description
Point4

The control point.

| Improve this Doc View Source

Implicit(Point3 to Vector)

Converts a point in a vector, without needing casting.

Declaration
public static implicit operator Vector(Point3 point)
Parameters
Type Name Description
Point3 point

A point.

Returns
Type Description
Vector

The resulting Vector.

| Improve this Doc View Source

Implicit(Point3 to Vector3)

Converts a point in a vector, without needing casting.

Declaration
public static implicit operator Vector3(Point3 point)
Parameters
Type Name Description
Point3 point

A point.

Returns
Type Description
Vector3

The resulting vector3.

| Improve this Doc View Source

Inequality(Point3, Point3)

Determines whether two Point3 have different values.

Declaration
public static bool operator !=(Point3 a, Point3 b)
Parameters
Type Name Description
Point3 a

The first point.

Point3 b

The second point.

Returns
Type Description
System.Boolean

true if the two points differ in any coordinate; false otherwise.

| Improve this Doc View Source

LessThan(Point3, Point3)

Determines whether the first specified point comes before (has inferior sorting value than) the second point.

Coordinates evaluation priority is first X, then Y, then Z.

Declaration
public static bool operator <(Point3 a, Point3 b)
Parameters
Type Name Description
Point3 a

The first point.

Point3 b

The second point.

Returns
Type Description
System.Boolean

true if a.X is smaller than b.X, or a.X == b.X and a.Y is smaller than b.Y, or a.X == b.X and a.Y == b.Y and a.Z is smaller than b.Z; otherwise, false.

| Improve this Doc View Source

LessThanOrEqual(Point3, Point3)

Determines whether the first specified point comes before (has inferior sorting value than) the second point, or it is equal to it.

Coordinates evaluation priority is first X, then Y, then Z.

Declaration
public static bool operator <=(Point3 a, Point3 b)
Parameters
Type Name Description
Point3 a

The first point.

Point3 b

The second point.

Returns
Type Description
System.Boolean

true if a.X is smaller than b.X, or a.X == b.X and a.Y is smaller than b.Y, or a.X == b.X and a.Y == b.Y and a.Z <= b.Z; otherwise, false.

| Improve this Doc View Source

Multiply(Point3, Double)

Multiplies a Point3 by a number.

Declaration
public static Point3 operator *(Point3 point, double t)
Parameters
Type Name Description
Point3 point

A point.

System.Double t

A number.

Returns
Type Description
Point3

A new point that is coordinate-wise multiplied by t.

| Improve this Doc View Source

Multiply(Double, Point3)

Multiplies a Point3 by a number.

Declaration
public static Point3 operator *(double t, Point3 point)
Parameters
Type Name Description
System.Double t

A number.

Point3 point

A point.

Returns
Type Description
Point3

A new point that is coordinate-wise multiplied by t.

| Improve this Doc View Source

Subtraction(Point3, Point3)

Subtracts a point from another point.

Declaration
public static Vector3 operator -(Point3 point1, Point3 point2)
Parameters
Type Name Description
Point3 point1

A point.

Point3 point2

Another point.

Returns
Type Description
Vector3

A new vector that is the difference of point minus vector.

| Improve this Doc View Source

Subtraction(Point3, Vector3)

Subtracts a vector from a point.

Declaration
public static Point3 operator -(Point3 point, Vector3 vector)
Parameters
Type Name Description
Point3 point

A point.

Vector3 vector

A vector.

Returns
Type Description
Point3

A new point that is the difference of point minus vector.

| Improve this Doc View Source

UnaryNegation(Point3)

Computes the additive inverse of all coordinates in the point, and returns the new point.

Declaration
public static Point3 operator -(Point3 point)
Parameters
Type Name Description
Point3 point

A point.

Returns
Type Description
Point3

A point value that, when summed with the point input, yields the Origin.

Explicit Interface Implementations

| Improve this Doc View Source

IComparable.CompareTo(Object)

Declaration
int IComparable.CompareTo(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Int32

Implements

System.IEquatable<T>
System.IComparable<T>
System.IComparable