Daniel:
Thanks for your input. I do development in the Linux environment (Ubuntu
14.04), so the software architecture (in the UNIX environment) I have in
mind for the library consists of the 3 components
1. cat src/conv/conv_lib/Makefile (create a conv_lib directory for the
project)
#BASE = ..
# later will modify file in-place, initially just copy src/conv/*.c to the
src/conv/conv_lib directory
BASE = .
SRC = $(BASE)/stl/stl-g.c \
$(BASE)/stl/g-stl.c \
more plug-in can be added in the future to the SRC variable in the future
2. cat src/conv/conv_lib/common.h
This is the header that stl-g.c and g-stl.c need to include (the same for
future file format as well)
The header expose the API of our internal db data structure, each file
format does not need to know the other format, but they all need to know
the internal database's structure.
3. modify stl-g.c to have
#ifdef CONV_LIB
.
.
#else
.
.
#endif
or
#ifndef CONV_LIB
int main()
{
}
#endif
so that the stand-alone should still work as before, but the library uses a
different part of the code
(some code may need to be factored out so that both branch can use)
just use gcc -DCONV_LIB in the library makefile to create the .a
PS
I will study Combinatoric Constructive Solid Geometry in the weekend, and
look at some examples in src/conv
Margaret
On Fri, Mar 4, 2016 at 12:36 AM, Daniel Roßberg <danielmrossb...@gmail.com>
wrote:
> Hi Margaret,
>
> Think of this library as a hub which converts one CAD file format to
> another with the BRL-CAD database format in the middle. Looking at
> src/conv you will see that many of the conversion algorithms are
> already available. E.g. to to go from *.stl to *.obj you would first
> use stl-g and then g-obj.
>
> I.e. such a project wouldn't be about conversion algorithms but
> software architecture: How would you design such a hub? How should
> additional file formats be added (plugged in)? How to provide a set
> of often used functionality for the converters? - And then implement
> it for some of the existing formats as a proof of concept.
>
> Regarding the "basic understanding of geometry information", for
> example: Many file formats carry a boundary representation of their
> geometric objects. BRL-CAD is based on combinatoric constructive
> solid geometry (CSG). Do you know what the difference is?
>
>
> Regards,
> Daniel
>
> 2016-03-04 7:15 GMT+01:00 Margaret Hu <margaret.ss...@gmail.com>:
> >
> >
> > My name is Margaret Hu, I am a student at Ohlone College Fremnt
> California,
> > I am interested in the project "Geometry Conversion Library"
> >
> > For the three requirement for this project
> > * Familiar with C/C++ : YES
> > * Familiar with file parsing issue (lex/yacc a plus) : YES, I know
> > flex/bison and regex
> > * Basic understanding of geometry information (will be needed for
> > understanding conversion issue) : Not sure here, perhaps it involves some
> > x,y,z coordinates? Not familiar with the various file format. I took a
> look
> > at the src/conv directory, the biggest file is obj-g.c with 3971 lines of
> > code.
> >
> > I believe the idea is, assume we have File_Format_A (FFA) File_Format_B,
> ...
> > etc. we need to first convert it into an Internal_Data_Structure that can
> > represent all the information we need to do CAD, later we can either use
> > this data structure directly or dump it into any file format.
> >
> > typedef enum {FFA, FFB, ...} Format_t;
> >
> > /*for input: */
> > Internal_Data_Structure *root;
> > switch () {
> > FFA:
> > root = parse("file.ffa", FFA);
> > break;
> > FFB:
> > root = parse("file.ffb", FFB);
> > break;
> > default:
> > }
> >
> > /*for output: */
> > int status;
> > switch () {
> > FFA:
> > status = dump(root, FFA);
> > break;
> > FFB:
> > root = dump(root, FFB);
> > break;
> > default:
> > }
> >
> >
> >
> ------------------------------------------------------------------------------
> > Site24x7 APM Insight: Get Deep Visibility into Application Performance
> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> > Monitor end-to-end web transactions and take corrective actions now
> > Troubleshoot faster and improve end-user experience. Signup Now!
> > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> > _______________________________________________
> > BRL-CAD Developer mailing list
> > brlcad-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/brlcad-devel
> >
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel