Skip to content
ParaShape

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>, };
fieldtypeoptionalclassdoc
hatchesArray<HatchEntity>nogeometrygeometry — 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>, };
fieldtypeoptionalclassdoc
regionCurvenogeometrygeometry — filled region's boundary rings, in the hatch plane (x, y, 0).
regionTransformationnumber[]nogeometrygeometry — maps the hatch plane (region's x, y, 0) to object space; its in-plane axes orient angle/origin.
patternstringyesidentityidentity — the patterns[] record filling this region, by key.
fillHatchFillyesintentintent — paint override for this region.
colorstringyesintentintent — CSS colour.
origin[number, number]yesgeometrygeometry — pattern origin offset in the hatch plane, mm.
anglenumberyesgeometrygeometry — pattern rotation in the hatch plane, degrees.
scalenumberyesintentintent — authored multiplier on the pattern spacing (1 = as authored).
attributesRecord<string, unknown>yesintentintent — 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:

HatchFill — solid

fieldtypeoptionalclassdoc
type"solid"notag—
colorstringnono 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, };
fieldtypeoptionalclassdoc
stopsArray<ColorStop>nointentintent — the gradient ramp stops.
start[number, number]nogeometrygeometry — gradient start point, hatch space, mm.
end[number, number]nogeometrygeometry — gradient end point, hatch space, mm.
repeatnumberyesintentintent — 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, };
fieldtypeoptionalclassdoc
offsetnumbernogeometrygeometry — ramp position 0..1 along the gradient axis.
colorstringnointentintent — CSS colour.
📖 2 min read