microsoft / maker.js

📐⚙ 2D vector line drawing and shape modeling for CNC and laser cutters.
http://maker.js.org
Apache License 2.0
1.76k stars 265 forks source link

Model accepted by makerjs.exporter.toSVG(), but not by makerjs.exporter.toDXF() #461

Open kristianpedersen opened 4 years ago

kristianpedersen commented 4 years ago

Go to https://maker.js.org/docs/basic-drawing/#Models

Change the last two lines of code to this:

var dxf = makerjs.exporter.toDXF(model);
console.log(dxf);

I would expect a string, but all I'm getting is undefined.

danmarshall commented 4 years ago

Hello, I got some dxf output: image

kristianpedersen commented 4 years ago

Ah, the blue console does show the string - I didn't notice it there. Chrome's console however just displays undefined:

image

kristianpedersen commented 4 years ago

Here's what's happening on some client work I'm doing now:

When I pass an array of lines, it's accepted by toSVG(), but not toDXF(). Are the array items missing something that's needed to be accepted by toDXF()?

Here you can see where it's failling, and the format of the lines (objects.flat()).

image