POV-Ray : Newsgroups : povray.object-collection : Polyhedra library Server Time
21 Dec 2024 08:48:31 EST (-0500)
  Polyhedra library (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: SharkD
Subject: Re: Polyhedra library
Date: 12 Aug 2009 19:46:24
Message: <4a835450@news.povray.org>
Bill Pragnell wrote:
> SharkD <mik### [at] gmailcom> wrote:
> Quite simply, because I don't know how! (Well, except the simpler cases like the
> platonic/archimedean solids).

Are the meshes solid, and can they used in CSG operations without 
limitation?

-Mike


Post a reply to this message

From: Bill Pragnell
Subject: Re: Polyhedra library
Date: 13 Aug 2009 03:30:00
Message: <web.4a83c0d0cda2f1c26dd25f0b0@news.povray.org>
SharkD <mik### [at] gmailcom> wrote:
> Bill Pragnell wrote:
> > SharkD <mik### [at] gmailcom> wrote:
> > Quite simply, because I don't know how! (Well, except the simpler cases like the
> > platonic/archimedean solids).
>
> Are the meshes solid, and can they used in CSG operations without
> limitation?

AFAIK they are all fully closed, and I'm giving them inside_vectors so they
should also be good for CSG.


Post a reply to this message

From: clipka
Subject: Re: Polyhedra library
Date: 13 Aug 2009 15:18:23
Message: <4a8466ff$1@news.povray.org>
Bill Pragnell schrieb:
> AFAIK they are all fully closed, and I'm giving them inside_vectors so they
> should also be good for CSG.

To try and root out this common misconception: Specifying an 
inside_vector is /not/ a prerequisite for a mesh to work properly with 
CSG, as POV-Ray will automaticaly assume a default value.

Specifying an inside_vector is only of use in case the default one 
should happen to give you artifacts, but I've never seen any.


Post a reply to this message

From: Warp
Subject: Re: Polyhedra library
Date: 13 Aug 2009 15:50:11
Message: <4a846e73@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> To try and root out this common misconception: Specifying an 
> inside_vector is /not/ a prerequisite for a mesh to work properly with 
> CSG, as POV-Ray will automaticaly assume a default value.

> Specifying an inside_vector is only of use in case the default one 
> should happen to give you artifacts, but I've never seen any.

  Unfortunately you are wrong. No default inside_vector is used if none is
specified in a mesh definition. Here's a demo:

//=============================================================================
#declare MajorRadius = 1;
#declare MinorRadius = .5;
#declare Resolution1 = 60;
#declare Resolution2 = 30;
#declare Torus =
  mesh2
  { vertex_vectors
    { Resolution1 * Resolution2
      #declare Ind1 = 0;
      #while(Ind1 < Resolution1)
        #declare Angle1 = 360*Ind1/Resolution1;
        #declare Ind2 = 0;
        #while(Ind2 < Resolution2)
          #declare Angle2 = 360*Ind2/Resolution2;
          vrotate(vrotate(MinorRadius*x, z*Angle2) + x*MajorRadius, y*Angle1)
          #declare Ind2 = Ind2 + 1;
        #end
        #declare Ind1 = Ind1 + 1;
      #end
    }
    face_indices
    { Resolution1 * Resolution2 * 2
      #declare Ind1 = 0;
      #while(Ind1 < Resolution1)
        #declare VInd1_1 = Ind1 * Resolution2;
        #declare VInd1_2 =
          ((Ind1+1 = Resolution1) ? 0 : (Ind1+1)) * Resolution2;
        #declare Ind2 = 0;
        #while(Ind2 < Resolution2)
          #declare VInd2_2 = ((Ind2+1 = Resolution2) ? 0 : (Ind2+1));
          <VInd1_1 + Ind2, VInd1_1 + VInd2_2, VInd1_2 + Ind2>
          <VInd1_1 + VInd2_2, VInd1_2 + Ind2, VInd1_2 + VInd2_2>
          #declare Ind2 = Ind2 + 1;
        #end
        #declare Ind1 = Ind1 + 1;
      #end
    }

    // Uncomment this for proper behavior:
    //inside_vector y
  };

camera { location <0, 5, -5> look_at 0 angle 35 }
light_source { <5, 20, -10>, 1 }
plane { y, -.5 pigment { rgb <.5, .8, 1> } }
intersection
{ object { Torus }
  plane { y, .4 }
  pigment { rgb 1 }
}
//=============================================================================

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: Polyhedra library
Date: 13 Aug 2009 16:25:59
Message: <4a8476d7$1@news.povray.org>
Warp schrieb:
>> inside_vector is /not/ a prerequisite for a mesh to work properly with 
>> CSG, as POV-Ray will automaticaly assume a default value.
> 
>   Unfortunately you are wrong. No default inside_vector is used if none is
> specified in a mesh definition. Here's a demo:

Duh - how come I've always been fully convinced of the opposite?

You're absolutely right. I even checked in the code now.

(*blushes*)


Post a reply to this message

From: Warp
Subject: Re: Polyhedra library
Date: 13 Aug 2009 16:54:20
Message: <4a847d7b@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Warp schrieb:
> >> inside_vector is /not/ a prerequisite for a mesh to work properly with 
> >> CSG, as POV-Ray will automaticaly assume a default value.
> > 
> >   Unfortunately you are wrong. No default inside_vector is used if none is
> > specified in a mesh definition. Here's a demo:

> Duh - how come I've always been fully convinced of the opposite?

> You're absolutely right. I even checked in the code now.

> (*blushes*)

  Maybe you got confused by a related phenomenon: Many people have a
misconception of how inside_vector works and eg. think that it must be
a point inside the mesh (rather than it being just a direction vector),
and thus it matters a lot what it is, when in fact in most cases it doesn't
matter at all. (The cases where it matters are so extremely rare that they
might as well not exist at all.)

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: Polyhedra library
Date: 13 Aug 2009 17:52:33
Message: <4a848b21$1@news.povray.org>
Warp schrieb:
> (The cases where it matters are so extremely rare that they
> might as well not exist at all.)

I'm pretty much inclined to think so as well.

If such cases /do/ exist, I guess the best bet for an inside_vector 
would be anything that is not parallel or near-parallel to any face.


Post a reply to this message

From: Warp
Subject: Re: Polyhedra library
Date: 13 Aug 2009 18:51:38
Message: <4a8498fa@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> If such cases /do/ exist, I guess the best bet for an inside_vector 
> would be anything that is not parallel or near-parallel to any face.

  It may indeed by that if the inside_vector is parallel to one of the
triangles, and that triange is being cut by the CSG, an artifact might
be introduced.

  The best way is to try to choose an inside_vector which is not parallel
to any of the triangles (at least not any which are being cut by CSG).

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: Polyhedra library
Date: 13 Aug 2009 20:17:41
Message: <4a84ad25$1@news.povray.org>

> clipka <ano### [at] anonymousorg> wrote:
>> If such cases /do/ exist, I guess the best bet for an inside_vector 
>> would be anything that is not parallel or near-parallel to any face.
> 
>   It may indeed by that if the inside_vector is parallel to one of the
> triangles, and that triange is being cut by the CSG, an artifact might
> be introduced.
> 
>   The best way is to try to choose an inside_vector which is not parallel
> to any of the triangles (at least not any which are being cut by CSG).
> 

With a high resolution mesh, it can be almost imposible for that vector 
not to be parallel with at least one, or several triangles.

If you get artefacts, then, just altering the inside_vector should do 
the trick. The vector will no longer be parallel with the problem triangles.



Alain


Post a reply to this message

From: Warp
Subject: Re: Polyhedra library
Date: 14 Aug 2009 04:00:14
Message: <4a85198e@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> With a high resolution mesh, it can be almost imposible for that vector 
> not to be parallel with at least one, or several triangles.

  Use a lot of decimals in at least one of the vector components, and the
likelihood for that happening will be extremely small.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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