POV-Ray : Newsgroups : povray.binaries.images : POVEarth: Tristan da Cunha: gaps between mesh2 triangles Server Time
30 Jul 2024 02:23:59 EDT (-0400)
  POVEarth: Tristan da Cunha: gaps between mesh2 triangles (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Jörg 'Yadgar' Bleimann
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 30 Jun 2013 16:09:10
Message: <51d09066@news.povray.org>
Hi(gh)!

On 30.06.2013 21:28, Stephen wrote:

> Just a short in the dark, Jorg.
> Blender has the functionality to fill a hole in a mesh with faces.
>
> http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Modeling/Meshes/Fill_Faces
>
>
> It might help and it is free. ;-)

Yes, I heard of Blender (and sometimes even used it) - but this is 
probably not the solution, as "technically", the mesh is complete, i. e. 
no triangles are missing. It must be an accuracy or epsilon problem...

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Stephen
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 30 Jun 2013 16:25:10
Message: <51d09426@news.povray.org>

> Hi(gh)!
>
> On 30.06.2013 21:28, Stephen wrote:
>
>> Just a short in the dark, Jorg.
>> Blender has the functionality to fill a hole in a mesh with faces.
>>
>> http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Modeling/Meshes/Fill_Faces
>>
>>
>>
>> It might help and it is free. ;-)
>
> Yes, I heard of Blender (and sometimes even used it) - but this is
> probably not the solution, as "technically", the mesh is complete, i. e.
> no triangles are missing. It must be an accuracy or epsilon problem...
>
> See you in Khyberspace!
>
> Yadgar
>

As I said. It was a shot in the dark.

-- 
Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 03:03:12
Message: <51d129b0@news.povray.org>
It seems to me that the triangle are floating, the vertices not being 
joint properly together. If that is true, the solution is simple: load 
the mesh2 into Poseray, go to Groups, push the button labelled Weld 
vertices, save as mesh2 again.

Additionally, beware indeed of epsilon issues. Put the camera a little 
bit higher from the ground.

Thomas


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 04:56:21
Message: <51d14435$1@news.povray.org>
Hi(gh)!

On 01.07.2013 09:03, Thomas de Groot wrote:
> It seems to me that the triangle are floating, the vertices not being
> joint properly together.

I think they should, as this is the code for the mesh2:

#declare Earth_Slice=
mesh2
{
   vertex_vectors
   {
     xdim*ydim
     #declare row=0;
     #while (row<ydim)
       #declare col=0;
       #while (col<xdim)
         #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim, 
1-(1/(ydim*2)+row/ydim), 1>);
         // #warning concat("<",vstr(3, clrvect, ",",7,2),">")
         // #warning concat(str(col,2,0)," ",str(row,2,0))
         #declare hval=clrvect.red*65280+clrvect.green*255;
         #declare hval=-deadsea+rng/65535*hval;
         // #warning str(hval, 1, 2)
 
(rd+hval)*<sin(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim)),
                  sin(radians(latstart-row/ydim)), 
cos(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim))>*sf
         #if (!(row=ydim-1 & col=xdim-1)) // no comma after last vector
           ,
         #end
         #declare col=col+1;
       #end
       #declare row=row+1;
     #end
   }
   face_indices
   {
     (xdim-1)*(ydim-1)*2
     #declare r=0;
     #while (r<ydim-1)
       #declare c=0;
       #while (c<xdim-1)
         <r*xdim+c, r*xdim+c+1, (r+1)*xdim+c>,
         <r*xdim+c+1, (r+1)*xdim+c+1, (r+1)*xdim+c>
         #if (!(r=ydim-2 & c=xdim-2)) // no comma after last vector
           ,
         #end
         #declare c=c+1;
       #end
       #declare r=r+1;
     #end
   }
   texture
   {
     pigment { color rgb <0, 0.8, 0> }
     finish { ambient 0.1 diffuse 1 brilliance 0.4 }
   }
   double_illuminate
   translate ApproxLook*sf
}



> If that is true, the solution is simple: load
> the mesh2 into Poseray, go to Groups, push the button labelled Weld
> vertices, save as mesh2 again.

Poseray? Is it free?

> Additionally, beware indeed of epsilon issues. Put the camera a little
> bit higher from the ground.

In my current scene, the camera is placed at "pedestrian eye's height", 
i. e. 1.7 metres above ground. But the problem remains with any camera 
height - the gaps then show up as black dots on the terrain!

See you in Khyberspace!

Yadgar

Now playing: Master of Sensation (Eloy)


Post a reply to this message

From: Stephen
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 05:57:56
Message: <51d152a4$1@news.povray.org>

> Poseray? Is it free?

Yes, it is an excellent program

https://sites.google.com/site/poseray/

-- 
Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 07:19:33
Message: <51d165c5$1@news.povray.org>

> I think they should, as this is the code for the mesh2:
>
> #declare Earth_Slice=
> mesh2
> {
>    vertex_vectors
>    {
>      xdim*ydim
>      #declare row=0;
>      #while (row<ydim)
>        #declare col=0;
>        #while (col<xdim)
>          #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
> 1-(1/(ydim*2)+row/ydim), 1>);

I cannot read that ;-)

Thinking a bit more about this, meshes with loose triangles at least 
have their vertices at the /same/ locations; here there seems to be a 
gap. Either, this is already present in the original DEMs, or the math 
above for the conversion has some errors... Difficult to say.

Poseray is free indeed and it is worth a try. If it does not solve the 
issue, then other solutions have to be found. In Poseray, the tolerance 
for welding vertices can be adapted. Start with the default; if 
necessary increase the value gradually.

Thomas


Post a reply to this message

From: scott
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 08:05:27
Message: <51d17087@news.povray.org>
> #declare Earth_Slice=
> mesh2
> {
>    vertex_vectors
>    {
>      xdim*ydim
>      #declare row=0;
>      #while (row<ydim)
>        #declare col=0;
>        #while (col<xdim)
>          #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
> 1-(1/(ydim*2)+row/ydim), 1>);
>          // #warning concat("<",vstr(3, clrvect, ",",7,2),">")
>          // #warning concat(str(col,2,0)," ",str(row,2,0))
>          #declare hval=clrvect.red*65280+clrvect.green*255;
>          #declare hval=-deadsea+rng/65535*hval;
>          // #warning str(hval, 1, 2)
>
> (rd+hval)*<sin(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim)),
>
>                   sin(radians(latstart-row/ydim)),
> cos(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim))>*sf

I would put something very simple like this for debug purposes:

<row,col,hval>

...

>    face_indices
>    {
>      (xdim-1)*(ydim-1)*2
>      #declare r=0;
>      #while (r<ydim-1)
>        #declare c=0;
>        #while (c<xdim-1)
>          <r*xdim+c, r*xdim+c+1, (r+1)*xdim+c>,
>          <r*xdim+c+1, (r+1)*xdim+c+1, (r+1)*xdim+c>

That looks fine to me.

Put your camera in a suitable location for the above debug mesh to show 
up, and put a constant coloured background so that you can see the 
difference between shadowed areas and areas not rendered properly.

Assuming the above test works then I would gradually build back up to 
your equations (maybe first changing the scale to match, then 
introducing the trig) to see what causes the problems.

My guess is accuracy because you are dealing with a huge dynamic range 
of dimensions.


Post a reply to this message

From: scott
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 08:20:39
Message: <51d17417$1@news.povray.org>
>>    vertex_vectors
>>    {
>>      xdim*ydim
>>      #declare row=0;
>>      #while (row<ydim)
>>        #declare col=0;
>>        #while (col<xdim)
>>          #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
>> 1-(1/(ydim*2)+row/ydim), 1>);
>
> I cannot read that ;-)
>
> Thinking a bit more about this, meshes with loose triangles at least
> have their vertices at the /same/ locations; here there seems to be a
> gap. Either, this is already present in the original DEMs, or the math
> above for the conversion has some errors... Difficult to say.

Even if it has errors it shouldn't introduce gaps as he is using 
face_indices to reference the vertices (all 6 triangles using that 
vertex will have exactly the same value, even if it is an incorrect value).


Post a reply to this message

From: Nekar Xenos
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 1 Jul 2013 15:40:03
Message: <op.wzj58xdxufxv4h@xena>
I would love to visit Tristan da Cunha one day :)

There are so many beautiful and interesting features on this island. My  
first impression on Google Earth was "dead, dry and boring" until I took a  
closer look.

-- 
-Nekar Xenos-


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVEarth: Tristan da Cunha: gaps between mesh2 triangles
Date: 2 Jul 2013 01:39:32
Message: <51d26794@news.povray.org>
Hi(gh)!

On 01.07.2013 21:39, Nekar Xenos wrote:
> I would love to visit Tristan da Cunha one day :)

Same with me... but it is, at least from Europe, even further away and 
more difficult to reach than Afghanistan! And there are many more 
interesting islands in the southern temperate and subantarctic zone... 
ever heard of Amsterdam Island? It's somehow Tristan da Cunha's 
counterpart in the Indian Ocean!

All these islands appear interesting to render within my megalomaniac 
POVEarth project... especially when it comes to vegetation and fauna 
(any albatross model ready?)!

See you in Khyberspace!

Yadgar


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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