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

Save/load graph JSON #35

Open
eeropic opened this issue Jun 1, 2019 · 5 comments

Comments

@eeropic
Copy link

commented Jun 1, 2019

The ability to save and load graphs from Zdog .json files could be quite useful in the future, at least in gamedev purposes.

Arranged in a tree structure, i.e.
illustration:{
children:[
shape:{
children:[{},{}]
}
]
}

@eeropic eeropic changed the title Illustration graph serialization / deserialization [Feature request] Illustration graph serialization / deserialization Jun 1, 2019

@natemoo-re

This comment has been minimized.

Copy link

commented Jun 1, 2019

This could be accomplished using the native JSON methods, although I'm not sure if there's a particular structure that would be the most efficient.

For serialization, a toJSON method could be added to Anchor (and Illustration?). For deserialization, a method could be exposed (Zdog.parse?) which extends JSON.parse by using a custom reviver parameter.

@desandro

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.

Yeah, this one makes lots of sense.

@desandro desandro changed the title [Feature request] Illustration graph serialization / deserialization Save/load graph JSON Jun 2, 2019

@webocs

This comment has been minimized.

Copy link

commented Jun 3, 2019

I'm working on an 3D editor that will be able to write/read zdog drawings, It'll be super cool to have an official format, or even several illos. I think the JSON needs, a name for each Illustration

[
  illustration:{
    name: "SomeName"
    children:[
       shape:{
         children:[
           {...},
           {...}
        ]
      }
   ]
  },
...
]

I'm thinking about something like this..

@newbold

This comment has been minimized.

Copy link

commented Jun 4, 2019

It would also be super cool if there was a way to generate an STL file from a Zdog illustration (imagine 3D printing your Zdog creations!) or other formats (USDZ for ARKit fun!). I wouldn't imagine that kind of specialized output being a Zdog feature per se, but I'm adding this note here in case smart people can figure out how to harvest the 3D data from Zdog illustrations (or from the proposed JSON export, if that's added). ❤️

@gut4

This comment has been minimized.

Copy link

commented Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.