curvy-mouse-motion-line.js

total 0
used 0
limit 0
/* category: curve files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/math.js ../point_src/point-content.js ../point_src/pointlistpen.js ../point_src/pointlist.js ../point_src/point.js ../point_src/stage.js ../point_src/events.js ../point_src/automouse.js ../point_src/distances.js ../others/curve_src/curve.js ../point_src/extras.js ../point_src/curve-extras.js ../point_src/iter/alpha.js ../point_src/functions/clamp.js ../point_src/setunset.js ../point_src/stroke.js */ class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' tick = 0 mounted(){ let c = this.curvyLineA = new BezierCurve(...this.pointPair()) c.useCache = false; } pointPair() { let cumX = 0 , cumOffset = 200 , globalY = this.center.y , offset = ()=> cumX+=cumOffset , c = this.compass ; let ps = new PointList( new Point({ name: "a" // , rotation: c.right + 45 , modulusRotate: false , x: offset() , y: globalY , radius: 50 , rotation: 10 }) , new Point({ name: "b" , modulusRotate: false // , modulusRotate: true , rotation: 10 , x: offset() , y: globalY + 50 , radius: 50 }) ) return ps; } draw(ctx){ this.clear(ctx) let p = Point.mouse.position let l = this.curvyLineA let ps = l.points ps.rotate(.4) ps.lookAt(p) let currentDistance = l.a.distanceTo(l.b) * .5 let distanceClamp = (q)=> clamp(q.distanceTo(p), 20, currentDistance) ps.keyMany('radius', distanceClamp) // ps.keyMany('radius', 10) // l.a.radius = l.a.distanceTo(p) // l.b.radius = l.b.distanceTo(p) ps.pen.indicators(ctx) l.width= 5 l.color= '#00AA00' l.render(ctx) this.tick += 1 } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/math.js', '../point_src/point-content.js', '../point_src/pointlistpen.js', '../point_src/pointlist.js', '../point_src/point.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/distances.js', '../others/curve_src/curve.js', '../point_src/extras.js', '../point_src/curve-extras.js', '../point_src/iter/alpha.js', '../point_src/functions/clamp.js', '../point_src/setunset.js', '../point_src/stroke.js')
unused_keys ('title',)
unknown_keys ('category',)
category ['curve']
filepath_exists True
path curvy-mouse-motion-line.js
filepath curvy-mouse-motion-line.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/math.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointlistpen.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/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/distances.js', '../others/curve_src/curve.js', '../point_src/extras.js', '../point_src/curve-extras.js', '../point_src/iter/alpha.js', '../point_src/functions/clamp.js', '../point_src/setunset.js', '../point_src/stroke.js')
markdown {'html': '', 'content': 'category: curve\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/math.js\n ../point_src/point-content.js\n ../point_src/pointlistpen.js\n ../point_src/pointlist.js\n ../point_src/point.js\n ../point_src/stage.js\n ../point_src/events.js\n ../point_src/automouse.js\n ../point_src/distances.js\n ../others/curve_src/curve.js\n ../point_src/extras.js\n ../point_src/curve-extras.js\n ../point_src/iter/alpha.js\n ../point_src/functions/clamp.js\n ../point_src/setunset.js\n ../point_src/stroke.js'}