Gurwinder,
Any progress on the g-pov converter? Here are some responses to your previous
comments about our .asc and .g file formats that hopefully clarify some
apparent confusions.
> Because I want to know how and why headers and footers are stored in binary.
>
How? Bytes are written using standard I/O routines for writing out binary data.
Why? Because it’s a compact binary file format and it’s what the specification
dictates.
Our ascii file format has very little relation with our binary file format …
they describe geometry in dramatically different ways.
> I have read in documentation of BRL-CAD BRL-CAD database "All objects share
> certain common properties, which are stored in a standardized object wrapper
> consisting of an Object Header and an Object Footer.". So when I run g2asc,
> it converts but header and footer are not written in converted .asc file.
>
It doesn’t need to do anything with the object header and object footer because
the .asc file format has very little relation with the .g file format. You
might as well be comparing .pnm files with .png files.
> >There are not flex and bison files for parsing our binary .g file format.
> There doesn’t exist a BNF either, so creating a formalized
> >parser that way would be quite complicated.
>
> But e.g. In /brlcad/misc/tools/perplex/ there is a file named as parser.y and
> in /brlcad/src/mged/points/ there is points_scan.l file.
>
These are irrelevant There’s a lot of code in BRL-CAD, many parsers for
different purposes. The two you found have absolutely nothing to do with the
.asc or .g file formats.
> Why headers are not written in asc, why headers are in binary? Or its only
> for storing information of object? Is header used for telling how object is
> stored and how much space does it occupy?
>
Because the .asc file format has no direct relationship with the .g file
format. Why is a png header written in binary? Same reason.
> Yes, there are other formats that helps me in g-pov and I am taking help from
> these also, but its not related to our g-pov. As a user, there is a question
> in mind that why headers are only in binary not in text? :)
>
Hopefully the above answers clear up some confusion? In terms of conversion,
your questions are just as unusual if you replace .asc with .pnm and .g with
.png .. why is because that’s what the specification dictates, what is most
efficient, what reduces I/O overhead, what takes up the least amount of space,
what has a direct correlation with in-memory structures, and more.
In terms of writing a converter, you absolutely shouldn’t be worrying about the
.g file format. It’s a non sequitor distraction. You should be using the
librt API for reading/writing object data.
Cheers!
Sean
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel