Skip to content

Commit 0d4079d

Browse files
committed
new build with OpenJsCad accuracy option
1 parent b5766d0 commit 0d4079d

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,10 +3013,11 @@ var MakerJs;
30133013
var depth = 0;
30143014
var depthModel;
30153015
var opts = {
3016-
extrusion: 1
3016+
extrusion: 1,
3017+
accuracy: .0001
30173018
};
30183019
MakerJs.extendObject(opts, options);
3019-
var loops = MakerJs.model.findLoops(modelToExport);
3020+
var loops = MakerJs.model.findLoops(modelToExport, options.accuracy);
30203021
while (depthModel = loops.models[depth]) {
30213022
var union = '';
30223023
for (var modelId in depthModel.models) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "makerjs",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
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": {

target/js/browser.maker.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3014,10 +3014,11 @@ var MakerJs;
30143014
var depth = 0;
30153015
var depthModel;
30163016
var opts = {
3017-
extrusion: 1
3017+
extrusion: 1,
3018+
accuracy: .0001
30183019
};
30193020
MakerJs.extendObject(opts, options);
3020-
var loops = MakerJs.model.findLoops(modelToExport);
3021+
var loops = MakerJs.model.findLoops(modelToExport, options.accuracy);
30213022
while (depthModel = loops.models[depth]) {
30223023
var union = '';
30233024
for (var modelId in depthModel.models) {

target/js/node.maker.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,10 +3013,11 @@ var MakerJs;
30133013
var depth = 0;
30143014
var depthModel;
30153015
var opts = {
3016-
extrusion: 1
3016+
extrusion: 1,
3017+
accuracy: .0001
30173018
};
30183019
MakerJs.extendObject(opts, options);
3019-
var loops = MakerJs.model.findLoops(modelToExport);
3020+
var loops = MakerJs.model.findLoops(modelToExport, options.accuracy);
30203021
while (depthModel = loops.models[depth]) {
30213022
var union = '';
30223023
for (var modelId in depthModel.models) {

target/ts/makerjs.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,10 @@ declare module MakerJs.exporter {
11351135
* Optional size of curve facets.
11361136
*/
11371137
facetSize?: number;
1138+
/**
1139+
* Optional accuracy of points.
1140+
*/
1141+
accuracy?: number;
11381142
}
11391143
}
11401144
declare module MakerJs.exporter {

0 commit comments

Comments
 (0)