flood-fill-teather-poly.js

total 0
used 0
limit 0
/* title: Flood fill categories: binding files: head point pointlist mouse stage dragging ../point_src/random.js ../point_src/distances.js ../point_src/tethers-vec.js ../point_src/stage-clock.js stroke --- Flood fill a PointList. In this case a range of _tethered_ points. */ addButton('Add Point',{ onclick(){ stage.addNewPoint() } }) class MainStage extends Stage { canvas='playspace' mounted(){ // this.createPoints() // this.dragging.add(...this.points, ...this.controlPoints) let pos = this.center.copy() this.point = new Point(pos.x, pos.y, 100) this.dragging.add(this.point) this.addNewPoint(pos.x + 80,pos.y + 40) this.addNewPoint(pos.x,pos.y - 90) this.addNewPoint(pos.x - 80,pos.y + 50) } addNewPoint(...pv) { let pos = (pv.length > 0)? new Point(...pv): random.within(this.point, 1) let cp = this.point.tethers.add(pos) this.dragging.add(cp) } draw(ctx){ this.clear(ctx) let p = this.point let ps = p.tethers.points if(this.clock.tick % 1 == 0) { p.tethers.step() } p.pen.indicator(ctx, {color: '#336600'}) ps.forEach((tp)=>{ p.pen.line(ctx, tp, '#880000', 2) }); // ps.pen.flood(ctx, 'purple', 'line') ps.pen.flood(ctx, 'purple', 'quadCurve', true) ps.pen.quadCurve(ctx, {color: '#5511AA', loop: true, lineWidth:3}) // ps.pen.stroke(ctx, '#DDD') // ctx.fill() ps.pen.indicator(ctx, '#33DDAA') } } ;stage = MainStage.go();
Run
Meta Data
title Flood fill
imports ()
files ('head', 'point', 'pointlist', 'mouse', 'stage', 'dragging', '../point_src/random.js', '../point_src/distances.js', '../point_src/tethers-vec.js', '../point_src/stage-clock.js', 'stroke')
unused_keys ()
unknown_keys ('categories',)
categories ['binding']
filepath_exists True
path flood-fill-teather-poly.js
filepath flood-fill-teather-poly.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage-hooks.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/random.js', '../point_src/./windings.js', '../point_src/tethers-vec.js', '../point_src/stage-clock.js', '../point_src/setunset.js', '../point_src/stroke.js')
markdown {'html': '<p>Flood fill a PointList. In this case a range of <em>tethered</em> points.</p>', 'content': 'title: Flood fill\ncategories: binding\nfiles:\n head\n point\n pointlist\n mouse\n stage\n dragging\n ../point_src/random.js\n ../point_src/distances.js\n ../point_src/tethers-vec.js\n ../point_src/stage-clock.js\n stroke\n---\n\n\nFlood fill a PointList. In this case a range of _tethered_ points.'}