1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-25 17:42:46 +02:00

sections 5 and 6

This commit is contained in:
Pomax
2015-12-30 16:47:44 -08:00
parent 697330ed54
commit 83ba8e1bf4
16 changed files with 2081 additions and 1134 deletions

View File

@@ -33,7 +33,6 @@ var Graphic = React.createClass({
onMouseDown={this.mouseDown}
onMouseMove={this.mouseMove}
onMouseUp={this.mouseUp}
onMouseOver={this.mouseOver}
onClick={this.mouseClick}
/>
<figcaption>{this.props.title}</figcaption>
@@ -217,6 +216,23 @@ var Graphic = React.createClass({
this.drawCoordinates(curve, offset);
},
drawHull: function(curve, t, offset) {
var hull = curve.hull(t);
if(hull.length === 6) {
this.drawLine(hull[0], hull[1], offset);
this.drawLine(hull[1], hull[2], offset);
this.drawLine(hull[3], hull[4], offset);
} else {
this.drawLine(hull[0], hull[1], offset);
this.drawLine(hull[1], hull[2], offset);
this.drawLine(hull[2], hull[3], offset);
this.drawLine(hull[4], hull[5], offset);
this.drawLine(hull[5], hull[6], offset);
this.drawLine(hull[7], hull[8], offset);
}
return hull;
},
drawCoordinates: function(curve, offset) {
offset = offset || { x:0, y:0 };
var pts = curve.points;