rdesign/frontend/node_modules/hachure-fill
Jeff Emmett 80f1e96e6b Fix frontend build: type errors, SDK handling, docker context
- Use jq to cleanly remove encryptid SDK from package.json in Docker
- Fix TypeScript strict mode errors in dashboard and assistant
- Add .dockerignore to exclude node_modules from build context
- Use project root as Docker build context for frontend
- Fix Traefik routing: separate frontend/api/studio paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 02:21:52 +00:00
..
bin Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
LICENSE Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
README.md Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
index.d.ts Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
package.json Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00

README.md

hachure-fill

Demo

This package calculates the hachure lined to fill a polygon. The angle of the lines and the gap between lines can be configured.

The algorithm works on convex, concave, simple, complex polygons, and polygons with holes.

preview of a polygon

Install

From npm

npm install --save hachure-fill

The package is distributed as an ES6 module.

Usage

hachureFill(points: Point[], angle: number, gap: number): Line[];

The function takes in a polygon, which is represented as an array of points (each point being a an array of 2 numbers [x, y]).

The angle sets the angle of the hachure lines in degrees.

The gap arguments sets the distance between each hachure line.

The function returns an array of lines. Each line is an array of two points.

import { hachureFill } from 'hachure-fill';

// Polygon vertices
const vertices = [
  [10, 10],
  [200, 10],
  [100, 100],
  [300, 100],
  [60, 200]
];

// Lines filling the polygon 
// at an angle of 45 degrees. 
// Lines are 10px apart.
const lines = hachureFill(vertices, 45, 10);

// Draw lines...

hachureFill(points: Point[][], angle: number, gap: number): Line[];

When dealing with Polygon with holes, you can provide an array of polygons. The outer polygon, and polygones represented each of the holes. The polygons need not be nested, but if they are, even-odd rules apply to fill the shape.