POV-Ray : Newsgroups : povray.text.scene-files : Obvious joins : Obvious joins Server Time
3 Jul 2024 03:06:04 EDT (-0400)
  Obvious joins  
From: Rob Brown-Bayliss
Date: 5 Oct 2001 07:41:52
Message: <3bbd9c80@news.povray.org>
Hi, I have a macro (follows) that I am useing to try and make corogated
sheets with.

The problem is there are obvoius joins along the sheets, how can I remove
these so that it actually looks like a single sheet?


Thanks...

//	Corogate Macro
	
#macro Corogate(Length, Width, Radius, T)
	
	#local Bsq = (Radius/2) * (Radius/2)
	#local Csq = Radius*Radius
	#local Asq = Csq - Bsq
	#local Chord = sqrt(Asq)
	#local StartPos = 0 - (Chord/2) //-((Width/2) - (Chord/2))  // So sheet starts on
edge of width
	
	#debug "\n\n##\n##  My Debug Output is here\n##\n\n\n"
	
	#debug concat("Bsq = ",str(Bsq,0,-1),"\n")
	#debug concat("Csq = ",str(Csq,0,-1),"\n")
	#debug concat("Asq = ",str(Asq,0,-1),"\n")
	#debug concat("Chord = ",str(Chord,0,-1),"\n")
	
	#debug "\n\n##\n##  My Debug Output ends here\n##\n\n\n"
	
	#local Outer = union
	{
		#local XPos = (Chord/2)
		difference
		{
			cylinder { <XPos,0,-(Length/2)>,<XPos,0,(Length/2)>, Radius}
			box {<XPos-Radius-T,-Radius-T,-Length>, <XPos+Radius+T,(Radius-T)/2,Length>}
			cylinder { <XPos,0,-(Length)>,<XPos,0,(Length)>, Radius-T }
		}	
	}
	
	#local Coro =	union
	{
		object{Outer}
		object
		{
			Outer 
			rotate <0,0,180> 
			translate <(3*(Chord))-(T/2),Radius-T,0> 
		}
	}
	
	#local Sheet = difference
	{
		union
		{
			#local Count = 0
			#local CoroLen = (Chord*2) - (T/2)
			#local TotLen = (Chord*2) 
		
			#while (TotLen < Width)
			#render concat("TotLen = ",str(TotLen,0,-1),"\n")
				object 
				{
					Coro
					translate <(CoroLen * Count),0,0>
				}
				#local TotLen = TotLen + CoroLen
				#local Count = Count + 2
			#end
		}
		// Sheet might run over width so trim it.
		box {<(Width),-Radius-T,-Length>, <Width,Radius+T,Length>}		
	}
	
	object {Sheet}
#end


-- 

  Rob Brown-Bayliss
 ---======o======---


Post a reply to this message

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