POV-Ray : Newsgroups : povray.advanced-users : CSG error. Help? Server Time
26 Nov 2024 13:46:39 EST (-0500)
  CSG error. Help? (Message 1 to 6 of 6)  
From: Alf Peake
Subject: CSG error. Help?
Date: 25 Apr 2000 09:24:51
Message: <39059ca3@news.povray.org>
(Was originaly posted in p.prog)
I was having another try at smoothly joining 2 different sized pipes or tubes
at rightangles when I hit this problem - one tube developed large holes in it.
Open or closed cylinders made no difference but they do change with camera
angle or RadW. I used DOS versions of mpov 0.4 and pov 3.1g.

Any ideas where the problem is please?

As my project was intended to be hollow glass I think I'm in trouble anyway
with this idea. Or am I trying to re-invent the wheel?

Alf

http://www.peake42.freeserve.co.uk/
http://ourworld.compuserve.com/homepages/Alf_Peake/

// Begin pov file.

// Attempts smooth transition between 2 different size
// cylinders joined at right angles.
// Is OK to use either MegaPov 0.4 or Pov 3.1g - try 120*90
global_settings { assumed_gamma 1 }
#include "colors.inc"
camera{ location <9,6,-12> angle 6 look_at <0.9,0,0> }
light_source {<80, 80, -100> color White }
#default{ finish{ phong 1 phong_size 40 ambient 0.5 } }

#declare RadL=1;    // Large radius (L pipe).
#declare RadS=0.5;  // Smaller radius (S pipe).
#declare Pipes =
union{
  cylinder{ -y,y,RadL open pigment{ Cyan } }
  cylinder{ 0,x*1.4, RadS open pigment{ Yellow } }
}

// Sphere radius used to form weld line,
// reduce to 0.05 to reduce problem.
#declare RadW=0.12;

// Minimun X-offset from L cylinder axis (max is RadL).
#declare XoffMin = sqrt( RadL*RadL - RadS*RadS );

// Weld X-point on L pipe moves sinusoidaly (cos used)
// between RadL and XoffMin.
#declare Xscale = (RadL - XoffMin)/2;  // Will be +/- wrt 0.

// Rotates Weld point around S pipe surface,
// then adds X offset which will be 2 cos waves over 360 deg.
// object{ Pipes } // Here instead of later is different.
#declare AnglW=0;
difference{
  union{
    object{ Pipes }
    #while (AnglW<360)
      sphere{ 0, RadW
        translate <0,RadS,0>
        rotate -x*AnglW
        translate < cos(radians(AnglW*2))*Xscale + XoffMin+Xscale, 0,0 >
      }
    #declare AnglW = AnglW+1; // This increment also alters output error.
    #end
  }
// Simple object to replace the one that will be used here.
sphere{ 0,0.1 }
pigment{ Magenta }
}


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: CSG error. Help?
Date: 28 Apr 2000 19:53:56
Message: <390A24CC.262FE585@hotmail.com>
Alf Peake wrote:
> 
> (Was originaly posted in p.prog)
> I was having another try at smoothly joining 2 different sized pipes or tubes
> at rightangles when I hit this problem - one tube developed large holes in it.
> Open or closed cylinders made no difference but they do change with camera
> angle or RadW. I used DOS versions of mpov 0.4 and pov 3.1g.
> 
> Any ideas where the problem is please?
> 

I have no idea of what causes this error, but I
have included a file below that produces similar 
errors in my POV-Ray v3.1g for Windows 98.

The spheres are "shining" through the cylinder 
when there are many of them in a "sweep" behind it.

Tor Olav

--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


#version 3.1;

light_source {
  100*<2, 3, -2>
  color 2*<1, 1, 1>
}

camera {
  location <3, 2, -3>/2
//  location <3, 0, 0> // To see posistion of spheres
  look_at <0.5, 0, 0>
}

#declare NrOfSpheres = 200; // Also try 100 and 250

#declare Cnt = 0;

difference {
  union {
    cylinder {
      <0, 0, 0>, <1, 0, 0>, 0.5
      pigment { color <0, 1, 0> }
    }
    #while (Cnt < NrOfSpheres)
      sphere {
        (0.5 - Cnt/NrOfSpheres)*y + z, 0.1
        pigment { color <1, 0, 0> }
      }
      #declare Cnt = Cnt + 1;
    #end    
  }
  sphere { 
    <1, 0, 0>, 0.2
    pigment { color <0, 0, 1> }
  }
}


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: CSG error. Help?
Date: 28 Apr 2000 20:08:23
Message: <390A282C.362D2FDF@hotmail.com>
Tor Olav Kristensen wrote:
> 
> Alf Peake wrote:
> > Any ideas where the problem is please?
> >
> 
> I have no idea of what causes this error, but I
> have included a file below that produces similar
> errors in my POV-Ray v3.1g for Windows 98.
> 
> The spheres are "shining" through the cylinder
> when there are many of them in a "sweep" behind it.

I just discovered that the problem seems to 
disappear (in both mine and your scene) if one uses

merge {

instead of

union {

in the difference statement, then the problem 
disappears.

And I if you are planning on making this into a 
object of glass, then merge is what you'll need 
to use anyway.

Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Alf Peake
Subject: Re: CSG error. Help?
Date: 29 Apr 2000 16:18:16
Message: <390b4388@news.povray.org>
Tor Olav Kristensen <tor### [at] hotmailcom> wrote in
message
news:390A282C.362D2FDF@hotmail.com...
>
> Tor Olav Kristensen wrote:
> >
> > Alf Peake wrote:
> > > Any ideas where the problem is please?
> > >
> >
> > I have no idea of what causes this error, but I
> > have included a file below that produces similar
> > errors in my POV-Ray v3.1g for Windows 98.
> >

I think this is probably a better and simpler demo scene than mine.

> > The spheres are "shining" through the cylinder
> > when there are many of them in a "sweep" behind it.
>
> I just discovered that the problem seems to
> disappear (in both mine and your scene) if one uses
>
> merge {
>
> instead of
>
> union {
>
> in the difference statement, then the problem
> disappears.
>

Just tried your suggestion and it did seem to work until I tried my
original scene and found it may move the problem somewhere else :(

I have a union of spheres similar to the one inside the loop in my
post but slightly different calculations with an, as yet, uncorrected
maths error. This is used in the difference to finish the seam and the
maths error leaves unwanted pieces in the CSG. These pieces do not
show if merge is used and the _join_  seems different but I can't see
why yet :-/

Your solution would seem to be OK for non-glass objects :)

Further info - Povray 3.0 for DOS doesn't work either.

--
Alf

http://www.peake42.freeserve.co.uk/
http://ourworld.compuserve.com/homepages/Alf_Peake/


Post a reply to this message

From: PoD
Subject: Re: CSG error. Help?
Date: 29 Apr 2000 18:43:02
Message: <390B6C8C.C4910D20@merlin.net.au>
Tor Olav Kristensen wrote:
> 
> Alf Peake wrote:
> >
> > (Was originaly posted in p.prog)
> > I was having another try at smoothly joining 2 different sized pipes or tubes
> > at rightangles when I hit this problem - one tube developed large holes in it.
> > Open or closed cylinders made no difference but they do change with camera
> > angle or RadW. I used DOS versions of mpov 0.4 and pov 3.1g.
> >
> > Any ideas where the problem is please?
> >
> 
> I have no idea of what causes this error, but I
> have included a file below that produces similar
> errors in my POV-Ray v3.1g for Windows 98.
> 
> The spheres are "shining" through the cylinder
> when there are many of them in a "sweep" behind it.
> 
> Tor Olav
> 
> --
> mailto:tor### [at] hotmailcom
> http://www.crosswinds.net/~tok/tokrays.html
> 

Note that in the statistics reported after the trace, there is a report
of I-stack overflows.
Increase max_intersections in the global_settings section.

Cheers, PoD.


Post a reply to this message

From: Alf Peake
Subject: Re: CSG error. Help?
Date: 30 Apr 2000 15:02:30
Message: <390c8346@news.povray.org>
PoD <pod### [at] merlinnetau> wrote in message
news:390B6C8C.C4910D20@merlin.net.au...
>
> Note that in the statistics reported after the trace, there is a
report
> of I-stack overflows.
> Increase max_intersections in the global_settings section.
>

Many thanks for that - problem cured witth max_i 200.
I think I need new glasses coz I hadn't noticed that in the stats.
Must pay more attention in future.

--
Alf

http://www.peake42.freeserve.co.uk/
http://ourworld.compuserve.com/homepages/Alf_Peake/


Post a reply to this message

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