# Interfaces

Interfaces describe the shape of JavaScript objects that are accepted as arguments to functions, or are returned as results. The names of these interfaces can't be referred to in code. They exist here for documentation purposes.

## ClosestPointResult

The return type for geometry `closestPoint` queries.

## Properties

.position[Vec](https://cuttle.xyz/learn/reference/Vec)

The position of the closest point.

## ClosestPointResultWithTime

Return type for geometry `closestPoint` queries on types addressable by time, such as paths, segments, and axes.

## Properties

.position[Vec](https://cuttle.xyz/learn/reference/Vec)

The position of the closest point.

.geometry[Geometry](https://cuttle.xyz/learn/reference/Geometry)optional

Contains a reference to the geometry that `time` applies to. This is necessary when finding a closest point on a group or compound path, since `time` will apply to one of the sub-paths.

.timenumber

The position of the closest point, expressed as `time` along the path, segment or axis.

## GeometryPrimitive

Geometry types that can be intersected implement this interface.

## Methods

.positionAtTime(time)→[Vec](https://cuttle.xyz/learn/reference/Vec)

`time`

`number`

Returns the position on the primitive at `time`.

## RenderLineResult

The result type for `Font.renderLine()`.

## Properties

.advanceXnumber

The combined `advanceX` from all glyphs in this line of text. This roughly amounts to a "width" of the line and is used when horizontally aligning text.

.advanceWidthnumber

Contains the same value as `advanceX`. This property is present for compatibility with older modifiers.

.geometry[Group](https://cuttle.xyz/learn/reference/Group)

The geometry associated with this line of text.

## FontRenderOptions

Options for rendering text with a font.

## Properties

.letterSpacingnumber

Additional spacing to add in-between letters. If provided, this value will be added to the advance width of every glyph.

.thickennumber

Percent

.lineHeightnumber

Line height, percent

.connect("none" | "dots and letters" | "dots")

Connected text

.capitalize("none" | "lowercase" | "uppercase")

Text transform

.ligatures("all" | "none")

Ligatures

.startStyle("none" | "tail")

Hearts and tails

.endStyle("none" | "tail" | "heart")

.betweenStyle("auto" | "none" | "heart")

## TransformArgs

A user specified object literal specifying one or more affine transformations in 2D space.

All properties are optional. If no transform properties are specified, the transform is assumed to be the identity, meaning there would be no change after the transformation is applied.

## Properties

.position[Vec](https://cuttle.xyz/learn/reference/Vec)optional

.rotationnumberoptional

.scale(number | [Vec](https://cuttle.xyz/learn/reference/Vec))optional

.skewnumberoptional

.origin[Vec](https://cuttle.xyz/learn/reference/Vec)optional

## Transform

A collection of affine transformations in 2D space.

## Properties

.position[Vec](https://cuttle.xyz/learn/reference/Vec)

.rotationnumber

.scale[Vec](https://cuttle.xyz/learn/reference/Vec)

.skewnumber

## TransformWithOrigin

A collection of affine transformations in 2D space.

The `origin` property is used as the center of the rotation, scale, and skew transformations.

## Properties

.position[Vec](https://cuttle.xyz/learn/reference/Vec)

.rotationnumber

.scale[Vec](https://cuttle.xyz/learn/reference/Vec)

.skewnumber

.origin[Vec](https://cuttle.xyz/learn/reference/Vec)

## DistanceToIntersectOptions

The options argument type for `Geometry.distanceToIntersect`.

## Properties

.minOverlapnumberoptional

If specified, at least two intersection points must be this far apart to consider the intersection "close enough". This can be useful to ensure that the width of the overlapping region is thick enough to not break easily, for example.

## IntersectionResult

The return type for intersection queries.

## Properties

.primitive1[GeometryPrimitive](https://cuttle.xyz/learn/reference/interfaces#GeometryPrimitive)

The first geometry primitive.

.primitive2[GeometryPrimitive](https://cuttle.xyz/learn/reference/interfaces#GeometryPrimitive)

The second geometry primitive.

.time1number

The the time along the first geometry primitive where the intersection was found.

.time2number

The the time along the second geometry primitive where the intersection was found.

.position[Vec](https://cuttle.xyz/learn/reference/Vec)

The position of the intersection point.