POV-Ray : Newsgroups : povray.general : Fitting a gothic trefoil into an equilateral triangle : Re: Fitting a gothic trefoil into an equilateral triangle Server Time
4 Aug 2024 14:28:31 EDT (-0400)
  Re: Fitting a gothic trefoil into an equilateral triangle  
From: Mark M  Wilson
Date: 29 Jun 2003 22:35:47
Message: <3effa203@news.povray.org>
I made a couple of modifications to your original, now that I have some
understanding of what was going on.   Basically, I moved the definition
of 'R' to after Radius, and made R=0.10*Radius
I also removed the part in the middle where the tori overlap.


// macro for trefoil ====================================================

#macro Trefoil (Side, Radius) // lower left corner at origin

    #local Height  = sqrt(3)/2*Side;

    #local Corner1 = <Side/2, Height, 0>; // top corner
    #local Corner2 = 0; // bottom left corner
    #local Corner3 = Side*x; // bottom right corner

    #local Center  = <Side/2,
   Height/3, 0>; // triangle

    #local Center1 = <Side/2, Height-2*Radius, 0>; // top circle
    #local Center2 = <sqrt(3)*Radius, Radius, 0>; // bottom left circle
    #local Center3 = <Side-sqrt(3)*Radius, Radius, 0>; // bottom right 
circle
    #local R = Radius*0.1; //
    union {
      /*union {
        sphere { Corner1, R }
        sphere { Corner2, R }
        sphere { Corner3, R }
        cylinder { Corner1, Corner2, R }
        cylinder { Corner2, Corner3, R }
        cylinder { Corner3, Corner1, R }
        texture { pigment { color green
   1 } finish { ambient 1 } }
        }*/

      difference {
      union {
        torus { Radius, R rotate 90*x translate Center1
        clipped_by {
        plane { <0, -1, 0> 0 rotate -z*30 translate <(Side/2),
Center1.y-(Radius), 0> }
        }
        clipped_by {
        plane { <0, -1, 0> 0 rotate z*30 translate <(Side/2),
Center1.y-(Radius), 0> }
        }
        }

        torus { Radius, R rotate 90*x translate Center2
        clipped_by {
        plane { <0, 1, 0>, 0 rotate -z*30 translate <(Side/2),
(Center1.y-(Radius)), 0>
        }}
        clipped_by {
        plane { <1, 0, 0>, 0 translate <Side/2, (Center1.y-(Radius)), 0> }
        }}


        torus { Radius, R rotate 90*x translate Center3
        clipped_by {
        plane { <-1, 0, 0>, 0 translate <Side/2, (Center1.y-Radius), 0> }
        }
        clipped_by {
        plane { <0, 1, 0> 0 rotate z*30 translate <(Side/2),
(Center1.y-Radius), 0>}
        }
        }
        texture { pigment { color red 1 } finish { ambient 1 } }
        }
        sphere { <Side/2, (Center1.y-Radius), 0> 2*R }
        }



      // "}" omitted to allow application of transformations

    #end//macro Trefoil


// simple scene with trefoils ===========================================

//Trefoil ( 1  , 1*(sqrt(3)-1)/4 ) translate <-1.6, 0.2  , 1> } // small
Trefoil ( 0.46  , 0.46*sqrt(3)/9     ) translate <-0.5  , 0    , 1> } //
gothic
//Trefoil ( 1  , 1*sqrt(3)/6     ) translate < 0.6,  0.2  , 1> } // large

light_source { <-1500, 2500, -1000>, color rgb 1 }

camera { //orthographic
up y right 1.3*x
location <-0.23, 0.2, -0.09>
look_at <-0.23, 0.2, 0>
}


// END ==================================================================


Post a reply to this message

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