coupled-lines.js

total 0
used 0
limit 0
/* title: Coupled Lines category: binding 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/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(300, 400, 100) this.pb = new Point(500, 600, 100, 270) let lpoints = [this.pa, this.ma] let lpoints2 = [this.mb, this.pb] this.line = new BezierCurve(...lpoints) this.line2 = new BezierCurve(...lpoints2) this.projection = this.ma.project() this.projection2 = this.mb.project() this.lineStroke = new Stroke({ color: 'green' , width: 5 , dash: [7, 4] }) this.dragging.add(this.ma, this.mb, this.pa, this.pb, this.projection, this.projection2) } coupling() { this.ma.lookAt(this.projection) this.mb.rotation = this.ma.rotation + 180 } 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.pa.pen.indicator(ctx) this.pb.pen.indicator(ctx) this.projection.pen.fill(ctx, '#33DDAA') let lineStroke = this.lineStroke lineStroke.set(ctx) this.line.render(ctx) this.line2.render(ctx) lineStroke.unset(ctx) } } ;stage = MainStage.go();
Run
Meta Data
title Coupled Lines
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/curve-extras.js')
unused_keys ()
unknown_keys ('category',)
category ['binding']
filepath_exists True
path coupled-lines.js
filepath coupled-lines.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/curve-extras.js')
markdown {'html': '', 'content': 'title: Coupled Lines\ncategory: binding\nfiles:\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/curve-extras.js\n---'}