quad-loop.js

total 0
used 0
limit 0
/* --- title: Quad Curve Loop categories: quadcurve curve files: head stroke pointlist point mouse dragging stage ../point_src/curve-extras.js --- Draw a quad curve (as a loop) using the `PointList.draw.quadCurve` method. It uses `quadraticCurveTo` across all points, with loop closure */ class MainStage extends Stage { canvas='playspace' mounted(){ this.points = new PointList( [40, 240, 10] , [150, 140, 10] , [240, 220, 10] , [350, 500, 10] , [460, 200, 10] , [120, 234, 10] , [150, 100, 10] , [360, 97, 10] // , [350, 300, 10] // , [226, 340, 10] ).cast() this.dragging.addPoints(...this.points) this.points.shape.radius(200, new Point(300,300)) } draw(ctx){ this.clear(ctx) ctx.fillStyle = '#661177'; ctx.strokeStyle = '#661177'; // this.points.pen.line(ctx) this.points.pen.quadCurve(ctx, {color:undefined}, 1) // ctx.stroke() // ctx.fill() this.points[0].pen.fill(ctx) this.points.pen.indicator(ctx, {color: '#555'}) } } ;stage = MainStage.go();
Run
Meta Data
title Quad Curve Loop
imports ()
files ('head', 'stroke', 'pointlist', 'point', 'mouse', 'dragging', 'stage', '../point_src/curve-extras.js')
unused_keys ()
unknown_keys ('categories',)
categories ['quadcurve', 'curve']
filepath_exists True
path quad-loop.js
filepath quad-loop.js
clean_files ('../point_src/core/head.js', '../point_src/setunset.js', '../point_src/stroke.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/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/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/curve-extras.js')
markdown {'html': '<hr />\n<p>Draw a quad curve (as a loop) using the <code>PointList.draw.quadCurve</code> method.\nIt uses <code>quadraticCurveTo</code> across all points, with loop closure</p>', 'content': '---\ntitle: Quad Curve Loop\ncategories: quadcurve\n curve\nfiles:\n head\n stroke\n pointlist\n point\n mouse\n dragging\n stage\n ../point_src/curve-extras.js\n\n---\n\nDraw a quad curve (as a loop) using the `PointList.draw.quadCurve` method.\nIt uses `quadraticCurveTo` across all points, with loop closure'}