CurveLocation
CurveLocation objects describe a location on Curve objects, as defined by the curve-time time, a value between 0 (beginning of the curve) and 1 (end of the curve). If the curve is part of a Path item, its index inside the path.curves array is also provided.
The class is in use in many places, such as path.getLocationAt(offset), path.getLocationOf(point), pathItem.getNearestLocation(point), pathItem.getIntersections(path), etc.
Constructors
CurveLocation(curve, time[, point])Creates a new CurveLocation object.
Parameters:
curve:Curvetime:Numberpoint:Point— optionalReturns:
CurveLocation
Properties
segmentThe segment of the curve which is closer to the described location.
Read only.
Type:
Segment
curveThe curve that this location belongs to.
Read only.
Type:
Curve
pathThe path that this locations is situated on.
Read only.
Type:
Path
indexThe index of the
curvewithin thepath.curveslist, if it is part of aPathitem.Read only.
Type:
Number
timeThe curve-time parameter, as used by various bezier curve calculations. It is value between
0(beginning of the curve) and1(end of the curve).Read only.
Type:
Number
pointThe point which is defined by the
curveandtime.Read only.
Type:
Point
offsetThe length of the path from its beginning up to the location described by this object. If the curve is not part of a path, then the length within the curve is returned instead.
Read only.
Type:
Number
curveOffsetThe length of the curve from its beginning up to the location described by this object.
Read only.
Type:
Number
intersectionThe curve location on the intersecting curve, if this location is the result of a call to
pathItem.getIntersections(path)/curve.getIntersections(curve).Read only.
Type:
CurveLocation
tangentThe tangential vector to the
curveat the given location.Read only.
Type:
Point
normalThe normal vector to the
curveat the given location.Read only.
Type:
Point
curvatureThe curvature of the
curveat the given location.Read only.
Type:
Number
distanceThe distance from the queried point to the returned location.
Read only.
Type:
NumberSee also:
curve.getNearestLocation(point)pathItem.getNearestLocation(point)
Methods
equals(location)Checks whether tow CurveLocation objects are describing the same location on a path, by applying the same tolerances as elsewhere when dealing with curve-time parameters.
Parameters:
location:CurveLocationReturns:
Boolean—trueif the locations are equal,falseotherwise
toString()Returns:
String— a string representation of the curve location
Tests
isTouching()Checks if the location is an intersection with another curve and is merely touching the other curve, as opposed to crossing it.
Returns:
Boolean—trueif the location is an intersection that is merely touching another curve,falseotherwiseSee also:
isCrossing()
isCrossing()Checks if the location is an intersection with another curve and is crossing the other curve, as opposed to just touching it.
Returns:
Boolean—trueif the location is an intersection that is crossing another curve,falseotherwiseSee also:
isTouching()
hasOverlap()Checks if the location is an intersection with another curve and is part of an overlap between the two involved paths.
Returns:
Boolean—trueif the location is an intersection that is part of an overlap between the two involved paths,falseotherwiseSee also:
isCrossing()isTouching()
Last updated
Was this helpful?