Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for JSON export #60

Open
manthrax opened this issue Jun 16, 2018 · 2 comments
Open

Add support for JSON export #60

manthrax opened this issue Jun 16, 2018 · 2 comments

Comments

@manthrax
Copy link

manthrax commented Jun 16, 2018

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
Copy link
Author

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:)

@alpharesearch
Copy link
Collaborator

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

@addam addam changed the title Add support for JSON export for processing with other tools! Add support for JSON export Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants