microsoft / maker.js

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

Empty layers export to DXF #375

Open icodk opened 6 years ago

icodk commented 6 years ago

Hi I need to prepare some empty layers that will be exported to DXF together with the rest of the model. Is there a way to create empty layers with names that will just be there when imported to ex. LibraCAD ,eventually with more settings like font size etc. ?

danmarshall commented 6 years ago

I've marked this as an enhancement, so I won't get around to it until after some other work. Meanwhile, I wonder if you can get by with this workaround: using a degenerate path, meaning either:

Currently, the dxf export code will create the layer table from the paths in the drawing. Then my question is if in your process, will LibraCAD ignore these "invisible" entities?

icodk commented 6 years ago

I will try and let you know thanks

icodk commented 6 years ago

it works by using Rectangle

var l1 = new makerjs.models.Rectangle(0,0);
l1.layer='layer1';

And then in the

var model={
    models: {
        objects: otherobjects,
          l1:l1,
         }
     }