Skip to content

Commit aad0705

Browse files
committed
Merge pull request #153 from Microsoft/dev
new build 0.7.7
2 parents b37a88a + d938148 commit aad0705

12 files changed

+10373
-9
lines changed

archive/browser.0.7.7.maker.js

+5,198
Large diffs are not rendered by default.

archive/node.0.7.7.maker.js

+5,029
Large diffs are not rendered by default.

index.js

+31-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ var MakerJs;
254254
*/
255255
function ofArcSpan(arc) {
256256
var endAngle = angle.ofArcEnd(arc);
257-
var a = endAngle - arc.startAngle;
257+
var a = MakerJs.round(endAngle - arc.startAngle);
258258
if (a > 360) {
259259
return noRevolutions(a);
260260
}
@@ -1755,6 +1755,36 @@ var MakerJs;
17551755
MakerJs.extendObject(options, opts);
17561756
}
17571757
model.combine = combine;
1758+
/**
1759+
* Combine 2 models, resulting in a intersection.
1760+
*
1761+
* @param modelA First model to combine.
1762+
* @param modelB Second model to combine.
1763+
*/
1764+
function combineIntersection(modelA, modelB) {
1765+
return combine(modelA, modelB, true, false, true, false);
1766+
}
1767+
model.combineIntersection = combineIntersection;
1768+
/**
1769+
* Combine 2 models, resulting in a subtraction of B from A.
1770+
*
1771+
* @param modelA First model to combine.
1772+
* @param modelB Second model to combine.
1773+
*/
1774+
function combineSubtraction(modelA, modelB) {
1775+
return combine(modelA, modelB, false, true, true, false);
1776+
}
1777+
model.combineSubtraction = combineSubtraction;
1778+
/**
1779+
* Combine 2 models, resulting in a union.
1780+
*
1781+
* @param modelA First model to combine.
1782+
* @param modelB Second model to combine.
1783+
*/
1784+
function combineUnion(modelA, modelB) {
1785+
return combine(modelA, modelB, false, true, false, true);
1786+
}
1787+
model.combineUnion = combineUnion;
17581788
})(model = MakerJs.model || (MakerJs.model = {}));
17591789
})(MakerJs || (MakerJs = {}));
17601790
var MakerJs;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "makerjs",
3-
"version": "0.7.6",
3+
"version": "0.7.7",
44
"description": "Maker.js, a Microsoft Garage project, is a JavaScript library for creating and sharing modular line drawings for CNC and laser cutters.",
55
"main": "index.js",
66
"scripts": {

playground/playground.js

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playground/playground.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playground/playground.ts

-2
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,6 @@
672672

673673
renderInWorker.requestId = new Date().valueOf();
674674

675-
console.log('requesting ' + renderInWorker.requestId);
676-
677675
var options: MakerJsPlaygroundRender.IRenderRequest = {
678676
requestId: renderInWorker.requestId,
679677
paramValues: processed.paramValues

src/core/angle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace MakerJs.angle {
6666
*/
6767
export function ofArcSpan(arc: IPathArc): number {
6868
var endAngle = angle.ofArcEnd(arc);
69-
var a = endAngle - arc.startAngle;
69+
var a = round(endAngle - arc.startAngle);
7070
if (a > 360) {
7171
return noRevolutions(a);
7272
} else {

src/core/combine.ts

+29
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,33 @@
422422
extendObject(options, opts);
423423
}
424424

425+
/**
426+
* Combine 2 models, resulting in a intersection.
427+
*
428+
* @param modelA First model to combine.
429+
* @param modelB Second model to combine.
430+
*/
431+
export function combineIntersection(modelA: IModel, modelB: IModel) {
432+
return combine(modelA, modelB, true, false, true, false);
433+
}
434+
435+
/**
436+
* Combine 2 models, resulting in a subtraction of B from A.
437+
*
438+
* @param modelA First model to combine.
439+
* @param modelB Second model to combine.
440+
*/
441+
export function combineSubtraction(modelA: IModel, modelB: IModel) {
442+
return combine(modelA, modelB, false, true, true, false);
443+
}
444+
445+
/**
446+
* Combine 2 models, resulting in a union.
447+
*
448+
* @param modelA First model to combine.
449+
* @param modelB Second model to combine.
450+
*/
451+
export function combineUnion(modelA: IModel, modelB: IModel) {
452+
return combine(modelA, modelB, false, true, false, true);
453+
}
425454
}

target/js/browser.maker.js

+31-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ var MakerJs;
421421
*/
422422
function ofArcSpan(arc) {
423423
var endAngle = angle.ofArcEnd(arc);
424-
var a = endAngle - arc.startAngle;
424+
var a = MakerJs.round(endAngle - arc.startAngle);
425425
if (a > 360) {
426426
return noRevolutions(a);
427427
}
@@ -1922,6 +1922,36 @@ var MakerJs;
19221922
MakerJs.extendObject(options, opts);
19231923
}
19241924
model.combine = combine;
1925+
/**
1926+
* Combine 2 models, resulting in a intersection.
1927+
*
1928+
* @param modelA First model to combine.
1929+
* @param modelB Second model to combine.
1930+
*/
1931+
function combineIntersection(modelA, modelB) {
1932+
return combine(modelA, modelB, true, false, true, false);
1933+
}
1934+
model.combineIntersection = combineIntersection;
1935+
/**
1936+
* Combine 2 models, resulting in a subtraction of B from A.
1937+
*
1938+
* @param modelA First model to combine.
1939+
* @param modelB Second model to combine.
1940+
*/
1941+
function combineSubtraction(modelA, modelB) {
1942+
return combine(modelA, modelB, false, true, true, false);
1943+
}
1944+
model.combineSubtraction = combineSubtraction;
1945+
/**
1946+
* Combine 2 models, resulting in a union.
1947+
*
1948+
* @param modelA First model to combine.
1949+
* @param modelB Second model to combine.
1950+
*/
1951+
function combineUnion(modelA, modelB) {
1952+
return combine(modelA, modelB, false, true, false, true);
1953+
}
1954+
model.combineUnion = combineUnion;
19251955
})(model = MakerJs.model || (MakerJs.model = {}));
19261956
})(MakerJs || (MakerJs = {}));
19271957
var MakerJs;

target/js/node.maker.js

+31-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ var MakerJs;
254254
*/
255255
function ofArcSpan(arc) {
256256
var endAngle = angle.ofArcEnd(arc);
257-
var a = endAngle - arc.startAngle;
257+
var a = MakerJs.round(endAngle - arc.startAngle);
258258
if (a > 360) {
259259
return noRevolutions(a);
260260
}
@@ -1755,6 +1755,36 @@ var MakerJs;
17551755
MakerJs.extendObject(options, opts);
17561756
}
17571757
model.combine = combine;
1758+
/**
1759+
* Combine 2 models, resulting in a intersection.
1760+
*
1761+
* @param modelA First model to combine.
1762+
* @param modelB Second model to combine.
1763+
*/
1764+
function combineIntersection(modelA, modelB) {
1765+
return combine(modelA, modelB, true, false, true, false);
1766+
}
1767+
model.combineIntersection = combineIntersection;
1768+
/**
1769+
* Combine 2 models, resulting in a subtraction of B from A.
1770+
*
1771+
* @param modelA First model to combine.
1772+
* @param modelB Second model to combine.
1773+
*/
1774+
function combineSubtraction(modelA, modelB) {
1775+
return combine(modelA, modelB, false, true, true, false);
1776+
}
1777+
model.combineSubtraction = combineSubtraction;
1778+
/**
1779+
* Combine 2 models, resulting in a union.
1780+
*
1781+
* @param modelA First model to combine.
1782+
* @param modelB Second model to combine.
1783+
*/
1784+
function combineUnion(modelA, modelB) {
1785+
return combine(modelA, modelB, false, true, false, true);
1786+
}
1787+
model.combineUnion = combineUnion;
17581788
})(model = MakerJs.model || (MakerJs.model = {}));
17591789
})(MakerJs || (MakerJs = {}));
17601790
var MakerJs;

target/ts/makerjs.d.ts

+21
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,27 @@ declare namespace MakerJs.model {
10921092
* @param farPoint Optional point of reference which is outside the bounds of both models.
10931093
*/
10941094
function combine(modelA: IModel, modelB: IModel, includeAInsideB?: boolean, includeAOutsideB?: boolean, includeBInsideA?: boolean, includeBOutsideA?: boolean, options?: ICombineOptions): void;
1095+
/**
1096+
* Combine 2 models, resulting in a intersection.
1097+
*
1098+
* @param modelA First model to combine.
1099+
* @param modelB Second model to combine.
1100+
*/
1101+
function combineIntersection(modelA: IModel, modelB: IModel): void;
1102+
/**
1103+
* Combine 2 models, resulting in a subtraction of B from A.
1104+
*
1105+
* @param modelA First model to combine.
1106+
* @param modelB Second model to combine.
1107+
*/
1108+
function combineSubtraction(modelA: IModel, modelB: IModel): void;
1109+
/**
1110+
* Combine 2 models, resulting in a union.
1111+
*
1112+
* @param modelA First model to combine.
1113+
* @param modelB Second model to combine.
1114+
*/
1115+
function combineUnion(modelA: IModel, modelB: IModel): void;
10951116
}
10961117
declare namespace MakerJs {
10971118
/**

0 commit comments

Comments
 (0)