POV-Ray : Newsgroups : povray.programming : Different Objects Server Time: 10 Dec 2018 07:26:31 GMT
  Different Objects (Message 1 to 7 of 7)  
From: bakom
Subject: Different Objects
Date: 27 Jul 2014 16:10:00
Message: <web.53d523da96b2c7506f623e950@news.povray.org>
For Box in POV-ray we have to give only two values i.e. corner1 and corner2 as:

Box
{<corner1><corner2>}

Now I want to draw objects in POV-ray as shown in below links
http://ctrlv.in/363770
http://ctrlv.in/363771
These objects in BRL-CAD came under ARB (Arbitrary Convex Polyhedron).
Which path should I follow to make these four objects in POV-ray?


Post a reply to this message

From: Le Forgeron
Subject: Re: Different Objects
Date: 27 Jul 2014 16:30:29
Message: <53d52925$1@news.povray.org>
On 27/07/2014 18:08, bakom wrote:
> For Box in POV-ray we have to give only two values i.e. corner1 and corner2 as:
> 
> Box
> {<corner1><corner2>}
> 
> Now I want to draw objects in POV-ray as shown in below links
> http://ctrlv.in/363770
> http://ctrlv.in/363771
> These objects in BRL-CAD came under ARB (Arbitrary Convex Polyhedron).
> Which path should I follow to make these four objects in POV-ray?
> 

For once, I will say "mesh" (or mesh2, it's the same object with a
different syntax).

But that's only the beginning of your problem.


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

From: Le Forgeron
Subject: Re: Different Objects
Date: 27 Jul 2014 16:45:07
Message: <53d52c93$1@news.povray.org>
On 27/07/2014 18:30, Le_Forgeron wrote:
> On 27/07/2014 18:08, bakom wrote:
>> For Box in POV-ray we have to give only two values i.e. corner1 and corner2 as:
>>
>> Box
>> {<corner1><corner2>}
>>
>> Now I want to draw objects in POV-ray as shown in below links
>> http://ctrlv.in/363770
>> http://ctrlv.in/363771
>> These objects in BRL-CAD came under ARB (Arbitrary Convex Polyhedron).
>> Which path should I follow to make these four objects in POV-ray?
>>
> 
> For once, I will say "mesh" (or mesh2, it's the same object with a
> different syntax).
> 
> But that's only the beginning of your problem.
> 
> 
Another approach would be using "intersection" of "plane"s.


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

From: bakom
Subject: Re: Different Objects
Date: 29 Jul 2014 03:10:01
Message: <web.53d710285483635ec373e7b50@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> On 27/07/2014 18:30, Le_Forgeron wrote:
> > On 27/07/2014 18:08, bakom wrote:
> >> For Box in POV-ray we have to give only two values i.e. corner1 and corner2

<snip>

> >
> > For once, I will say "mesh" (or mesh2, it's the same object with a
> > different syntax).
> >
> > But that's only the beginning of your problem.
> >
> >
> Another approach would be using "intersection" of "plane"s.

I was trying to make arb5 i.e. number 1st object in this link
http://ctrlv.in/363771
I use mesh for this object (but can use mesh2 also) as

#declare Red = texture {
    pigment { color rgb<0.8, 0.2, 0.2> }
    finish { ambient 0.2 diffuse 0.5 }
  }
  #declare Green = texture {
    pigment { color rgb<0.2, 0.8, 0.2> }
    finish { ambient 0.2 diffuse 0.5 }
  }
  #declare Blue = texture {
    pigment { color rgb<0.2, 0.2, 0.8> }
    finish { ambient 0.2 diffuse 0.5 }
  }
#declare Yellow = texture {
    pigment { color rgb<0.5, 0.5, 0.5> }
    finish { ambient 0.2 diffuse 0.5 }
}
mesh
{
triangle{<0, 0, 0> <2, 2, 2> <0, 4, 0>
  texture {Red} }
  triangle{<2, 2, 2> <4, 4, 0> <0, 4, 0>
  texture {Green}}
  triangle{<2, 2, 2> <4, 4, 0> <4, 0, 0>
  texture {Blue}}
  triangle{<2, 2, 2> <0, 0, 0> <4, 0, 0>
  texture {Yellow}}
}

Now I am trying to find out how to make face i.e. 1, 2, 3, 4
in above linked screen-shot.
One way is to make plan but its more complex as I have to first calculate the
normal of that plan. Is there any other way in which I make face using at-least
two vertices?
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.


Post a reply to this message

From: FractRacer
Subject: Re: Different Objects
Date: 29 Jul 2014 08:19:30
Message: <53d75912$1@news.povray.org>
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

http://rsmith.home.xs4all.nl/software/py-stl-stl2pov.html

Lionel.

-- 
Do not judge my words, judge my actions.

---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la
protection avast! Antivirus est active.
http://www.avast.com


Post a reply to this message

From: bakom
Subject: Re: Different Objects
Date: 29 Jul 2014 09:10:00
Message: <web.53d763db5483635ef9cee77e0@news.povray.org>
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
>
> http://rsmith.home.xs4all.nl/software/py-stl-stl2pov.html
>

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.


Post a reply to this message

From: Le Forgeron
Subject: Re: Different Objects
Date: 29 Jul 2014 09:27:24
Message: <53d768fc@news.povray.org>
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
>>
>> http://rsmith.home.xs4all.nl/software/py-stl-stl2pov.html
>>
> 
> 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
the vertices.
It's just brute force combinations.

mesh2{
 vertex_vectors {
   5,
   ... // your 5 vertices coordinates here
   }
 face_indices {
   10,
   <0,1,2>,
   <0,1,3>,
   <0,1,4>,
   <0,2,3>,
   <0,2,4>,
   <0,3,4>,
   <1,2,3>,
   <1,2,4>,
   <1,3,4>,
   <2,3,4>
 }
// 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

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.