SignedDistance
final class SignedDistance
Package: dev.joid.tool.msdf.geometry · Module: tool-msdf · Source: SignedDistance.java
A signed distance from a point to an edge, with its orthogonality to break ties.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| SignedDistance() | Creates the farthest possible distance. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | reset() | Goes back to the farthest possible distance, without edge. |
void | set(double distance, double orthogonality, int side) | Sets the distance, its orthogonality and the side of the edge. |
void | copy(SignedDistance other) | Copies another distance, edge included. |
boolean | closerThan(SignedDistance other) | If true, this distance is shorter in absolute value, or as short with a lower orthogonality. |
int | getSide() | Returns the side of the edge that the point is on. |
double | getDistance() | Returns the signed distance. |
double | getOrthogonality() | Returns the tie-breaker between two equal distances: the lower, the closer. |
Edge | getEdge() | Returns the edge of the distance, or null. |
void | setEdge(Edge edge) | Sets the edge of the distance. |
Creation details
Section titled “Creation details”SignedDistance
Section titled “SignedDistance”SignedDistance()
Creates the farthest possible distance.
Method details
Section titled “Method details”void reset()
Goes back to the farthest possible distance, without edge.
void set(double distance, double orthogonality, int side)
Sets the distance, its orthogonality and the side of the edge.
void copy(SignedDistance other)
Copies another distance, edge included.
closerThan
Section titled “closerThan”boolean closerThan(SignedDistance other)
If true, this distance is shorter in absolute value, or as short with a lower orthogonality.
getSide
Section titled “getSide”int getSide()
Returns the side of the edge that the point is on.
getDistance
Section titled “getDistance”double getDistance()
Returns the signed distance.
getOrthogonality
Section titled “getOrthogonality”double getOrthogonality()
Returns the tie-breaker between two equal distances: the lower, the closer.
getEdge
Section titled “getEdge”Edge getEdge()
Returns the edge of the distance, or null.
setEdge
Section titled “setEdge”void setEdge(Edge edge)
Sets the edge of the distance.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
