public class AxesLocation
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static AxesLocation |
zero |
Constructor and Description |
---|
AxesLocation()
Create an empty AxesLocation.
|
AxesLocation(Axis axis,
double coordinate)
Create a single Axis/coordinate pair AxesLocation.
|
AxesLocation(Axis axis,
Length coordinate)
Create a single Axis/Length coordinate pair AxesLocation.
|
AxesLocation(java.util.function.BiFunction<java.lang.Double,java.lang.Double,java.lang.Double> function,
AxesLocation... axesLocation)
Using the given binary function, aggregate the given axesLocation argument list.
|
AxesLocation(CoordinateAxis... axis)
Create an AxesLocation with the given CoordinateAxis argument list and initialize to the current
coordinates (i.e.
|
AxesLocation(java.util.function.Function<java.lang.Double,java.lang.Double> function,
AxesLocation axesLocation)
Create a new AxesLocation with the given function applied to the coordinates of axesLocation.
|
AxesLocation(java.lang.Iterable<T> axes,
java.util.function.Function<T,Length> initializer)
Create an AxesLocation with the given typed Axis Iterable and initialize coordinates with the given function.
|
AxesLocation(java.util.List<CoordinateAxis> axes)
Create an AxesLocation with the given Axis List and initialize to the current
coordinates (i.e.
|
AxesLocation(Machine machine)
Create an AxesLoaction over all the ControllerAxes of the machine and initialize to the current
coordinates (i.e.
|
AxesLocation(Machine machine,
Driver driver,
java.util.function.Function<ControllerAxis,Length> initializer)
Create an AxesLoaction over all the ControllerAxes of the machine (in Machine Setup order) and with the given driver.
|
AxesLocation(Machine machine,
java.util.function.Function<CoordinateAxis,Length> initializer)
Create an AxesLoaction over all the CoordinateAxes of the machine (in Machine Setup order).
|
Modifier and Type | Method and Description |
---|---|
AxesLocation |
add(AxesLocation other) |
AxesLocation |
along(AxesLocation other)
Returns this vector projected perpendicularly onto the other.
|
AxesLocation |
byType(Axis.Type... types)
Filter those axes from the AxesLocation that have one of the given Axis.Types.
|
boolean |
contains(Axis axis) |
double |
dotProduct(AxesLocation other)
Returns the dot product of this AxesLocation with the other, both treated as vectors.
|
AxesLocation |
drivenBy(Driver driver)
Filter those axes from the AxesLocation that are driven by the given driver.
|
java.util.Set<Axis> |
getAxes()
Return all the axes from the AxesLocation.
|
<T extends Axis> |
getAxes(java.lang.Class<T> axisClass)
Get those axes from the AxesLocation that are of the given axisClass.
|
java.util.LinkedHashSet<ControllerAxis> |
getAxes(Driver driver)
Get those axes from the AxesLocation that are driven by the given driver.
|
java.util.List<Driver> |
getAxesDrivers(Machine machine)
Get the drivers of all the ControllerAxes in this AxesLocation.
|
CoordinateAxis |
getAxis(Axis.Type axisType) |
ControllerAxis |
getAxis(Driver driver,
Axis.Type axisType)
From the AxisLocation, return the driver axis of the given type.
|
ControllerAxis |
getAxisByVariable(Driver driver,
java.lang.String variable)
From the AxisLocation, return the driver axis with the specified variable name.
|
java.util.LinkedHashSet<ControllerAxis> |
getControllerAxes()
Get all the axes from the AxesLocation that are ControllerAxis.
|
double |
getCoordinate(Axis axis)
Get the coordinate for the given axis from the AxesLocation.
|
double |
getCoordinate(Axis axis,
LengthUnit units)
Get the coordinate for the given axis from the AxesLocation, converted to the given length units.
|
double |
getEuclideanMetric()
Returns the Euclidean metric i.e.
|
Triplet<java.lang.Double,java.lang.Double,java.lang.Double> |
getEuclideanMetric(Driver driver,
java.util.function.Function<ControllerAxis,java.lang.Double> f)
Get the Euclidean metric i.e.
|
Length |
getLengthCoordinate(Axis axis)
Get the coordinate for the given axis from the AxesLocation as a Length.
|
java.lang.Double |
getRS274NGCMetric(Driver driver,
java.util.function.Function<ControllerAxis,java.lang.Double> f)
Get the metric according to NIST RS274NGC Interpreter - Version 3, Section 2.1.2.5 (p.
|
AxesLocation |
getTypedLocation(Location location)
Based on the mapped axes in this, substitute coordinates by Axis.Type to convert a Location to
an AxisLocation.
|
static LengthUnit |
getUnits()
All coordinates of AxesLoactions are handled as Millimeters to speed up calculations and allow for
multi-axis transforms across drivers with different units and other universal vector math.
|
boolean |
isEmpty() |
boolean |
isInSafeZone() |
boolean |
matches(AxesLocation other)
Returns true if the coordinates of this location match the other's.
|
AxesLocation |
motionSegmentTo(AxesLocation location1)
Create a distance vector over ControllerAxes that are both contained in this and location1
and that are not matching in coordinates.
|
AxesLocation |
multiply(double factor) |
AxesLocation |
put(AxesLocation other) |
void |
setToCoordinates()
Set this AxesLocation to the axes as the current (planned) location.
|
void |
setToDriverCoordinates(Driver driver)
Set this AxesLocation to the axes of the given driver as the current driver location.
|
int |
size() |
AxesLocation |
subtract(AxesLocation other) |
java.lang.String |
toString() |
public static final AxesLocation zero
public AxesLocation()
public AxesLocation(Axis axis, double coordinate)
axis
- coordinate
- public AxesLocation(Axis axis, Length coordinate)
axis
- coordinate
- public AxesLocation(CoordinateAxis... axis)
axes
- public AxesLocation(java.util.List<CoordinateAxis> axes)
axes
- public AxesLocation(java.lang.Iterable<T> axes, java.util.function.Function<T,Length> initializer)
T
- axes
- initializer
- public AxesLocation(Machine machine)
machine
- public AxesLocation(Machine machine, java.util.function.Function<CoordinateAxis,Length> initializer)
machine
- initializer
- public AxesLocation(Machine machine, Driver driver, java.util.function.Function<ControllerAxis,Length> initializer)
machine
- driver
- initializer
- public AxesLocation(java.util.function.BiFunction<java.lang.Double,java.lang.Double,java.lang.Double> function, AxesLocation... axesLocation)
function
- axesLocation
- public AxesLocation(java.util.function.Function<java.lang.Double,java.lang.Double> function, AxesLocation axesLocation)
function
- axesLocation
- public static final LengthUnit getUnits()
public AxesLocation add(AxesLocation other)
public AxesLocation subtract(AxesLocation other)
public AxesLocation multiply(double factor)
public AxesLocation put(AxesLocation other)
public double dotProduct(AxesLocation other)
other
- public AxesLocation along(AxesLocation other)
other
- public AxesLocation drivenBy(Driver driver)
driver
- public AxesLocation byType(Axis.Type... types)
types
- public java.util.Set<Axis> getAxes()
public java.util.LinkedHashSet<ControllerAxis> getAxes(Driver driver)
driver
- public <T extends Axis> java.util.LinkedHashSet<T> getAxes(java.lang.Class<T> axisClass)
axisClass
- public java.util.LinkedHashSet<ControllerAxis> getControllerAxes()
driver
- public boolean contains(Axis axis)
public boolean matches(AxesLocation other)
driver
- other
- public int size()
public boolean isEmpty()
public void setToCoordinates()
public void setToDriverCoordinates(Driver driver)
driver
- public double getCoordinate(Axis axis)
axis
- public double getCoordinate(Axis axis, LengthUnit units)
axis
- units
- public Length getLengthCoordinate(Axis axis)
axis
- public java.lang.String toString()
toString
in class java.lang.Object
public AxesLocation getTypedLocation(Location location) throws java.lang.Exception
location
- java.lang.Exception
public java.util.List<Driver> getAxesDrivers(Machine machine)
machine
- public ControllerAxis getAxis(Driver driver, Axis.Type axisType) throws java.lang.Exception
driver
- axisType
- java.lang.Exception
public CoordinateAxis getAxis(Axis.Type axisType) throws java.lang.Exception
java.lang.Exception
public ControllerAxis getAxisByVariable(Driver driver, java.lang.String variable) throws java.lang.Exception
variable
- The name of the variable.java.lang.Exception
- If the variable names are unassigned or not unique within the mapped axes.public boolean isInSafeZone()
public AxesLocation motionSegmentTo(AxesLocation location1)
location1
- public double getEuclideanMetric()
public Triplet<java.lang.Double,java.lang.Double,java.lang.Double> getEuclideanMetric(Driver driver, java.util.function.Function<ControllerAxis,java.lang.Double> f)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.f
- The function to be applied to the AxesLocation to obtain the metric.public java.lang.Double getRS274NGCMetric(Driver driver, java.util.function.Function<ControllerAxis,java.lang.Double> f)
driver
- f
- https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=823374