POV-Ray : Newsgroups : povray.binaries.images : Gothic cathedral window generator Server Time
9 May 2024 01:51:25 EDT (-0400)
  Gothic cathedral window generator (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Samuel B 
Subject: Gothic cathedral window generator
Date: 17 Jul 2023 20:30:00
Message: <web.64b5dc7210fe62a7f8c47d526e741498@news.povray.org>
Hi,

Here's a piece of gothitecture I cooked up the last couple of days. It's a
generic gothic/medieval window macro. Nothing too involved. The glass beveling
is a simple surface normal, and everything else is just good old, traditional
CSG.

Macro incoming...

Sam


Post a reply to this message


Attachments:
Download 'gothicarchb6m_43s.jpg' (348 KB)

Preview of image 'gothicarchb6m_43s.jpg'
gothicarchb6m_43s.jpg


 

From: Samuel B 
Subject: Re: Gothic cathedral window generator
Date: 17 Jul 2023 20:40:00
Message: <web.64b5de7337209b7ff8c47d526e741498@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> Macro incoming...

Here's the macro. It's not exactly easy to invoke, as you can see by the number
of parameters. Be warned that the arch height cannot fall below the window
width, nor can the window height be less than the arch height. (If that seems
confusing, just play with the params.)

Scroll below the macro definition to see how it's used (includes comments).

#macro Gothic_Window(WW, AH, WH, WD, LT, ET, NA, PT, BW)
 #local Eps = .0001; // a small value

 union{

  // -< window width, arch height, 0 >
  #local P = -<WW, AH, 0>;

  // arch circle center
  #local CC = <.5*(P.x-P.y/(WW/AH)), -AH, 0>;

  // arch circle radius
  #local CR = vlength(CC);

  // window box
  box{<-WW, -WH+ET, -Eps>, <-WW+ET, -AH, WD+Eps>}
  box{<WW-ET, -WH+ET, -Eps>, <WW, -AH, WD+Eps>}
  box{<-WW, -WH, -Eps>, <WW, -WH+ET, WD+Eps>}
  difference{
   box{<-WW, -AH, 0>, <WW, 0, WD>}
   intersection{
    cylinder{<CC.x, CC.y, -Eps>, <CC.x, CC.y, WD+Eps>, CR-ET}
    cylinder{<-CC.x, CC.y, -Eps>, <-CC.x, CC.y, WD+Eps>, CR-ET}
   }
  }

  #local LT2 = .4 * LT;

  // horizonals
  cylinder{-<WW, AH, 0>, <WW, -AH, 0>, LT}
  cylinder{-<WW, AH, LT>, <WW, -AH, -LT>, LT2}

  cylinder{-<WW, WH, 0>, <WW, -WH, 0>, LT}
  cylinder{-<WW, WH, LT>, <WW, -WH, -LT>, LT2}

  // bottom horizontal, if there's enough room
  #if(WH-AH > 16*LT)
   cylinder{-<WW, WH-8*LT, 0>, <WW, -WH+8*LT, 0>, LT}
   cylinder{-<WW, WH-8*LT, LT>, <WW, -WH+8*LT, -LT>, LT2}
  #end

  // fancy multiarch setup
  #for(I, 0, NA)

   #if(I<NA)

    #local ArchPiece =
     intersection{
      merge{
       torus{
        CR, LT
        rotate x*90
        translate CC+2*x*WW*I/NA
       }
       torus{
        CR, LT2
        rotate x*90
        translate CC-z*LT+2*x*WW*I/NA
       }
      }
      plane{y, -AH inverse}
      // use vertical cut for first item, otherwise use a cylinder
      #if(I=0)
       plane{x, 0}
      #else
       cylinder{<-CC.x, CC.y, -2*LT>, <-CC.x, CC.y, 2*LT>, CR}
      #end
     }

    object{ArchPiece}
    object{ArchPiece scale <-1, 1, 1>}

   #end

   cylinder{-<WW, WH, 0>, -<WW, AH, 0>, LT translate x*2*WW*I/NA}
   cylinder{-<WW, WH, LT>, -<WW, AH, LT>, LT2 translate x*2*WW*I/NA}

  #end

  // fill the corners
  sphere{-<WW, WH, 0>, LT}
  sphere{<WW, -WH, 0>, LT}
  sphere{-<WW, WH, LT>, LT2}
  sphere{<WW, -WH, -LT>, LT2}

  #local TexWindow =
   texture{
    pigment{rgb .75 transmit .85}
    finish{reflection{0, 1 fresnel} conserve_energy}
   }

  // window pane
  box{
   <-WW+Eps, -WH+Eps, PT>, <WW-Eps, -Eps, PT>
   texture{TexWindow}
   inverse
  }
  box{
   <-WW+Eps, -WH+Eps, Eps>, <WW-Eps, -Eps, Eps>

   texture{
    TexWindow
    normal{
    //pigment{ // debug
     #local CX = CC.x;
     #local CY = CC.y;
     #local FA =
      function{
       min(
        1
        #for(I, 0, NA-1)
         ,abs(sqrt(pow(x-CX-2*WW*I/NA, 2)+pow(y-CY, 2)*(y>-AH))-CR)
        #end
       )
      }
     function{
      min(
       1,
       min(
        FA(x, y, 0),
        FA(-x, y, 0),
        abs(y+AH),
        abs(y+WH)
        #if(WH-AH > 16*LT)
         ,abs(y+WH-8*LT)
        #end
       ) / BW
      )
     }
     bump_size 1
     accuracy .003
    }
   }
   interior{ior 1.5}
   double_illuminate
  }

  // place object at y=0
  translate y*WH
 }
#end

// invoke the macro
object{
 Gothic_Window(
  1.0,   // window width (total_width/2)
  1.875, // arch height (>=WW & <=WH)
  4.0,   // window height
  0.75,  // window depth
  .05/1,  // line thickness
  .01,  // thickness of enclosure around window (window box)
  3,   // number of arch pieces
  .1,   // window pane thickness
  .2   // window pane bevel width
 )
 pigment{rgb .75}
}


Post a reply to this message

From: Samuel B 
Subject: Re: Gothic cathedral window generator
Date: 17 Jul 2023 20:45:00
Message: <web.64b5e03d37209b7ff8c47d526e741498@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> gothic/medieval window macro

And here's an image showcasing the underlying geometry behind all this.
Basically: for any given window width and arch height, find an appropriate
circle to describe the arch.


Post a reply to this message


Attachments:
Download 'gothicarchgeom.jpg' (22 KB)

Preview of image 'gothicarchgeom.jpg'
gothicarchgeom.jpg


 

From: And
Subject: Re: Gothic cathedral window generator
Date: 17 Jul 2023 23:45:00
Message: <web.64b609e137209b7f1598008daa81652d@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> Hi,
>
> Here's a piece of gothitecture I cooked up the last couple of days. It's a
> generic gothic/medieval window macro. Nothing too involved. The glass beveling
> is a simple surface normal, and everything else is just good old, traditional
> CSG.
>
> Macro incoming...
>
> Sam

Looked nice.


Post a reply to this message

From: Mike Miller
Subject: Re: Gothic cathedral window generator
Date: 18 Jul 2023 00:10:00
Message: <web.64b6101237209b7fb5177e91dabc9342@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
> > Macro incoming...
>
> Here's the macro. It's not exactly easy to invoke, as you can see by the number
> of parameters. Be warned that the arch height cannot fall below the window
> width, nor can the window height be less than the arch height. (If that seems
> confusing, just play with the params.)
>
> Scroll below the macro definition to see how it's used (includes comments).
>
> #macro Gothic_Window(WW, AH, WH, WD, LT, ET, NA, PT, BW)
>  #local Eps = .0001; // a small value
>
>  union{
>
>   // -< window width, arch height, 0 >
>   #local P = -<WW, AH, 0>;
>
>   // arch circle center
>   #local CC = <.5*(P.x-P.y/(WW/AH)), -AH, 0>;
>
>   // arch circle radius
>   #local CR = vlength(CC);
>
>   // window box
>   box{<-WW, -WH+ET, -Eps>, <-WW+ET, -AH, WD+Eps>}
>   box{<WW-ET, -WH+ET, -Eps>, <WW, -AH, WD+Eps>}
>   box{<-WW, -WH, -Eps>, <WW, -WH+ET, WD+Eps>}
>   difference{
>    box{<-WW, -AH, 0>, <WW, 0, WD>}
>    intersection{
>     cylinder{<CC.x, CC.y, -Eps>, <CC.x, CC.y, WD+Eps>, CR-ET}
>     cylinder{<-CC.x, CC.y, -Eps>, <-CC.x, CC.y, WD+Eps>, CR-ET}
>    }
>   }
>
>   #local LT2 = .4 * LT;
>
>   // horizonals
>   cylinder{-<WW, AH, 0>, <WW, -AH, 0>, LT}
>   cylinder{-<WW, AH, LT>, <WW, -AH, -LT>, LT2}
>
>   cylinder{-<WW, WH, 0>, <WW, -WH, 0>, LT}
>   cylinder{-<WW, WH, LT>, <WW, -WH, -LT>, LT2}
>
>   // bottom horizontal, if there's enough room
>   #if(WH-AH > 16*LT)
>    cylinder{-<WW, WH-8*LT, 0>, <WW, -WH+8*LT, 0>, LT}
>    cylinder{-<WW, WH-8*LT, LT>, <WW, -WH+8*LT, -LT>, LT2}
>   #end
>
>   // fancy multiarch setup
>   #for(I, 0, NA)
>
>    #if(I<NA)
>
>     #local ArchPiece =
>      intersection{
>       merge{
>        torus{
>         CR, LT
>         rotate x*90
>         translate CC+2*x*WW*I/NA
>        }
>        torus{
>         CR, LT2
>         rotate x*90
>         translate CC-z*LT+2*x*WW*I/NA
>        }
>       }
>       plane{y, -AH inverse}
>       // use vertical cut for first item, otherwise use a cylinder
>       #if(I=0)
>        plane{x, 0}
>       #else
>        cylinder{<-CC.x, CC.y, -2*LT>, <-CC.x, CC.y, 2*LT>, CR}
>       #end
>      }
>
>     object{ArchPiece}
>     object{ArchPiece scale <-1, 1, 1>}
>
>    #end
>
>    cylinder{-<WW, WH, 0>, -<WW, AH, 0>, LT translate x*2*WW*I/NA}
>    cylinder{-<WW, WH, LT>, -<WW, AH, LT>, LT2 translate x*2*WW*I/NA}
>
>   #end
>
>   // fill the corners
>   sphere{-<WW, WH, 0>, LT}
>   sphere{<WW, -WH, 0>, LT}
>   sphere{-<WW, WH, LT>, LT2}
>   sphere{<WW, -WH, -LT>, LT2}
>
>   #local TexWindow =
>    texture{
>     pigment{rgb .75 transmit .85}
>     finish{reflection{0, 1 fresnel} conserve_energy}
>    }
>
>   // window pane
>   box{
>    <-WW+Eps, -WH+Eps, PT>, <WW-Eps, -Eps, PT>
>    texture{TexWindow}
>    inverse
>   }
>   box{
>    <-WW+Eps, -WH+Eps, Eps>, <WW-Eps, -Eps, Eps>
>
>    texture{
>     TexWindow
>     normal{
>     //pigment{ // debug
>      #local CX = CC.x;
>      #local CY = CC.y;
>      #local FA =
>       function{
>        min(
>         1
>         #for(I, 0, NA-1)
>          ,abs(sqrt(pow(x-CX-2*WW*I/NA, 2)+pow(y-CY, 2)*(y>-AH))-CR)
>         #end
>        )
>       }
>      function{
>       min(
>        1,
>        min(
>         FA(x, y, 0),
>         FA(-x, y, 0),
>         abs(y+AH),
>         abs(y+WH)
>         #if(WH-AH > 16*LT)
>          ,abs(y+WH-8*LT)
>         #end
>        ) / BW
>       )
>      }
>      bump_size 1
>      accuracy .003
>     }
>    }
>    interior{ior 1.5}
>    double_illuminate
>   }
>
>   // place object at y=0
>   translate y*WH
>  }
> #end
>
> // invoke the macro
> object{
>  Gothic_Window(
>   1.0,   // window width (total_width/2)
>   1.875, // arch height (>=WW & <=WH)
>   4.0,   // window height
>   0.75,  // window depth
>   .05/1,  // line thickness
>   .01,  // thickness of enclosure around window (window box)
>   3,   // number of arch pieces
>   .1,   // window pane thickness
>   .2   // window pane bevel width
>  )
>  pigment{rgb .75}
> }

Nice Job! ...and thank you for the macro.
Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Gothic cathedral window generator
Date: 18 Jul 2023 00:20:00
Message: <web.64b6129537209b7f1f9dae3025979125@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
> > gothic/medieval window macro
>
> And here's an image showcasing the underlying geometry behind all this.
> Basically: for any given window width and arch height, find an appropriate
> circle to describe the arch.

I've wound up deriving that solution from scratch about a dozen times     :D

Nice macro.


- BW


Post a reply to this message

From: Thomas de Groot
Subject: Re: Gothic cathedral window generator
Date: 18 Jul 2023 08:56:17
Message: <64b68bf1$1@news.povray.org>
Op 18-7-2023 om 02:27 schreef Samuel B.:
> Hi,
> 
> Here's a piece of gothitecture I cooked up the last couple of days. It's a
> generic gothic/medieval window macro. Nothing too involved. The glass beveling
> is a simple surface normal, and everything else is just good old, traditional
> CSG.
> 
> Macro incoming...
> 
> Sam

Aaah! I love this! Can it do the typically English 4-centered arch? I 
have been trying to write a macro lately but did not get very far.

-- 
Thomas


Post a reply to this message

From: Samuel B 
Subject: Re: Gothic cathedral window generator
Date: 18 Jul 2023 17:45:00
Message: <web.64b7078737209b7ff8c47d526e741498@news.povray.org>
"Mike Miller" <mil### [at] gmailcom> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
> > Macro incoming...
>
> Nice Job! ...and thank you for the macro.
> Mike

Thanks and np!

If you use it, keep in mind I failed to add a double_illuminate keyword and
interior ior to one of the boxes making up the window, so the glass won't be
physically accurate until fixed.

Sam


Post a reply to this message

From: Samuel B 
Subject: Re: Gothic cathedral window generator
Date: 18 Jul 2023 17:55:00
Message: <web.64b7096b37209b7ff8c47d526e741498@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
> > "Samuel B." <stb### [at] hotmailcom> wrote:
> > > gothic/medieval window macro
> >
> > And here's an image showcasing the underlying geometry behind all this.
> > Basically: for any given window width and arch height, find an appropriate
> > circle to describe the arch.
>
> I've wound up deriving that solution from scratch about a dozen times     :D
>
> Nice macro.
>
>
> - BW

Isn't that just the way? So many times I've worked on a problem only to discover
that I had already solved it before, yet I somehow forgot! I think this was the
first time I figured out this particular problem, and the solution had me
stymied for a bit too long... but I had fun the whole time ^_^

Btw, what were you using this kind of geometry for?

Sam


Post a reply to this message

From: Samuel B 
Subject: Re: Gothic cathedral window generator
Date: 18 Jul 2023 18:05:00
Message: <web.64b70c5a37209b7ff8c47d526e741498@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 18-7-2023 om 02:27 schreef Samuel B.:
> >
> > Here's a piece of gothitecture I cooked up the last couple of days. [...]
>
> Aaah! I love this! Can it do the typically English 4-centered arch? I
> have been trying to write a macro lately but did not get very far.
>
> --
> Thomas

Thanks, Thomas!

Just looked up the 4-centered arch, and no, it cannot make those. This macro
only produces arches with single circular segments, while the 4-centered arch
seems to require at least two. Or worse, it uses some sort of curve not composed
entirely of circles. I'll look further into it though, and possibly make a
separate macro.

I've love to make a single all-purpose macro to cover everything, but there
seems to be as many window/arch variations as there are stars in the sky. (Ok,
that's a bit hyperbolic, but with all the extra details architects used, there
are a lot of designs out there.)

Sam


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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