Skip to content

Commit bdca3cf

Browse files
committed
Merge pull request #62 from Microsoft/dev
Dev
2 parents d77a913 + 0d4079d commit bdca3cf

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
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": {

src/core/openjscad.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,13 @@ module MakerJs.exporter {
151151
var depthModel: IModel;
152152

153153
var opts: IOpenJsCadOptions = {
154-
extrusion: 1
154+
extrusion: 1,
155+
accuracy: .0001
155156
};
156157

157158
extendObject(opts, options);
158159

159-
var loops = model.findLoops(modelToExport);
160+
var loops = model.findLoops(modelToExport, options.accuracy);
160161

161162
while (depthModel = loops.models[depth]) {
162163
var union = '';
@@ -210,6 +211,11 @@ module MakerJs.exporter {
210211
* Optional size of curve facets.
211212
*/
212213
facetSize?: number;
214+
215+
/**
216+
* Optional accuracy of points.
217+
*/
218+
accuracy?: number
213219
}
214220
}
215221

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)