Move boolean composition out of kits.
This commit is contained in:
parent
4cf5faf93c
commit
3ef9aaa2e2
7 changed files with 103 additions and 42 deletions
|
@ -4,6 +4,7 @@ const TypoGeom = require("typo-geom");
|
|||
const Point = require("./point");
|
||||
const Transform = require("./transform");
|
||||
|
||||
exports.SPIRO_PRECISION = 1 / 2;
|
||||
exports.GEOMETRY_PRECISION = 1 / 4;
|
||||
exports.RECIP_GEOMETRY_PRECISION = 4;
|
||||
exports.BOOLE_RESOLUTION = 0x4000;
|
||||
|
@ -34,6 +35,18 @@ exports.OffsetCurve = class OffsetCurve {
|
|||
}
|
||||
};
|
||||
|
||||
exports.ReverseCurve = class ReverseCurve {
|
||||
constructor(original) {
|
||||
this.m_original = original;
|
||||
}
|
||||
eval(t) {
|
||||
return this.m_original.eval(1 - t);
|
||||
}
|
||||
derivative(t) {
|
||||
return -this.m_original.derivative(1 - t);
|
||||
}
|
||||
};
|
||||
|
||||
exports.convertShapeToArcs = function convertShapeToArcs(shape) {
|
||||
return shape.map(convertContourToArcs);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue