POV-Ray : Newsgroups : povray.newusers : CSG Problem... please help Server Time
27 Nov 2024 05:49:53 EST (-0500)
  CSG Problem... please help (Message 1 to 3 of 3)  
From: Bob
Subject: CSG Problem... please help
Date: 22 Apr 2003 15:40:28
Message: <3ea59aac$1@news.povray.org>
Hi all!

I'm trying to create a medal that might appear on a uniform.  The medal has
a thickness to it and needs to have beveled edges.  To medal I used a box.
Then I created a prism out of a right isoceles triangle, and used the prism
with a difference function to create the beveled edges on three sides of the
box.

The problem is that where the difference is, there are lots of black spots;
not only on the surface of the medal, but also in the space of the
difference itself.

If anyone has any recommendations on how to lose the black spots, or perhaps
a different method of creating beveled edges, I would appreciate it.

Here's the source code...

#include "colors.inc"
#include "textures.inc"


  camera {        // top-down view
    location <7, 11, -25>
    look_at  <7,11,  0>
  }

/*            // profile view from bottom of logo, looking up
  camera {
    location <7, -10, 0>
    look_at  <7,11,  0>
  }
*/


  background { color White }

#declare BeveledEdge =
 prism {
    linear_sweep
    linear_spline
    0, // sweep the following shape from here ...
    22, // ... up through here
    4, // points making up the shape
    <-1,-1>, <-1,.75>, <.75,-1>, <-1,-1> // triangle  }
  #declare BeveledBox =
   difference {
   box {
     <0,7,.75>,
    <14, 21, 0>
   }
   object {
    BeveledEdge
    translate <1,0,0>
   }
   object {
    BeveledEdge
    rotate y * -90
    translate <13,0,0>
   }
   object {
    BeveledEdge
    rotate <0, 270, 90>
    translate <17, 20, 0>
   }
  }
 #declare BeveledCircle = intersection {
  cylinder {
   <7, 7, .75>,
   <7, 7, 0>
   7
  }
  cone {
   <7,7,-6.25>, 0
   <7,7,.75>, 7
  }
 }

 #declare Medal = merge {
  object {BeveledBox}
  object {BeveledCircle}
  texture {Silver_Texture}
 }

 object {Medal}

  light_source { <14, 21, -17> color White}
  light_source { <7,11,15> color White}
  light_source { <-5, -5, 5> color White }


Post a reply to this message

From:
Subject: Re: CSG Problem... please help
Date: 22 Apr 2003 18:59:38
Message: <3ea5c95a$1@news.povray.org>
Hi Bob,

the black spots are a typical consequence of coincident surfaces -- POV-
Ray can't decide which surface comes first: the surface of the box or the
surface of the BeveledEdge. See "3.3.6.1 Co-incident Surfaces" in the
manual. So you have to use a "bigger knive"; if you replace your points
of the beveling prism by

    <-1.01,-1.01>, <-1.01,.76>, <.76,-1.01>, <-1.01,-1.01>

(and put the "}" before the "//"!), the coincident surfaces are gone.
But there is an even bigger and much easier "knife":

    #declare BeveledEdge = plane { <1, 0, 1>, 0 translate -0.25*x }

Easy, isn't it? (This is the "cutting plane" of your prism.)
Now look closely at the beveled circle: the intersection of cylinder and
cone is ... a cone! So you could use

    #declare BeveledCircle = cone { <7, 7, 0.75>, 7, <7, 7, 0>, 6.25 }

This is faster and much easier. If you want a partial bevel, i. e. a
cylindrical part plus beveled part like this (use a non-proportional
font to look at this ASCII-picture):

     /""""""\
    /        \
    !        !
    !        !
    +--------+

then use

    union { cylinder {...} cone {...} }

because union is faster than merge, intersection and difference.
For very complicated beveled shapes you could use my "Brett.inc": see
the thread "Round/bevel: Include file" at povray.binaries.scene-files,
started on 23rd January 2003. Please read *all* my posts in this thread,
there are some corrections and you will also find a tutorial and a "test
arena" for experimentation.

Have fun!

   Sputnik

--
-------------------------------------

e-mail: fr### [at] computermuseumfh-kielde
-------------------------------------


Post a reply to this message

From: Bob
Subject: Re: CSG Problem... please help
Date: 22 Apr 2003 22:13:34
Message: <3ea5f6ce$1@news.povray.org>
Sputnik,

Thanks for the help.  Your suggestions were right on!  It seems like I have
a lot to learn!

Bob Seamon


Post a reply to this message

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