@@ -5,11 +5,12 @@ import {length, insertAt, insertCount, rad, mod, mapPoints, forPoints} from "../
55import { clear , drawInfo , drawClosed } from "../../render/canvas" ;
66import { genBlob } from "../../gen" ;
77import { rand } from "../../rand" ;
8+ import * as blobs2 from "../../../public/blobs" ;
89
910let animationSpeed = 2 ;
1011let animationStart = 0.3 ;
1112let debug = true ;
12- let size = 1000 ;
13+ let size = 1300 ;
1314
1415const canvas = document . createElement ( "canvas" ) ;
1516document . body . appendChild ( canvas ) ;
@@ -169,6 +170,34 @@ const testPrepLetters = (percentage: number) => {
169170 drawClosed ( ctx , debug , loopBetween ( percentage , ...prepare ( a , b ) ) ) ;
170171} ;
171172
173+ const testGen = ( ) => {
174+ const cellSideCount = 16 ;
175+ const cellSize = size / cellSideCount ;
176+ ctx . save ( ) ;
177+ ctx . strokeStyle = "#fafafa" ;
178+ ctx . fillStyle = "#f1f1f1" ;
179+ for ( let i = 0 ; i < cellSideCount ; i ++ ) {
180+ for ( let j = 0 ; j < cellSideCount ; j ++ ) {
181+ ctx . strokeRect ( i * cellSize , j * cellSize , cellSize , cellSize ) ;
182+ ctx . fill (
183+ blobs2 . canvas (
184+ {
185+ extraPoints : j ,
186+ randomness : i ,
187+ seed : i + j - i * j ,
188+ size : cellSize ,
189+ } ,
190+ {
191+ offsetX : i * cellSize ,
192+ offsetY : j * cellSize ,
193+ } ,
194+ ) ,
195+ ) ;
196+ }
197+ }
198+ ctx . restore ( ) ;
199+ } ;
200+
172201const blob = ( seed : string , count : number , scale : number , offset : Coord ) : Point [ ] => {
173202 const rgen = rand ( seed ) ;
174203 const points = genBlob ( count , ( ) => 0.3 + 0.2 * rgen ( ) ) ;
@@ -197,6 +226,7 @@ const loopBetween = (percentage: number, a: Point[], b: Point[]): Point[] => {
197226 const renderFrame = ( ) => {
198227 clear ( ctx ) ;
199228
229+ testGen ( ) ;
200230 drawInfo ( ctx , 0 , "percentage" , percentage ) ;
201231 testSplitAt ( percentage ) ;
202232 testSplitBy ( ) ;
0 commit comments