1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-22 08:13:51 +02:00

some cleanup

This commit is contained in:
Pomax
2017-03-26 11:41:20 -07:00
parent 6d5c31517c
commit 7a8413a697
7 changed files with 40 additions and 154 deletions

View File

@@ -1,5 +1,5 @@
module.exports = {
introduction: {
window["Bezier Section Handlers"] = {
"introduction": {
handler: (function() { return {
drawQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -19,7 +19,7 @@ module.exports = {
};
}())
},
whatis: {
"whatis": {
handler: (function() { return {
setup: function(api) {
api.setPanelCount(3);
@@ -127,7 +127,7 @@ module.exports = {
};
}())
},
explanation: {
"explanation": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -183,7 +183,7 @@ module.exports = {
}()),
withKeys: true
},
control: {
"control": {
handler: (function() { return {
drawCubic: function(api) {
var curve = api.getDefaultCubic();
@@ -345,7 +345,7 @@ module.exports = {
};
}())
},
extended: {
"extended": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = new api.Bezier(70, 155, 20, 110, 100,75);
@@ -382,7 +382,7 @@ module.exports = {
};
}())
},
decasteljau: {
"decasteljau": {
handler: (function() { return {
setup: function(api) {
var points = [
@@ -421,7 +421,7 @@ module.exports = {
};
}())
},
flattening: {
"flattening": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -487,7 +487,7 @@ module.exports = {
}()),
withKeys: true
},
splitting: {
"splitting": {
handler: (function() { return {
setupCubic: function(api) {
var curve = api.getDefaultCubic();
@@ -581,7 +581,7 @@ module.exports = {
};
}())
},
reordering: {
"reordering": {
handler: (function() { var Reordering = {
statics: {
// Improve this based on http://www.sirver.net/blog/2011/08/23/degree-reduction-of-bezier-curves/
@@ -692,7 +692,7 @@ return Reordering;
}()),
withKeys: true
},
pointvectors: {
"pointvectors": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -727,7 +727,7 @@ return Reordering;
};
}())
},
components: {
"components": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -774,7 +774,7 @@ return Reordering;
};
}())
},
extremities: {
"extremities": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -830,7 +830,7 @@ return Reordering;
};
}())
},
boundingbox: {
"boundingbox": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -857,7 +857,7 @@ return Reordering;
};
}())
},
aligning: {
"aligning": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -914,7 +914,7 @@ return Reordering;
};
}())
},
tightbounds: {
"tightbounds": {
handler: (function() { return {
setupQuadratic: function(api) {
var curve = api.getDefaultQuadratic();
@@ -988,7 +988,7 @@ return Reordering;
};
}())
},
inflections: {
"inflections": {
handler: (function() { return {
setupCubic: function(api) {
var curve = new api.Bezier(135,25, 25, 135, 215,75, 215,240);
@@ -1008,7 +1008,7 @@ return Reordering;
};
}())
},
canonical: {
"canonical": {
handler: (function() { return {
setup: function(api) {
var curve = api.getDefaultCubic();
@@ -1170,7 +1170,7 @@ return Reordering;
};
}())
},
arclength: {
"arclength": {
handler: (function() { var sin = Math.sin;
var tau = Math.PI*2;
@@ -1264,7 +1264,7 @@ return {
};
}())
},
arclengthapprox: {
"arclengthapprox": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -1326,7 +1326,7 @@ return {
}()),
withKeys: true
},
tracing: {
"tracing": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -1456,7 +1456,7 @@ return {
}()),
withKeys: true
},
intersections: {
"intersections": {
handler: (function() { var min = Math.min, max = Math.max;
return {
@@ -1534,7 +1534,7 @@ return {
};
}())
},
curveintersection: {
"curveintersection": {
handler: (function() { var abs = Math.abs;
return {
@@ -1654,7 +1654,7 @@ return {
};
}())
},
abc: {
"abc": {
handler: (function() { return {
onClick: function(evt, api) {
api.t = api.curve.on({x: evt.offsetX, y: evt.offsetY},7);
@@ -1779,7 +1779,7 @@ return {
};
}())
},
moulding: {
"moulding": {
handler: (function() { var abs = Math.abs;
return {
@@ -1981,7 +1981,7 @@ return {
};
}())
},
pointcurves: {
"pointcurves": {
handler: (function() { var abs = Math.abs;
return {
@@ -2148,7 +2148,7 @@ return {
};
}())
},
catmullmoulding: {
"catmullmoulding": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -2283,7 +2283,7 @@ return {
}()),
withKeys: true
},
polybezier: {
"polybezier": {
handler: (function() { var atan2 = Math.atan2, sqrt = Math.sqrt, sin = Math.sin, cos = Math.cos;
return {
@@ -2527,7 +2527,7 @@ return {
};
}())
},
shapes: {
"shapes": {
handler: (function() { var modes;
return {
@@ -2619,7 +2619,7 @@ return {
};
}())
},
projections: {
"projections": {
handler: (function() { return {
setup: function(api) {
api.setSize(320,320);
@@ -2677,7 +2677,7 @@ return {
};
}())
},
offsetting: {
"offsetting": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -2739,7 +2739,7 @@ return {
}()),
withKeys: true
},
graduatedoffset: {
"graduatedoffset": {
handler: (function() { return {
statics: {
keyHandlingOptions: {
@@ -2780,7 +2780,7 @@ return {
}()),
withKeys: true
},
circles: {
"circles": {
handler: (function() { var sin = Math.sin,
cos = Math.cos;
@@ -2840,7 +2840,7 @@ return {
};
}())
},
circles_cubic: {
"circles_cubic": {
handler: (function() { var sin = Math.sin, cos = Math.cos, tan = Math.tan;
return {
@@ -3048,7 +3048,7 @@ return {
};
}())
},
arcapproximation: {
"arcapproximation": {
handler: (function() { var atan2 = Math.atan2, PI = Math.PI, TAU = 2*PI, cos = Math.cos, sin = Math.sin;
return {
@@ -3212,7 +3212,7 @@ return {
}()),
withKeys: true
},
bsplines: {
"bsplines": {
handler: (function() { return {
basicSketch: require('./basic-sketch'),
interpolationGraph: require('./interpolation-graph'),