VectorPath

class VectorPath(val commands: IntArrayList = IntArrayList(), val data: DoubleArrayList = DoubleArrayList(), var winding: Winding = Winding.DEFAULT, var optimize: Boolean = true) : AbstractShape2D, IVectorPath, Extra

Constructors

Link copied to clipboard
constructor(commands: IntArrayList = IntArrayList(), data: DoubleArrayList = DoubleArrayList(), winding: Winding = Winding.DEFAULT, optimize: Boolean = true)

Types

Link copied to clipboard
object Command
Link copied to clipboard
object Companion
Link copied to clipboard
class Stats
Link copied to clipboard
interface Visitor

Properties

Link copied to clipboard
open override val area: Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val center: Point
Link copied to clipboard
open val closed: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var extra: ExtraType
Link copied to clipboard
Link copied to clipboard
open override var lastMovePos: Vector2D
Link copied to clipboard
open override var lastPos: Vector2D
Link copied to clipboard
Link copied to clipboard
open val perimeter: Double
Link copied to clipboard
Link copied to clipboard
open override val totalPoints: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun VectorBuilder.append(p0: Point, p1: Point, width: Double)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun arc(center: Point, r: Double, start: Angle, end: Angle, counterclockwise: Boolean = false)
Link copied to clipboard
open fun arcTo(a: Point, c: Point, r: Double)
open fun arcTo(a: Point, c: Point, r: Float)
Link copied to clipboard
fun VectorBuilder.arrow(p0: Point, p1: Point, capEnd: ArrowCap = ArrowCap.Line(null), capStart: ArrowCap = ArrowCap.NoCap)
Link copied to clipboard
fun VectorBuilder.arrowTo(p: Point, capEnd: ArrowCap = ArrowCap.Line(null), capStart: ArrowCap = ArrowCap.NoCap)
Link copied to clipboard
Link copied to clipboard
open fun circle(circle: Circle)
open fun circle(center: Point, radius: Double)
Link copied to clipboard
inline fun VectorBuilder.circle(center: Point, radius: Number)
Link copied to clipboard
open fun circleHole(circle: Circle)
open fun circleHole(center: Point, radius: Double)
Link copied to clipboard
inline fun VectorBuilder.circleHole(center: Point, radius: Number)
Link copied to clipboard
fun clear()
Link copied to clipboard
Link copied to clipboard
open override fun close()
Link copied to clipboard
open fun containsPoint(ml: Matrix, p: Point, mr: Matrix): Boolean

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

open override fun containsPoint(p: Point): Boolean
fun containsPoint(x: Double, y: Double, winding: Winding): Boolean
fun containsPoint(x: Float, y: Float, winding: Winding): Boolean
fun containsPoint(x: Int, y: Int, winding: Winding): Boolean
Link copied to clipboard
open fun cubic(o: Point, c1: Point, c2: Point, a: Point)
Link copied to clipboard
open fun cubicTo(c1x: Double, c1y: Double, c2x: Double, c2y: Double, ax: Double, ay: Double)
open fun cubicTo(c1x: Float, c1y: Float, c2x: Float, c2y: Float, ax: Float, ay: Float)
open fun cubicTo(c1x: Int, c1y: Int, c2x: Int, c2y: Int, ax: Int, ay: Int)
open override fun cubicTo(c1: Point, c2: Point, a: Point)
Link copied to clipboard
fun VectorBuilder.cubicTo(c1: Point, c2: Point, a: Point, m: Matrix = Matrix.NIL)
Link copied to clipboard
open fun curve(curve: Bezier)
Link copied to clipboard
open fun curves(curves: Curves)
open fun curves(curves: List<Curves>)
Link copied to clipboard
open override fun distance(p: Point): Double

Compute the distance to the shortest point to the edge (SDF). Negative inside. Positive outside.

open fun distance(ml: Matrix, p: Point, mr: Matrix): Double

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
open fun ellipse(ellipse: Ellipse)
open fun ellipse(bounds: Rectangle)
open fun ellipse(center: Point, radius: Size)
Link copied to clipboard
inline fun VectorPath.emitEdges(crossinline edge: (Point, Point) -> Unit)
Link copied to clipboard
inline fun VectorPath.emitPoints2(crossinline flush: (close: Boolean) -> Unit = {}, crossinline joint: (close: Boolean) -> Unit = {}, crossinline emit: (Point, move: Boolean) -> Unit)
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun <T> Extra.extraCache(name: String, block: () -> T): T
Link copied to clipboard
Link copied to clipboard
open override fun getBounds(): Rectangle
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Extra.getExtra(name: String): Any?
Link copied to clipboard
fun <T> Extra.getExtraTyped(name: String): T?
Link copied to clipboard
fun getLineIntersection(line: Line, out: LineIntersection = LineIntersection()): LineIntersection?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

open fun intersectionsWith(ml: Matrix, that: Shape2D, mr: Matrix): PointList

ml transformation matrix of this Shape2D, mr transformation matrix of the shape that

Link copied to clipboard
open fun intersectsWith(that: Shape2D): Boolean
open fun intersectsWith(ml: Matrix, that: Shape2D, mr: Matrix): Boolean
fun intersectsWith(leftMatrix: Matrix, right: VectorPath, rightMatrix: Matrix): Boolean
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun isNotEmpty(): Boolean
Link copied to clipboard
open fun line(p0: Point, p1: Point)
Link copied to clipboard
open fun lineTo(x: Double, y: Double)
open fun lineTo(x: Float, y: Float)
open fun lineTo(x: Int, y: Int)
open override fun lineTo(p: Point)
Link copied to clipboard
fun VectorBuilder.lineTo(p: Point, m: Matrix = Matrix.NIL)
Link copied to clipboard
open fun lineToH(x: Double)
Link copied to clipboard
open fun lineToV(y: Double)
Link copied to clipboard
open fun moveTo(x: Double, y: Double)
open fun moveTo(x: Float, y: Float)
open fun moveTo(x: Int, y: Int)
open override fun moveTo(p: Point)
Link copied to clipboard
fun VectorBuilder.moveTo(p: Point, m: Matrix = Matrix.NIL)
Link copied to clipboard
open fun moveToH(x: Double)
Link copied to clipboard
open fun moveToV(y: Double)
Link copied to clipboard
open override fun normalVectorAt(p: Point): Vector2D

Returns the normal vector to the shortest point to the edge

open fun normalVectorAt(ml: Matrix, p: Point, mr: Matrix): Point

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
Link copied to clipboard
open fun parallelogram(bounds: Rectangle, angle: Angle = 30.degrees, direction: Boolean = true)

Creates a parallelogram where the inner part is within bounds.

Link copied to clipboard
fun VectorBuilder.path(path: VectorPath, m: Matrix = Matrix.NIL)
Link copied to clipboard
fun VectorBuilder.polyArrows(points: PointList, capEnd: ArrowCap = ArrowCap.Line(), capStart: ArrowCap = ArrowCap.NoCap)
fun VectorBuilder.polyArrows(vararg points: Point, capEnd: ArrowCap = ArrowCap.Line(), capStart: ArrowCap = ArrowCap.NoCap)
fun VectorBuilder.polyArrows(points: List<Point>, capEnd: ArrowCap = ArrowCap.Line(), capStart: ArrowCap = ArrowCap.NoCap)

Creates a polyline from points adding arrow caps (capEnd and capStart) in each segment. Useful for displaying directed graphs

Link copied to clipboard
open fun polygon(path: PointList, close: Boolean = true)
open fun polygon(vararg path: Point, close: Boolean = true)
open fun polygon(path: List<Point>, close: Boolean = true)
Link copied to clipboard
open fun polyline(points: PointList, close: Boolean = false)
open fun polyline(vararg points: Point, close: Boolean = false)
open fun polyline(points: List<Point>, close: Boolean = false)
Link copied to clipboard
open override fun projectedPoint(p: Point): Point

Point projected to the closest edge

open fun projectedPoint(ml: Matrix, p: Point, mr: Matrix): Point

ml transformation matrix of this Shape2D, mr transformation matrix of the point p

Link copied to clipboard
open fun quad(o: Point, c: Point, a: Point)
Link copied to clipboard
open fun quadTo(cx: Double, cy: Double, ax: Double, ay: Double)
open fun quadTo(cx: Float, cy: Float, ax: Float, ay: Float)
open fun quadTo(cx: Int, cy: Int, ax: Int, ay: Int)
open override fun quadTo(c: Point, a: Point)
Link copied to clipboard
fun VectorBuilder.quadTo(c: Point, a: Point, m: Matrix = Matrix.NIL)
Link copied to clipboard
open fun rCubicTo(c1: Point, c2: Point, a: Point)
open fun rCubicTo(c1: Point, c2: Point, a: Point, relative: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun rect(rect: Rectangle)
open fun rect(rect: RectangleInt)
open fun rect(pos: Point, size: Size)
open fun rect(x: Double, y: Double, width: Double, height: Double)
open fun rect(x: Float, y: Float, width: Float, height: Float)
open fun rect(x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard
open fun rectHole(rect: Rectangle)
open fun rectHole(x: Double, y: Double, width: Double, height: Double)
open fun rectHole(x: Float, y: Float, width: Float, height: Float)
open fun rectHole(x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard
open fun regularPolygon(points: Int, radius: Double, rotated: Angle = 0.degrees, x: Double = 0.0, y: Double = 0.0)
Link copied to clipboard
open fun regularPolygonHole(points: Int, radius: Double, rotated: Angle = 0.degrees, x: Double = 0.0, y: Double = 0.0)
Link copied to clipboard
Link copied to clipboard
open fun rLineTo(delta: Point)
open fun rLineTo(a: Point, relative: Boolean)
Link copied to clipboard
open fun rLineToH(x: Double)
open fun rLineToH(x: Double, relative: Boolean)
Link copied to clipboard
open fun rLineToHV(value: Double, horizontal: Boolean)
Link copied to clipboard
open fun rLineToV(y: Double)
open fun rLineToV(y: Double, relative: Boolean)
Link copied to clipboard
open fun rMoveTo(delta: Point)
open fun rMoveTo(a: Point, relative: Boolean)
Link copied to clipboard
open fun rMoveToH(x: Double)
open fun rMoveToH(x: Double, relative: Boolean)
Link copied to clipboard
open fun rMoveToHV(value: Double, horizontal: Boolean)
Link copied to clipboard
open fun rMoveToV(y: Double)
open fun rMoveToV(y: Double, relative: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun roundRect(rect: RoundRectangle)
open fun roundRect(x: Double, y: Double, w: Double, h: Double, rx: Double, ry: Double = rx)
open fun roundRect(x: Float, y: Float, w: Float, h: Float, rx: Float, ry: Float = rx)
open fun roundRect(x: Int, y: Int, w: Int, h: Int, rx: Int, ry: Int = rx)
open fun roundRect(x: Double, y: Double, w: Double, h: Double, rtl: Double, rtr: Double, rbr: Double, rbl: Double)
Link copied to clipboard
open fun rQuadTo(c: Point, a: Point)
open fun rQuadTo(c: Point, a: Point, relative: Boolean)
Link copied to clipboard
fun scale(sx: Double, sy: Double = sx): VectorPath
Link copied to clipboard
fun Extra.setExtra(name: String, value: Any?)
Link copied to clipboard
fun setFrom(other: VectorPath)
Link copied to clipboard
open fun star(points: Int, radiusSmall: Double, radiusBig: Double, rotated: Angle = 0.degrees, x: Double = 0.0, y: Double = 0.0)
Link copied to clipboard
open fun starHole(points: Int, radiusSmall: Double, radiusBig: Double, rotated: Angle = 0.degrees, x: Double = 0.0, y: Double = 0.0)
Link copied to clipboard
fun VectorPath.strokeToFill(info: StrokeInfo, temp: StrokeToFill = StrokeToFill(), outFill: VectorPath = VectorPath(winding = Winding.NON_ZERO)): VectorPath
fun VectorPath.strokeToFill(lineWidth: Double, joins: LineJoin = LineJoin.MITER, startCap: LineCap = LineCap.BUTT, endCap: LineCap = startCap, miterLimit: Double = 4.0, lineDash: DoubleList? = null, lineDashOffset: Double = 0.0, temp: StrokeToFill = StrokeToFill(), outFill: VectorPath = VectorPath(winding = Winding.NON_ZERO)): VectorPath
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun VectorPath.toPathPointList(m: Matrix = Matrix.NIL, emitClosePoint: Boolean = false): List<PointList>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun VectorPath.toShape2DNew(closed: Boolean = true): Shape2D
Link copied to clipboard
fun VectorPath.toShape2dNew(closed: Boolean = true): Shape2D
Link copied to clipboard
fun VectorPath.toShape2DOld(closed: Boolean = true): Shape2D
Link copied to clipboard
fun VectorPath.toShape2dOld(closed: Boolean = true): Shape2D
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun VectorPath.toStrokePointsList(info: StrokeInfo, mode: StrokePointsMode = StrokePointsMode.NON_SCALABLE_POS, generateDebug: Boolean = false, forceClosed: Boolean? = null): List<StrokePoints>
Link copied to clipboard
open override fun toSvgString(): String
Link copied to clipboard
fun VectorPath.toTrapezoids(scale: Int = 1, winding: Winding = this.winding, out: FTrapezoidsInt = FTrapezoidsInt()): FTrapezoidsInt
Link copied to clipboard
open override fun toVectorPath(): VectorPath
Link copied to clipboard
open fun <T> transformed(m: Matrix, block: VectorBuilder.() -> T): T
Link copied to clipboard
inline fun transformPoints(transform: (Point) -> Point): VectorPath
Link copied to clipboard
Link copied to clipboard
inline fun visitCmds(moveTo: (Point) -> Unit, lineTo: (Point) -> Unit, quadTo: (Point, Point) -> Unit, cubicTo: (Point, Point, Point) -> Unit, close: () -> Unit)
Link copied to clipboard
inline fun visitEdges(line: (Point, Point) -> Unit, quad: (Point, Point, Point) -> Unit, cubic: (Point, Point, Point, Point) -> Unit, close: () -> Unit = {}, move: (Point) -> Unit = { }, dummy: Unit = Unit, optimizeClose: Boolean = true)
Link copied to clipboard
inline fun visitEdgesSimple(line: (Point, Point) -> Unit, cubic: (Point, Point, Point, Point) -> Unit, close: () -> Unit)
Link copied to clipboard
open fun write(curves: Curves)
open fun write(curves: List<Curves>)
fun write(path: VectorPath, transform: Matrix = Matrix.IDENTITY)
Link copied to clipboard
fun VectorBuilder.write(path: VectorPath, m: Matrix = Matrix.NIL)