Point3d

References
Represents the three coordinates of a point in three-dimensional space, using double-precision floating point values.

Constructors

Point3d

#ExampleSince v5.0
public Point3d(double x, double y, double z)
Initializes a new point by defining the X, Y and Z coordinates.
x (double)The value of the X (first) coordinate.
y (double)The value of the Y (second) coordinate.
z (double)The value of the Z (third) coordinate.

Point3d

#Since v5.0
public Point3d(Point3d point)
Initializes a new point by copying coordinates from another point.
point (Point3d)A point.

Point3d

#Since v5.0
public Point3d(Point3f point)
Initializes a new point by copying coordinates from a single-precision point.
point (Point3f)A point.

Point3d

#Since v5.0
public Point3d(Point4d point)
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 just discarded.
point (Point4d)A point.

Point3d

#Since v5.0
public Point3d(Vector3d vector)
Initializes a new point by copying coordinates from the components of a vector.
vector (Vector3d)A vector.

Properties

IsValid

#Since v5.0
public bool IsValid { get; }
Each coordinate of the point must pass the RhinoMath.IsValidDouble(double) test.

MaximumCoordinate

#Since v5.0
public double MaximumCoordinate { get; }
Gets the largest (both positive and negative) valid coordinate in this point, or RhinoMath.UnsetValue if no coordinate is valid, as an absolute value.

MinimumCoordinate

#Since v5.0
public double MinimumCoordinate { get; }
Gets the smallest (both positive and negative) coordinate value in this point.

Origin

#Since v5.0
public static Point3d Origin { get; }
Gets the value of a point at location 0,0,0.

Unset

#Since v5.0
public static Point3d Unset { get; }
Gets the value of a point at location RhinoMath.UnsetValue,RhinoMath.UnsetValue,RhinoMath.UnsetValue.

X

#Since v5.0
public double X { get; set; }
Gets or sets the X (first) coordinate of this point.

Y

#Since v5.0
public double Y { get; set; }
Gets or sets the Y (second) coordinate of this point.

Z

#Since v5.0
public double Z { get; set; }
Gets or sets the Z (third) coordinate of this point.

Indexers

this[]

#
public double this[int index] { get; set; }
Gets or sets an indexed coordinate of this point.
index (int)The coordinate index. Valid values are:

0 = X coordinate

1 = Y coordinate

2 = Z coordinate

.

Methods

Add

#Since v5.0
public static Point3d Add(Point3d point, Vector3d vector)
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)

point (Point3d)A point.
vector (Vector3d)A vector.
A new point that results from the addition of point and vector.

Add

#Since v5.0
public static Point3d Add(Point3d point, Vector3f vector)
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)

point (Point3d)A point.
vector (Vector3f)A vector.
A new point that results from the addition of point and vector.

Add

#Since v5.0
public static Point3d Add(Point3d point1, Point3d point2)
Sums two Point3d instances.

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

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

Add

#Since v5.0
public static Point3d Add(Vector3d vector, Point3d point)
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)

vector (Vector3d)A vector.
point (Point3d)A point.
A new point that results from the addition of point and vector.

ArePointsCoplanar

#Since v5.0
public static bool ArePointsCoplanar(IEnumerable<Point3d> points, double tolerance)
Determines whether a set of points is coplanar within a given tolerance.
points (IEnumerable<Point3d>)A list, an array or any enumerable of Point3d.
tolerance (double)A tolerance value. A default might be RhinoMath.ZeroTolerance.
true if points are on the same plane; false otherwise.

CompareTo

#Since v5.0
[ConstOperation] public int CompareTo(Point3d other)
Compares this Point3d with another Point3d.

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

other (Point3d)The other Point3d to use in comparison.

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.

CreateNoiseDistribution2D

#Since v9.0
public static Point3d[] CreateNoiseDistribution2D(int targetCount, bool useOrderedThreshold, double xMin = 0, double yMin = 0, double xMax = 1, double yMax = 1)
Generates an array of two-dimensional points distributed according to the specified blue noise type.
Remarks: The distribution and characteristics of the generated points depend on the specified noise type.
targetCount (int)The number of points to generate. Must be a positive integer. The actual count may differ because the algorithm distributes points on a grid whose row and column counts are integers derived from the target count and the region's aspect ratio.
useOrderedThreshold (bool)Use the blue noise ordered threshold (true) or the blue noise step (false) spectra for the noise distribution.
xMin (double = 0)The minimum X coordinate of the bounding rectangle.
yMin (double = 0)The minimum Y coordinate of the bounding rectangle.
xMax (double = 1)The maximum X coordinate of the bounding rectangle.
yMax (double = 1)The maximum Y coordinate of the bounding rectangle.
An array of Point3d values.

CreateNoiseDistribution3D

#Since v9.0
public static Point3d[] CreateNoiseDistribution3D(int targetCount, bool useOrderedThreshold, double xMin = 0, double yMin = 0, double zMin = 0, double xMax = 1, double yMax = 1, double zMax = 1)
Generates an array of three-dimensional points distributed according to the specified blue noise type.
Remarks: The distribution and characteristics of the generated points depend on the specified noise type.
targetCount (int)The number of points to generate. Must be a positive integer. The actual count may differ because the algorithm distributes points on a grid whose row and column counts are integers derived from the target count and the region's aspect ratio.
useOrderedThreshold (bool)Use the blue noise ordered threshold (true) or the blue noise step (false) spectra for the noise distribution.
xMin (double = 0)The minimum X coordinate of the bounding box.
yMin (double = 0)The minimum Y coordinate of the bounding box.
zMin (double = 0)The minimum Z coordinate of the bounding box.
xMax (double = 1)The maximum X coordinate of the bounding box.
yMax (double = 1)The maximum Y coordinate of the bounding box.
zMax (double = 1)The maximum Z coordinate of the bounding box.
An array of Point3d values.

CullDuplicates

#Since v5.0
public static Point3d[] CullDuplicates(IEnumerable<Point3d> points, double tolerance)
Removes duplicates in the supplied set of points.
points (IEnumerable<Point3d>)A list, an array or any enumerable of Point3d.
tolerance (double)The minimum distance between points.

Points that fall within this tolerance will be discarded.

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

DistanceTo

#ExampleSince v5.0
[ConstOperation] public double DistanceTo(Point3d other)
Computes the distance between two points.
other (Point3d)Other point for distance measurement.
The length of the line between this and the other point; or 0 if any of the points is not valid.

DistanceToSquared

#Since v6.0
[ConstOperation] public double DistanceToSquared(Point3d other)
Computes the square of the distance between two points.

This method is usually largely faster than DistanceTo().

other (Point3d)Other point for squared distance measurement.
The squared length of the line between this and the other point; or 0 if any of the points is not valid.

Divide

#Since v5.0
public static Point3d Divide(Point3d point, double t)
Divides a Point3d by a number.

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

point (Point3d)A point.
t (double)A number.
A new point that is coordinate-wise divided by t.

EpsilonEquals

#Since v5.4
[ConstOperation] public bool EpsilonEquals(Point3d other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Point3d)
epsilon (double)
EpsilonEquals

Equals

#
[ConstOperation] public override bool Equals(object obj)
Determines whether the specified object is a Point3d and has the same values as the present point.
obj (object)The specified object.
true if obj is a Point3d and has the same coordinates as this; otherwise false.
ValueType.Equals

Equals

#Since v5.0
[ConstOperation] public bool Equals(Point3d point)
Determines whether the specified Point3d has the same values as the present point.
point (Point3d)The specified point.
true if point has the same coordinates as this; otherwise false.

FromPoint3f

#Since v6.0
public static Point3d FromPoint3f(Point3f point)
Converts a single-precision point in a double-precision point.
point (Point3f)A point.
The resulting point.

GetHashCode

#
[ConstOperation] public override int GetHashCode()
Computes a hash code for the present point.
A non-unique integer that represents this point.

Interpolate

#Since v5.0
public void Interpolate(Point3d pA, Point3d pB, double t)
Interpolate between two points.
pA (Point3d)First point.
pB (Point3d)Second point.
t (double)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 between 0.0 and 1.0 result in points between pA and pB.

Multiply

#Since v5.0
public static Point3d Multiply(double t, Point3d point)
Multiplies a Point3d by a number.

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

t (double)A number.
point (Point3d)A point.
A new point that is coordinate-wise multiplied by t.

Multiply

#Since v5.0
public static Point3d Multiply(Point3d point, double t)
Multiplies a Point3d by a number.

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

point (Point3d)A point.
t (double)A number.
A new point that is coordinate-wise multiplied by t.

SortAndCullPointList

#Since v5.0
public static Point3d[] SortAndCullPointList(IEnumerable<Point3d> points, double minimumDistance)
Orders a set of points so they will be connected in a "reasonable polyline" order.

Also, removes points from the list if their common distance exceeds a specified threshold.

points (IEnumerable<Point3d>)A list, an array or any enumerable of Point3d.
minimumDistance (double)Minimum allowed distance among a pair of points. If points are closer than this, only one of them will be kept.
The new array of sorted and culled points.

Subtract

#Since v5.0
public static Point3d Subtract(Point3d point, Vector3d vector)
Subtracts a vector from a point.

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

point (Point3d)A point.
vector (Vector3d)A vector.
A new point that is the difference of point minus vector.

Subtract

#Since v5.0
public static Vector3d Subtract(Point3d point1, Point3d point2)
Subtracts a point from another point.

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

point1 (Point3d)A point.
point2 (Point3d)Another point.
A new vector that is the difference of point minus vector.
Explicit

ICloneable.Clone

#
Explicit

IComparable.CompareTo

#
[ConstOperation] int IComparable.CompareTo(object obj)
obj (object)
Explicit

ISerializable.GetObjectData

#
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
info (SerializationInfo)
context (StreamingContext)

ToString

#
[ConstOperation] public override string ToString()
Constructs the string representation for the current point.
The point representation in the form X,Y,Z.

ToString

#Since v7.0
[ConstOperation] public string ToString(string format, IFormatProvider formatProvider)
Formats the value of the current instance using the specified format.
format (string)The format to use. -or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.
formatProvider (IFormatProvider)The provider to use to format the value. -or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
The value of the current instance in the specified format.

Transform

#ExampleSince v5.0
public void Transform(Transform xform)
Transforms the present point in place. The transformation matrix acts on the left of the point. i.e.,

result = transformation*point

xform (Transform)Transformation to apply.

TryParse

#Since v6.12
public static bool TryParse(string input, out Point3d result)
Converts the string representation of a point to the equivalent Point3d structure.
input (string)The point to convert.
result (out Point3d)The structure that will contain the parsed value.
true if successful, false otherwise.

Operators

OperationResultDescription
Point3d+Vector3dPoint3dSums up a point and a vector, and returns a new point.
Point3d+Vector3fPoint3dSums up a point and a vector, and returns a new point.
Point3d+Point3dPoint3dSums two Point3d instances.
Vector3d+Point3dPoint3dSums up a point and a vector, and returns a new point.
Point3d/doublePoint3dDivides a Point3d by a number.
Point3d==Point3dboolDetermines whether two Point3d have equal values.
Point3d>Point3dboolDetermines 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.

Point3d>=Point3dboolDetermines 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.

Point3d!=Point3dboolDetermines whether two Point3d have different values.
Point3d<Point3dboolDetermines 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.

Point3d<=Point3dboolDetermines 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.

double*Point3dPoint3dMultiplies a Point3d by a number.
Point3d*doublePoint3dMultiplies a Point3d by a number.
Point3d-Vector3dPoint3dSubtracts a vector from a point.
Point3d-Point3dVector3dSubtracts a point from another point.
-Point3dPoint3dComputes the additive inverse of all coordinates in the point, and returns the new point.

Convertors

OperationResultDescription
explicitVector3dPoint3dConverts a vector in a point, needing casting.
explicitPoint3dVector3dConverts a point in a vector, needing casting.
implicitPoint3dControlPointConverts a point in a control point, without needing casting.
implicitPoint3fPoint3dConverts a single-precision point in a double-precision point, without needing casting.