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.

  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. 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.

  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.




On Sun, Apr 6, 2014 at 9:52 AM, Sylvain L. Sauvage <
[email protected]> wrote:

> Hi all,
>
>   I sometimes want to apply an operation on several pieces
> (change color, move, realign¹, add symmetrical pieces, and so
> on).  To do this, I save my MOC in the LDR format, which is a
> quite simple text format, apply a script² and then load it back
> in Leocad.
>   But for the extra manipulations, it works well, somewhat⁴.
>
>   But, as there is work being done about groups and selections,
> I was wondering if there were also plans to (either or both):
> * allow operations on whole groups,
> * change the file format from binary to (compressed) text (but
>   not XML please).
>
>
> ––——
> ¹ Aside any obsessive-compulsive disorder, overlapping pieces
>   can cause glitches in POVRay renderings, especially with
>   transparence.
>
> ² I had also been entertaining the idea of separating Leocad’s
>   model (data classes) and file operations in a library to be
>   able to rewrite those scripts in C++, but then ... I read the
>   code!  Just kidding :oD³  My LDR-scripts are enough.
>
> ³ Well, to be honest, the handling of all the versions makes it
>   some kind of a mess.
>
> ⁴ Except that Leocad doesn’t/cannot save its groups in LDR (I
>   think it could be possible with comments but quite cumbersome
>   and okerkill) so I lose that information and must reform the
>   groups afterward (which can be a tedious operation with big
>   MOCs).
>
> --
>  Sylvain Sauvage
> _______________________________________________
> Leocad mailing list
> [email protected]
> https://list.gerf.org/listinfo/leocad
>
_______________________________________________
Leocad mailing list
[email protected]
https://list.gerf.org/listinfo/leocad

Reply via email to