quad-curve.js

total 0
used 0
limit 0
/* files: ../point_src/math.js ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/point-content.js ../point_src/pointlist.js ../point_src/point.js ../point_src/events.js ../point_src/automouse.js ../point_src/stage.js ../point_src/extras.js ../point_src/random.js ../point_src/distances.js ../point_src/functions/clamp.js ../point_src/dragging.js ../point_src/setunset.js ../point_src/stroke.js ../point_src/split.js ../point_src/curve-extras.js */ class MainStage extends Stage { canvas='playspace' // live=false live = true mounted(){ // this.pa = new Point(150, 150, 100, 90) this.ma = new Point(300, 400, 100) this.mb = new Point(600, 400, 100) let lpoints = [this.ma, this.mb] this.line = new QuadraticCurve(...lpoints) this.projection = this.ma.project() this.lineStroke = new Stroke({ color: 'green' , width: 5 , dash: [7, 4] }) this.strokes.create('line', { color: 'green' , width: 5 , dash: [7, 4] }) this.dragging.add(this.ma, this.mb, this.projection) } coupling() { this.ma.lookAt(this.projection) this.ma.radius = this.ma.distanceTo(this.projection) // this.mb.rotation = this.ma.rotation + 180 } updateTip() { let { dx, dy } = get_bezier_derivative(this.ma , this.projection , this.mb, this.mb, .9) this.mb.radians = Math.atan2(dy, dx); } draw(ctx){ this.clear(ctx) this.coupling() let pos = this.mouse.position pos.pen.circle(ctx) this.ma.pen.indicator(ctx) this.mb.pen.indicator(ctx) this.projection.pen.fill(ctx, '#33DDAA') let lineStroke = this.lineStroke // // lineStroke.set(ctx) // this.strokes.set('line') // this.line.render(ctx) // this.strokes.unset('line') // // lineStroke.unset(ctx) // let off = this.strokes.line() // this.line.render(ctx) // off() this.strokes.line(()=>this.line.render(ctx)) } } ;stage = MainStage.go();
Run
Meta Data
imports ()
files ('../point_src/math.js', '../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/point-content.js', '../point_src/pointlist.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage.js', '../point_src/extras.js', '../point_src/random.js', '../point_src/distances.js', '../point_src/functions/clamp.js', '../point_src/dragging.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/split.js', '../point_src/curve-extras.js')
unused_keys ('title',)
unknown_keys ()
filepath_exists True
path quad-curve.js
filepath quad-curve.js
clean_files ('../point_src/math.js', '../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.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/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/extras.js', '../point_src/random.js', '../point_src/distances.js', '../point_src/functions/clamp.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/split.js', '../point_src/curve-extras.js')
markdown {'html': '', 'content': 'files:\n ../point_src/math.js\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/point-content.js\n ../point_src/pointlist.js\n ../point_src/point.js\n ../point_src/events.js\n ../point_src/automouse.js\n ../point_src/stage.js\n ../point_src/extras.js\n ../point_src/random.js\n ../point_src/distances.js\n ../point_src/functions/clamp.js\n ../point_src/dragging.js\n ../point_src/setunset.js\n ../point_src/stroke.js\n ../point_src/split.js\n ../point_src/curve-extras.js'}