Export-Paper-Model-from-Blender icon indicating copy to clipboard operation
Export-Paper-Model-from-Blender copied to clipboard

Add support for JSON export

Open manthrax opened this issue 7 years ago • 2 comments

It would be super useful to have a JSON export! This would pave the way for post processing with offline tools.. for instance generating GCODE for laser cutters or CNC machines... Custom plotting/resizing for different output devices.. It would also facilitate making a viewer in other 3d rendering engines..

A list of exterior line segments (cutting lines) and interior line segments (scoring lines).. Something like this perhaps? (I'm not exactly sure how uv coordinates would best fit into this model but I think they could probably be a separate unique sets of UVs per triangle?)

{
    "vertices":[
       {x:100,y:100},
       {x:105,y:100},
       {x:105,y:105},
       {x:100,y:105},

       {x:200,y:200},
       {x:205,y:200},
       {x:205,y:205},
       {x:200,y:205},
    ],
    "islands":[
        {
             "exterior":[0,1,1,2,2,3,3,0],
             "interior":[2,3]
         },
        {
             "exterior":[4,5,5,6,6,7,7,4],
             "interior":[6,7]
         }
    ],
    "faces":[
       {"vertices":[0,1,2],"uvs":[{x:0,y:0},{x:1,y:0},{x:1,y:1}]},
       {"vertices":[1,3,2],"uvs":[{x:1,y:1},{x:0,y:1},{x:0,y:0}]}
    ],
}

manthrax avatar Jun 16 '18 23:06 manthrax

I've thought about this a bit more, and noticed the SVG file looks pretty easy to parse, So maybe I should just write a converter rather than changing the exporter:)

manthrax avatar Jun 16 '18 23:06 manthrax

FYI - Inkscape can process SVG and there are multiple GCODE plugins to build upon.

alpharesearch avatar Jun 17 '18 02:06 alpharesearch