On Jul 17, 2014, at 1:08 PM, Gurwinder Singh Bains wrote:

> I am trying to render my BRL-CAD model into POV-ray.

That's fun!  I've wanted a g-pov for nearly two decades.  They're one of the 
few systems that we can actually talk CSG ...

> So I first
> convert it into stl and vrml formats then use stltopov and vrml2pov
> converters of povray to convert .stl and .wrl(vrml) file into .pov
> format file respectively. This is some how long procedure i.e. if user
> want to make some changes s/he  reconvert .g file into one of stl or
> vrml and then into .pov format.

Oh noes... that is a pretty terrible for a number of reasons.

> If BRL-CAD have g-stl, g-vrml, g-obj
> etc converter there should be a g-pov converter so that user can
> convert .g file directly into .pov format in single step.

Agreed.  Moreover, that g-pov should create Povray entities that correspond 
with our BRL-CAD primitives.  That is, they're a format that is mostly 
compatible with us.  You will not need to and should not change the underlying 
object representation during export unless you absolutely have to.

> So I started studying this. I'm taking help from g-stl.c file, g-vrml.c file.
> I wrote man page for g-pov.
> http://ctrlv.in/359073
> As there are so many variables declared in stl, vrml converter's files
> which are difficult to understand. How to proceed in this?

I would NOT suggest using g-stl or g-vrml as a learning point.  Those are 
polygonal formats.

Povray understands *objects* -- i.e., a BRL-CAD ellipsoid described by 3 
vectors is an ellipsoid with 3 vectors to Povray too, so it would be bad to 
turn that 3-vector representation into a set of polygons approximating an 
ellipsoid.  They certainly don't have all the primitives that we have, but they 
do have many, maybe even most.

I suggest looking at something like the g-xxx.c or vdeck converters.  The first 
is specifically an example converter -- that should actually work and is 
heavily commented -- that demonstrates traversing geometry while having 
awareness of primitive types.  The latter is an even more complicated 
converter, but similarly is aware of primitive types and writing out object 
data to different files (basic usage is interactive, run "vdeck moss.g" and at 
the vdeck> prompt, run "insert all.g" and "deck" and "quit", then look at the 
solids and regions files). 

Cheers!
Sean


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to