Le dimanche 6 avril 2014, 16:30:19 Leonardo Zide a écrit :
>   I don't like the file format either, it's on my list of
> things to change but low priority. It was a terrible idea to
> use a binary format and now it's a nightmare to add new
> features and support different versions, plus people can't
> edit files on their own. I'd like to move to a text format
> but it's something that needs some thought.

  Yes.  Getting groups and selection lists into the data model 
is certainly a prerequisite and higher priority.

>   Unfortunately the LDraw format isn't very good for adding
> extra information, it would require a lot of custom comments
> and the file wouldn't be readable.

  Yes.  But for steps, LDR-scripts are easy because one line is 
one piece.

> I thought about json, it could be something like this:
> 
> {
>   "models" :
>   [
>     {
>       "name":"car",
>       "pieces":
>       [
>       { "id":"3005", "color":"16", "transform":"1 0 0 0 1 0 0
> 0 1", "step":"1" }
>       ]
>     }
>   ]
> }
> 
> 
>   The problem with generic formats is that they tend to be too
> verbose but it's not a big deal IMO.

  That’s why I said “no XML” ;o)
  I encourage you to look toward YAML.  It’s a superset of JSON 
and less verbose (less quotes and delimiters) and it can handle 
references (same object used several times).  Your example could 
be:

models:
- name: car
  pieces:
  - id: 3005
    color: 16
    transform: 1 0 0 0 1 0 0 0 1
    step: 1
 
>   On a side note, at some point I thought about supporting a
> script language (probably LUA) but I don't think people would
> use it.

  An easily parsable text file format would be a great enough 
leap for me.  And with a generic format, one can pick one’s 
favorite language ;o)

-- 
 Sylvain Sauvage

_______________________________________________
Leocad mailing list
[email protected]
https://list.gerf.org/listinfo/leocad

Reply via email to