Hatch
A SceneObject whose data is { "type": "hatch", …HatchRecord } — the tag plus every field of HatchRecord.
Also uses: Curve.
HatchRecord
Used by: CellType, PieceData, RenderCell.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { HatchEntity } from "./HatchEntity.js";
export type HatchRecord = {
/**
* geometry — the region entities.
*/
hatches: Array<HatchEntity>, };| field | type | optional | class | doc |
|---|---|---|---|---|
hatches | Array<HatchEntity> | no | geometry | geometry — the region entities. |
HatchEntity
Used by: HatchRecord.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Curve } from "./Curve.js";
import type { HatchFill } from "./HatchFill.js";
export type HatchEntity = {
/**
* geometry — filled region's boundary rings, in the hatch plane
* (x, y, 0).
*/
region: Curve,
/**
* geometry — maps the hatch plane (`region`'s x, y, 0) to object space;
* its in-plane axes orient `angle`/`origin`.
*/
regionTransformation: number[],
/**
* identity — the `patterns[]` record filling this region, by key.
*/
pattern?: string,
/**
* intent — paint override for this region.
*/
fill?: HatchFill,
/**
* intent — CSS colour.
*/
color?: string,
/**
* geometry — pattern origin offset in the hatch plane, mm.
*/
origin?: [number, number],
/**
* geometry — pattern rotation in the hatch plane, degrees.
*/
angle?: number,
/**
* intent — authored multiplier on the pattern spacing (1 = as authored).
*/
scale?: number,
/**
* intent — free-form record data.
*/
attributes?: Record<string, unknown>, };| field | type | optional | class | doc |
|---|---|---|---|---|
region | Curve | no | geometry | geometry — filled region's boundary rings, in the hatch plane (x, y, 0). |
regionTransformation | number[] | no | geometry | geometry — maps the hatch plane (region's x, y, 0) to object space; its in-plane axes orient angle/origin. |
pattern | string | yes | identity | identity — the patterns[] record filling this region, by key. |
fill | HatchFill | yes | intent | intent — paint override for this region. |
color | string | yes | intent | intent — CSS colour. |
origin | [number, number] | yes | geometry | geometry — pattern origin offset in the hatch plane, mm. |
angle | number | yes | geometry | geometry — pattern rotation in the hatch plane, degrees. |
scale | number | yes | intent | intent — authored multiplier on the pattern spacing (1 = as authored). |
attributes | Record<string, unknown> | yes | intent | intent — free-form record data. |
HatchFill
Used by: HatchEntity.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { GradientFillBase } from "./GradientFillBase.js";
export type HatchFill = { "type": "solid", color: string, } | { "type": "linearGradient" } & GradientFillBase | { "type": "radialGradient" } & GradientFillBase;One of:
solid: an object with the fields belowtype: "linearGradient"plus the fields ofGradientFillBasetype: "radialGradient"plus the fields ofGradientFillBase
HatchFill — solid
| field | type | optional | class | doc |
|---|---|---|---|---|
type | "solid" | no | tag | — |
color | string | no | no class | — |
GradientFillBase
Used by: HatchFill.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ColorStop } from "./ColorStop.js";
export type GradientFillBase = {
/**
* intent — the gradient ramp stops.
*/
stops: Array<ColorStop>,
/**
* geometry — gradient start point, hatch space, mm.
*/
start: [number, number],
/**
* geometry — gradient end point, hatch space, mm.
*/
end: [number, number],
/**
* intent — gradient repeat count along its axis.
*/
repeat?: number, };| field | type | optional | class | doc |
|---|---|---|---|---|
stops | Array<ColorStop> | no | intent | intent — the gradient ramp stops. |
start | [number, number] | no | geometry | geometry — gradient start point, hatch space, mm. |
end | [number, number] | no | geometry | geometry — gradient end point, hatch space, mm. |
repeat | number | yes | intent | intent — gradient repeat count along its axis. |
ColorStop
geometry — ramp position 0..1 plus a CSS colour string.
Used by: GradientFillBase.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* geometry — ramp position 0..1 plus a CSS colour string.
*/
export type ColorStop = {
/**
* geometry — ramp position 0..1 along the gradient axis.
*/
offset: number,
/**
* intent — CSS colour.
*/
color: string, };| field | type | optional | class | doc |
|---|---|---|---|---|
offset | number | no | geometry | geometry — ramp position 0..1 along the gradient axis. |
color | string | no | intent | intent — CSS colour. |
📖 2 min read