POV-Ray : Newsgroups : povray.general : mesh help Server Time
16 Nov 2024 21:12:18 EST (-0500)
  mesh help (Message 1 to 3 of 3)  
From: Jettero Heller
Subject: mesh help
Date: 17 Aug 2003 16:00:46
Message: <slrnbjvnlb.msi.povfan@corky.voltar-confed.org>
I hope I'm doing something stupid so I can get past this and move
on with my project.  I have included some sources so you can
catch my drift...

When c=1, you'll see a cute little scene with a pyramid cut
across by a thick plane.  Excellent.  Almost what I want.  Then,
when c=2, you'll see me cutting a hole out of the plane.  Pretty
predictable stuff.

And finally, when c=3, I'm intending to cut a rhomboid thingy out
of the plane, but instead I'm getting the rhomboid as if I'd
accidentally used intersection instead of difference.

How can I cut out the rhomboid instead of ... whatever that was.

Jet


// test.pov:
#version 3.5;

#declare c = 1;

camera {
    location <-3, -1, 5>
    look_at  <5, 1, 5>
}

light_source { <-3, -1, 5> color rgb 1 }
light_source { <7, 7, 7> color rgb 1 }

object {
    #if( c = 1 ) 
        union {
    #else
        difference {
    #end
        box { <2, 0.7, 2> <8, 0.65, 8> }
        #if( c = 2 ) 
            cylinder { <5, -6, 5> <5, 6, 5> 1 }
        #else
            mesh {
                triangle { <3, 0, 3> <3, 0, 7> <5, 1, 5> }
                triangle { <3, 0, 7> <7, 0, 7> <5, 1, 5> }
                triangle { <7, 0, 7> <7, 0, 3> <5, 1, 5> }
                triangle { <7, 0, 3> <3, 0, 3> <5, 1, 5> }

                triangle { <7, 0, 7> <3, 0, 3> <7, 0, 3> }
                triangle { <7, 0, 7> <3, 0, 3> <3, 0, 7> }

                inside_vector <1, 2, 3>
            }
        #end
    }
    texture {
        finish { phong 0.55 crand 0.0 
            specular 0.55 reflection 0.51 ambient 0.5 } 
        pigment { color rgb 0.7 }
    }
}

-- 
If riding in an airplane is flying, then riding in a boat is swimming.
41 jumps, 8.9 minutes of freefall, 19.2 ff vertical miles.


Post a reply to this message

From: Ken
Subject: Re: mesh help
Date: 17 Aug 2003 16:10:35
Message: <3F3FE0A0.B5E25EC7@pacbell.net>
Jettero Heller wrote:
> 
> I hope I'm doing something stupid so I can get past this and move
> on with my project.  I have included some sources so you can
> catch my drift...
> 
> When c=1, you'll see a cute little scene with a pyramid cut
> across by a thick plane.  Excellent.  Almost what I want.  Then,
> when c=2, you'll see me cutting a hole out of the plane.  Pretty
> predictable stuff.
> 
> And finally, when c=3, I'm intending to cut a rhomboid thingy out
> of the plane, but instead I'm getting the rhomboid as if I'd
> accidentally used intersection instead of difference.
> 
> How can I cut out the rhomboid instead of ... whatever that was.

It looks to me like it is related to a bug in the evaluation of meshes when
used in CSG operations.

See - http://news.povray.org/povray.bugreports/27285/?tmax=100

As far as I know this has been fixed for the release of POV-Ray v3.51 which
is not yet available to the public.

-- 
Ken Tyler


Post a reply to this message

From: Mike Williams
Subject: Re: mesh help
Date: 17 Aug 2003 21:55:16
Message: <$V$TrBABDDQ$EwTN@econym.demon.co.uk>
Wasn't it Jettero Heller who wrote:
>I hope I'm doing something stupid so I can get past this and move
>on with my project.  I have included some sources so you can
>catch my drift...
>
>When c=1, you'll see a cute little scene with a pyramid cut
>across by a thick plane.  Excellent.  Almost what I want.  Then,
>when c=2, you'll see me cutting a hole out of the plane.  Pretty
>predictable stuff.
>
>And finally, when c=3, I'm intending to cut a rhomboid thingy out
>of the plane, but instead I'm getting the rhomboid as if I'd
>accidentally used intersection instead of difference.
>
>How can I cut out the rhomboid instead of ... whatever that was.

I think there's a bug in 3.5 concerning mesh differences. The workround
is to take the inverse of the intersection with the inverse. This isn't
a perfect fix, because the object is now inside out, but if you only
want the surface it's OK.

I've used the "hollow" keyword to suppress the "camera is inside a non-
hollow object" warning, so media and fog "outside" the object will work
as expected. 

#version 3.5;

#declare c = 3;

camera {
    location <-3, -1, 5>
    look_at  <5, 1, 5>
}

light_source { <-3, -1, 5> color rgb 1 }
light_source { <7, 7, 7> color rgb 1 }

object {
    #if( c = 1 ) 
        union {
    #else
        intersection {
    #end
        box { <2, 0.7, 2> <8, 0.65, 8> }
        #if( c = 2 ) 
            cylinder { <5, -6, 5> <5, 6, 5> 1 inverse}
        #else
            mesh {
                triangle { <3, 0, 3> <3, 0, 7> <5, 1, 5> }
                triangle { <3, 0, 7> <7, 0, 7> <5, 1, 5> }
                triangle { <7, 0, 7> <7, 0, 3> <5, 1, 5> }
                triangle { <7, 0, 3> <3, 0, 3> <5, 1, 5> }

                triangle { <7, 0, 7> <3, 0, 3> <7, 0, 3> }
                triangle { <7, 0, 7> <3, 0, 3> <3, 0, 7> }

                inside_vector <1, 2, 3>
                inverse
            }
        #end
    }
    texture {
        finish { phong 0.55 crand 0.0 
            specular 0.55 reflection 0.51 ambient 0.5 } 
        pigment { color rgb 0.7 }
    }
    inverse
    hollow
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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