Table of Contents

Class Point

Namespace
OpenMEPSandbox.Geometry
Assembly
OpenMEPSandbox.dll
public class Point
Inheritance
Point
Inherited Members

Methods

AssignmentMatching(List<Point>, List<Point>)

Assignments Optimize by using Hungarian Algorithm

[MultiReturn(new string[] { "assignment", "mincost" })]
public static Dictionary<string, object?> AssignmentMatching(List<Point> lcMachines, List<Point> lcDevices)

Parameters

lcMachines List<Point>

list location of machine

lcDevices List<Point>

list location of devices

Returns

Dictionary<string, object>

Permutation of list index matching optimize

AssignmentMatching(List<Point>, List<Point>, double)

Assignments Optimize by using Hungarian Algorithm

[MultiReturn(new string[] { "lines", "machines", "devices" })]
public static Dictionary<string, object?> AssignmentMatching(List<Point> lcMachines, List<Point> lcDevices, double limit = 1.7976931348623157E+308)

Parameters

lcMachines List<Point>

list location of machine

lcDevices List<Point>

list location of devices

limit double

number distance limit to break

Returns

Dictionary<string, object>

BruteForceMatching(List<Point>, List<Point>)

Assignments Optimize by using Brute Force

[MultiReturn(new string[] { "assignment", "mincost" })]
public static Dictionary<string, object?> BruteForceMatching(List<Point> lcMachines, List<Point> lcDevices)

Parameters

lcMachines List<Point>

list location of machine

lcDevices List<Point>

list location of devices

Returns

Dictionary<string, object>

minimum cost can optimize

Ceiling(Point)

Returns a new point with the larger integer values that are greater than or equal to the X, Y, and Z coordinates of the input point.

public static Point Ceiling(Point point)

Parameters

point Point

The input point.

Returns

Point

The point with the larger integer values that are greater than or equal to the X, Y, and Z coordinates of the input point.

Examples

Centroid(List<Point>)

Get the centroid of a list of points

public static Point Centroid(List<Point> points)

Parameters

points List<Point>

list of points

Returns

Point

centroid

Examples

Point.Centroid.dyn

CompareTo(Point, Point)

Compares this a point with another point. 0: if this is identical to other 1: if this is greater than other -1: if this is less than other

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

public static double CompareTo(Point point1, Point point2)

Parameters

point1 Point

the first point to use in comparison

point2 Point

the second point to use in comparison

Returns

double

value compare

Examples

Deconstruct(Point)

Deconstruct a point into its components

[MultiReturn(new string[] { "X", "Y", "Z" })]
public static Dictionary<string, object?> Deconstruct(Point point)

Parameters

point Point

the point

Returns

Dictionary<string, object>

X point

Examples

Point.Deconstruct.dyn

Euclidean(Point, Point)

return distance two points by Euclidean distance

public static double Euclidean(Point p1, Point p2)

Parameters

p1 Point

the first point

p2 Point

the second point

Returns

double

euclidean between two point

FindLocationShortest(Point, List<Point>, double)

return the closest point from a list of points by manhattan distance

[MultiReturn(new string[] { "point", "distance" })]
public static Dictionary<string, object?> FindLocationShortest(Point lcMachine, List<Point> lcDevices, double limit = 1.7976931348623157E+308)

Parameters

lcMachine Point

location of machine

lcDevices List<Point>

location of devide

limit double

max limit

Returns

Dictionary<string, object>

FindShortestRoute(List<Point>)

takes a list of 3D points as input and returns the shortest route that visits each point exactly once' https://en.wikipedia.org/wiki/Travelling_salesman_problem

public static List<Line> FindShortestRoute(List<Point> points)

Parameters

points List<Point>

the list 3d points

Returns

List<Line>

shortest route

Examples

Floor(Point)

Returns a new point with the smallest integer values that are greater than or equal to the X, Y, and Z coordinates of the input point.

public static Point Floor(Point point)

Parameters

point Point

The input point.

Returns

Point

The point with the smallest integer values that are greater than or equal to the X, Y, and Z coordinates of the input point.

Examples

GenerateRandomPointInCircle(Circle, int)

Generates an array of random 3D points inside a specified circle.

public static Point[] GenerateRandomPointInCircle(Circle circle, int numPoints)

Parameters

circle Circle

The circle to generate points inside of.

numPoints int

The number of random points to generate.

Returns

Point[]

An array of Point3d objects representing the generated random points.

Examples

GenerateRandomPointsInCube(double, double, double, int)

Generates a given number of random points within a rectangular prism (i.e., a cube with different dimensions) of the given size.

public static List<Point> GenerateRandomPointsInCube(double width, double height, double length, int numPoints)

Parameters

width double

The width of the rectangular prism (i.e., the length of the x-axis).

height double

The height of the rectangular prism (i.e., the length of the y-axis).

length double

The length of the rectangular prism (i.e., the length of the z-axis).

numPoints int

The number of random points to generate.

Returns

List<Point>

A list of randomly generated points within the rectangular prism.

Examples

GenerateRandomPointsInSphere(double, int)

Generates a given number of random points within a sphere of the given radius.

public static List<Point> GenerateRandomPointsInSphere(double radius, int numPoints)

Parameters

radius double

The radius of the sphere.

numPoints int

The number of random points to generate.

Returns

List<Point>

A list of randomly generated points within the sphere.

Examples

GenerateRandomPointsOnCircle(Circle, double)

Generates an array of random 3D points on the circumference of a specified circle.

public static List<Point> GenerateRandomPointsOnCircle(Circle circle, double numPoints)

Parameters

circle Circle

The circle to generate points on the circumference of.

numPoints double

The number of random points to generate.

Returns

List<Point>

An array of Point3d objects representing the generated random points.

Examples

IsInPolygon(Point, Polygon)

Returns whether an input point is contained within the polygon. If the polygon is not planar then the point will be projected onto the best-fit plane and the containment will be computed using the projection of the polygon onto the best-fit plane. This will return a failed status if the polygon self-intersects.

[NodeCategory("Query")]
public static bool IsInPolygon(Point point, Polygon polygon)

Parameters

point Point

the point

polygon Polygon

the polygon

Returns

bool

true if point is in polygon

Examples

Point.IsInPolygons.dyn

Exceptions

ArgumentNullException

IsInPolygonPlus(Point, Polygon)

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

public static double IsInPolygonPlus(Point point, Polygon polygon)

Parameters

point Point
polygon Polygon

Returns

double

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.

Examples

Point.IsInPolygonPlus.dyn

IsOnLine(Point, Line, double)

Test whether a point lies on a line.

[NodeCategory("Query")]
public static bool IsOnLine(Point point, Line line, double tolerance = 0.001)

Parameters

point Point

a point to check

line Line

The line to test against.

tolerance double

Default is use 1e-6

Returns

bool

Returns true if point is on line.

Examples

Point.IsOnLine.dyn

IsOnPlane(Point, Plane, double)

Test whether a point lies on a plane.

[NodeCategory("Query")]
public static bool IsOnPlane(Point point, Plane plane, double tolerance = 0.001)

Parameters

point Point

point to check

plane Plane

The plane to test against.

tolerance double

Default is use 1e-6

Returns

bool

Returns true if point is on plane.

Examples

Point.IsOnPlane.dyn

Manhattan(Point, Point)

return distance between two points by Manhattan distance

public static double Manhattan(Point p1, Point p2)

Parameters

p1 Point
p2 Point

Returns

double

manhattan distance between two point

Offset(Point, double, Vector)

Offset a point by a distance and a direction

public static Point Offset(Point point, double distance, Vector direction)

Parameters

point Point

point to offset

distance double

distance from start point to end point

direction Vector

direction to direct to

Returns

Point

new point

Examples

Point.Offset.dyn

Origin()

Gets a point with X,Y,Z = 0

public static Point Origin()

Returns

Point

point

Examples

Point.Origin.dyn

ProjectOnToLine(Point?, Line?)

Project a point onto a line

public static Point ProjectOnToLine(Point? point, Line? line)

Parameters

point Point

Point need to project

line Line

Line to project the point

Returns

Point

projected point

Examples

Point.ProjectOnToLine.dyn

ProjectOntoPlane(Point, Plane)

Project a point onto a plane

public static Point ProjectOntoPlane(Point point, Plane plane)

Parameters

point Point

point need to project

plane Plane

plane to be project

Returns

Point

new point projected on plane

Examples

Point.ProjectOntoPlane.dyn

Reflect(Point, Plane)

Reflect Point by Plane

public static Point Reflect(Point point, Plane plane)

Parameters

point Point

point need to reflect

plane Plane

plane to reflect point

Returns

Point

point has reflected

Examples

SortPointsAlongCurve(List<Point>, Curve)

Sort points along a curve

[MultiReturn(new string[] { "SortedPoints", "Indices" })]
public static Dictionary<string, object> SortPointsAlongCurve(List<Point> Points, Curve Guide)

Parameters

Points List<Point>

Points

Guide Curve

Guide curve

Returns

Dictionary<string, object>

Points sorted along a curve.

Remarks

Index map of sorted points.

SortPointsByClockwise(List<Point>, double)

Sorts a list of Point3D objects by their clockwise order relative to a center point and a specified starting angle in degrees.

public static List<Point> SortPointsByClockwise(List<Point> points, double startAngle = 0)

Parameters

points List<Point>

The list of Point3D objects to be sorted

startAngle double

The starting angle in degrees for the clockwise ordering

Returns

List<Point>

The sorted list of Point3D objects

Examples

Point.SortPointsByClockwise.dyn

SortPointsByDirection(List<Point>, Vector)

Sorts a list of 3D points by their direction relative to a specified direction vector.

public static List<Point> SortPointsByDirection(List<Point> points, Vector direction)

Parameters

points List<Point>

The list of points to be sorted.

direction Vector

The direction vector relative to which the points will be sorted.

Returns

List<Point>

A new list of points sorted by their direction relative to the specified direction vector.

Examples

Point.SortPointsByDirection.dyn