curve-line-comb.js

total 0
used 0
limit 0
/* title: Street Plot files: head pointlist point stage stroke mouse dragging ../point_src/random.js ../point_src/curve-extras.js ../point_src/split.js --- Top Down City Planning */ class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' // autoEvents = true /* Default */ mounted(){ this.a = new Point(300, 300, 50, -90) this.b = new Point(500, 500, 90, 90) // this.events.wake() let lpoints = [this.a, this.b] this.line = new BezierCurve(...lpoints) this.line.getControlPoints = function(useCache=this.useCache) { if(useCache === true && this.cachedControlPoints) { return this.cachedControlPoints } let a = this.a, b = this.b ; let cached = [ a.project(a.radius * 3) , b.project(b.radius * 3) ] this.cachedControlPoints = cached; return cached } this.line.doTips = false; this.dragging.add(this.a, this.b) } onClick(ev) { this.clickPoint = Point.from(ev) } draw(ctx){ this.clear(ctx) if (this.line.a.wasDirty || this.line.b.wasDirty) { this.bits = this.line.split(100, 1) this.bits.each.radius = 20 } this.a.pen.circle(ctx, {color:'#aaa'}) this.b.pen.circle(ctx, { color: '#aaa' }) this.bits.pen.lines(ctx, { color: '#aaa' }) this.line.render(ctx, {color: 'green', width: 3}) // this.clickPoint && this.clickPoint.pen.fill(ctx, '#880000') } } stage = MainStage.go()
Run
Meta Data
title Street Plot
imports ()
files ('head', 'pointlist', 'point', 'stage', 'stroke', 'mouse', 'dragging', '../point_src/random.js', '../point_src/curve-extras.js', '../point_src/split.js')
unused_keys ()
unknown_keys ()
filepath_exists True
path curve-line-comb.js
filepath curve-line-comb.js
clean_files ('../point_src/core/head.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/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/stage-hooks.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/events.js', '../point_src/automouse.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/curve-extras.js', '../point_src/split.js')
markdown {'html': '<p>Top Down City Planning</p>', 'content': 'title: Street Plot\nfiles:\n head\n pointlist\n point\n stage\n stroke\n mouse\n dragging\n ../point_src/random.js\n ../point_src/curve-extras.js\n ../point_src/split.js\n---\n\nTop Down City Planning'}