On 29/07/2014 11:05, bakom wrote:
> FractRacer <lg.### [at] gmailcom> wrote:
>> Le 29/07/2014 05:08, bakom a écrit :
>>> I want to convert BRL-CAD's arb5 model's vertices into POV-ray's vertices, so I
>>> am looking into easiest way for doing it.
>> You can export your model in *.stl and use the stl2pov converter
> Its ok, I tried this. But actually I am making a converter for BRL-CAD i.e.
> g-pov which converts BRL-CAD's .g database models directly into POV-ray models.
> I want easiest ways so that if model in BRL-CAD is formed by 5 vertices (take it
> as example) then it can be converted in POV-ray models by using those vertices.
If you are not afraid of coincident surface, your object is not textured
with transparency and you do not need inside test, you can use mesh (or
rather mesh2 format) to generate the full set of triangles between all
It's just brute force combinations.
... // your 5 vertices coordinates here
// texture as usual
For N vertices, the number of face is N!/((N-3)!*3!) . (aka C(N,3) )
4 -> 4, 5-> 10, 6-> 20, 7-> 35.
You can use three loops to automatically generate the face indices,
according to N.
If you want a smarter transformation, you need to detect external
coplanar set of more than three points and choose a method to split the
polygon in triangles.
IQ of crossposters with FU: 100 / (number of groups)
IQ of crossposters without FU: 100 / (1 + number of groups)
IQ of multiposters: 100 / ( (number of groups) * (number of groups))
Post a reply to this message