POV-Ray : Newsgroups : povray.advanced-users : CSG error. Help? : CSG error. Help? Server Time
30 Jul 2024 02:29:35 EDT (-0400)
  CSG error. Help?  
From: Alf Peake
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

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