Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
VentgridCircle.prototype.checkCircle = function (id, circle) {
var distanceToCenter = makerjs.measure.pointDistance([0, 0], circle.origin);
if (makerjs.round(distanceToCenter + circle.radius) <= this.radius) {
//inside
this.paths[id] = circle;
}
else if (makerjs.round(distanceToCenter - circle.radius) > this.radius) {
}
else {
//border
var arcIntersection = makerjs.path.intersection(circle, this.rim);
if (arcIntersection && arcIntersection.path1Angles.length == 2) {
var filterArc = new makerjs.paths.Arc(circle.origin, circle.radius, arcIntersection.path1Angles[1], arcIntersection.path1Angles[0]);
this.paths[id] = filterArc;
var rimArc = new makerjs.paths.Arc([0, 0], this.radius, arcIntersection.path2Angles[0], arcIntersection.path2Angles[1]);
this.paths[id + '_rim'] = rimArc;
}
}
};
VentgridCircle.prototype.checkCircle = function (id, circle) {
var distanceToCenter = makerjs.measure.pointDistance([0, 0], circle.origin);
if (makerjs.round(distanceToCenter + circle.radius) <= this.radius) {
//inside
this.paths[id] = circle;
}
else if (makerjs.round(distanceToCenter - circle.radius) > this.radius) {
}
else {
//border
var arcIntersection = makerjs.path.intersection(circle, this.rim);
if (arcIntersection && arcIntersection.path1Angles.length == 2) {
var filterArc = new makerjs.paths.Arc(circle.origin, circle.radius, arcIntersection.path1Angles[1], arcIntersection.path1Angles[0]);
this.paths[id] = filterArc;
var rimArc = new makerjs.paths.Arc([0, 0], this.radius, arcIntersection.path2Angles[0], arcIntersection.path2Angles[1]);
this.paths[id + '_rim'] = rimArc;
}
}
};
return VentgridCircle;