POV-Ray : Newsgroups : povray.binaries.images : Archway macro Server Time
7 Aug 2024 03:20:41 EDT (-0400)
  Archway macro (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Archway macro
Date: 17 Aug 2006 04:15:00
Message: <web.44e425074f0e252c8ec41e640@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote:
> Afternoon, all.
>
> Not posted for a while; my laptops were stolen last month so raytracing's
> been off the menu for a bit ..

That sounds disastrous! You have my sympathies.

>
> I was doodling a few days ago during a lazy afternoon at work, and came up
> with a half-decent archway macro...

VERY cool, and useful.  Good to see that the loss of the laptops hasn't kept
you down! Always a pleasure to see what you're up to.

Ken


Post a reply to this message

From: Bill Pragnell
Subject: Re: Archway macro
Date: 17 Aug 2006 05:20:00
Message: <web.44e4343d4f0e252c731f01d10@news.povray.org>
"Thomas de Groot" <t.d### [at] internlnet> wrote:
> >> Not posted for a while; my laptops were stolen last month so raytracing's
> >> been off the menu for a bit (unless I do it by hand - eek!).
> That's terrible! I hope you made backups to some other place?

As luck would have it, I had backed up barely a week previously. I might
have lost a small number of photos, and the effort put into assembling my
iTunes library, but that's about it... :)

> "Stefan Viljoen polard.com>" <spamnot@<removethis> schreef in bericht
> news:44e32e14@news.povray.org...
> > Nice! This will be quite useful for a large number of people.

Sounds like there's some interest. I'll tidy it up and post it in a bit!

Bill


Post a reply to this message

From: Bill Pragnell
Subject: Re: Archway macro
Date: 17 Aug 2006 05:25:00
Message: <web.44e434dc4f0e252c731f01d10@news.povray.org>
"Mark Birch" <las### [at] hotmailcom> wrote:



perhaps I'd better check for it!


Post a reply to this message

From: Bill Pragnell
Subject: Re: Archway macro
Date: 17 Aug 2006 05:25:01
Message: <web.44e435ab4f0e252c731f01d10@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> That sounds disastrous! You have my sympathies.
Thanks. One of the computers was on its way out anyway, so a free upgrade is
quite welcome!

> VERY cool, and useful.  Good to see that the loss of the laptops hasn't kept
> you down! Always a pleasure to see what you're up to.
Ithankyou. It's probably not the best use of work resources, but at least
I'm not playing games...

B


Post a reply to this message

From: Bill Pragnell
Subject: Re: Archway macro
Date: 17 Aug 2006 05:50:00
Message: <web.44e43abb4f0e252c731f01d10@news.povray.org>
Right, here's the macro.

There has to be an even number of bricks in the arch, even without a
keystone. If the edge radius is zero, the macro leaves out all the edge
curved shapes to save memory, etc. Enjoy!

// curved-brick macro. creates bricks curved in x-z plane.
// rin = inner radius
// rout = outer radius
// redge = edge radius
// depf = thickness of brick perpendicular to curvature plane
// angl = angular size of brick
#macro ArcBrick(rin, rout, redge, depf, angl)
  #local h = depf/2;
  #local hin = depf/2-redge;
  #local xout = rout*sin(radians(angl/2));
  #local yin = rin*cos(radians(angl/2));
  intersection {
    union {
      difference {
        cylinder { <0, h, 0>, <0, -h, 0>, rout-redge }
        cylinder { <0, depf, 0>, <0, -depf, 0>, rin+redge } }
      difference {
        cylinder { <0, hin, 0>, <0, -hin, 0>, rout }
        cylinder { <0, depf, 0>, <0, -depf, 0>, rin } }
      #if (redge > 0)
        torus { rin+redge, redge translate <0, hin, 0> }
        torus { rin+redge, redge translate <0, -hin, 0> }
        torus { rout-redge, redge translate <0, hin, 0> }
        torus { rout-redge, redge translate <0, -hin, 0> }
      #end }
    plane { <-1, 0, 0>, -redge rotate <0, -angl/2, 0> }
    plane { <1, 0, 0>, -redge rotate <0, angl/2, 0> }
    #if (angl < 180)
      bounded_by { box { <-xout, -depf, yin>, <xout, depf, rout> } }
    #end }
  intersection {
    difference {
      cylinder { <0, hin, 0>, <0, -hin, 0>, rout-redge }
      cylinder { <0, depf, 0>, <0, -depf, 0>, rin+redge } }
    plane { <-1, 0, 0>, 0 rotate <0, -angl/2, 0> }
    plane { <1, 0, 0>, 0 rotate <0, angl/2, 0> }
    #if (angl < 180)
      bounded_by { box { <-xout, -depf, yin>, <xout, depf, rout> } }
    #end }
  #if (redge > 0)
    // corners
    sphere { <-redge, hin, rin+redge>, redge rotate <0, angl/2, 0> }
    sphere { <-redge, -hin, rin+redge>, redge rotate <0, angl/2, 0> }
    sphere { <-redge, hin, rout-redge>, redge rotate <0, angl/2, 0> }
    sphere { <-redge, -hin, rout-redge>, redge rotate <0, angl/2, 0> }
    sphere { <redge, hin, rin+redge>, redge rotate <0, -angl/2, 0> }
    sphere { <redge, -hin, rin+redge>, redge rotate <0, -angl/2, 0> }
    sphere { <redge, hin, rout-redge>, redge rotate <0, -angl/2, 0> }
    sphere { <redge, -hin, rout-redge>, redge rotate <0, -angl/2, 0> }
    // vertical edges
    cylinder { <-redge, -hin, rin+redge>, <-redge, hin, rin+redge>, redge
               rotate <0, angl/2, 0> }
    cylinder { <redge, -hin, rin+redge>, <redge, hin, rin+redge>, redge
               rotate <0, -angl/2, 0> }
    cylinder { <-redge, -hin, rout-redge>, <-redge, hin, rout-redge>, redge
               rotate <0, angl/2, 0> }
    cylinder { <redge, -hin, rout-redge>, <redge, hin, rout-redge>, redge
               rotate <0, -angl/2, 0> }
    // in-plane edges
    cylinder { <-redge, hin, rin+redge>, <-redge, hin, rout-redge>, redge
               rotate <0, angl/2, 0> }
    cylinder { <-redge, -hin, rin+redge>, <-redge, -hin, rout-redge>, redge
               rotate <0, angl/2, 0> }
    cylinder { <redge, hin, rin+redge>, <redge, hin, rout-redge>, redge
               rotate <0, -angl/2, 0> }
    cylinder { <redge, -hin, rin+redge>, <redge, -hin, rout-redge>, redge
               rotate <0, -angl/2, 0> }
  #end
#end

// archway macro. creates arches in x-y plane.
// Total_Angle = total angular size of arch
// Keystone_Angle = angular size of keystone
// nBricks = number of non-keystone bricks in arch (must be even)
// Padding = spacing between bricks as a fraction of total brick size
// rInner = inner radius
// rOuter = outer radius
// kInner = keystone inner radius
// kOuter = keystone outer radius
// Thickness = thickness of arch
// rEdge = edge radius
#macro Arch(Total_Angle, Keystone_Angle, nBricks, Padding, rInner, rOuter,
kInner, kOuter, Thickness, rEdge)
  #local Brick_Angle = (Total_Angle - Keystone_Angle)/nBricks;
  #local ang = -(Total_Angle/2 - Brick_Angle/2);
  #local n = 1;
  #while (n <= nBricks/2)
    union {
      ArcBrick(rInner, rOuter, rEdge, Thickness, (1-Padding/2)*Brick_Angle)
      rotate <-90, 0, 0> rotate <0, 0, ang> }
    #local n = n + 1;
    #local ang = ang + Brick_Angle;
  #end
  #if (Keystone_Angle > 0)
    union {
      ArcBrick(kInner, kOuter, rEdge, Thickness,
               Keystone_Angle-Brick_Angle*Padding/2)
      rotate <-90, 0, 0> }
  #end
  #local ang = Keystone_Angle/2 + Brick_Angle/2;
  #while (n <= nBricks)
    union {
      ArcBrick(rInner, rOuter, rEdge, Thickness, (1-Padding/2)*Brick_Angle)
      rotate <-90, 0, 0> rotate <0, 0, ang> }
    #local n = n + 1;
    #local ang = ang + Brick_Angle;
  #end
#end

// example arch:
union {
  Arch(240, 20, 24, 0.05, 0.75, 0.9, 0.7, 0.9, 0.3, 0.025)
  texture { Stone } }


Bill


Post a reply to this message

From: Jim Charter
Subject: Re: Archway macro
Date: 17 Aug 2006 13:51:17
Message: <44e4ac95$1@news.povray.org>
Bill Pragnell wrote:
Very cool.

On a vaguely related note, I onetime wrote something to produce tiled 
"Mosiacs" (or even patio stones) in circular bands. What drove the idea 
was to use eval_pigment() to have the mosaic pieces reproduce an 
underlying image. I was using fixed sized square tiles.  It involved 
calculating the number of tiles necessary at each circumference.  If 
there was a "reminder" it was averaged among the grouts between all the 
tiles.  But for the innermost rings, the pinched looking grouts did not 
seem realistic so I produced angular tiles like in your arches for inner 
rings. But I could never decide what a real mosaic would do.  It would 
seem unlikely that tiles would be cut at the slight angles necessary on 
the outer rings.  I couldn't decide about the inner rings. What I could 
never solve, also, was any sort of central "plug" arrangement other than 
having a large circular tile.  Wondering if you have ever approached 
this problem?


Post a reply to this message

From: Jim Charter
Subject: Re: Archway macro
Date: 17 Aug 2006 13:59:30
Message: <44e4ae82@news.povray.org>
Jim Charter wrote:
example each way


Post a reply to this message


Attachments:
Download 'img.sm08.jpg' (64 KB) Download 'img.10529.jpg' (69 KB)

Preview of image 'img.sm08.jpg'
img.sm08.jpg

Preview of image 'img.10529.jpg'
img.10529.jpg


 

From: Thomas de Groot
Subject: Re: Archway macro
Date: 18 Aug 2006 03:08:11
Message: <44e5675b@news.povray.org>
"Jim Charter" <jrc### [at] msncom> schreef in bericht 
news:44e4ac95$1@news.povray.org...
> Bill Pragnell wrote:
> Very cool.
>
> On a vaguely related note, ...

Which reminds me of my failed attempts a couple of years ago, to reproduce 

arcs...

Thomas


Post a reply to this message

From: Bill Pragnell
Subject: Re: Archway macro
Date: 18 Aug 2006 06:30:00
Message: <web.44e596604f0e252c731f01d10@news.povray.org>
Jim Charter <jrc### [at] msncom> wrote:
> seem realistic so I produced angular tiles like in your arches for inner
> rings. But I could never decide what a real mosaic would do.  It would
> seem unlikely that tiles would be cut at the slight angles necessary on
> the outer rings.  I couldn't decide about the inner rings. What I could
> never solve, also, was any sort of central "plug" arrangement other than
> having a large circular tile.  Wondering if you have ever approached
> this problem?

I haven't. But, looking at your images, I would say the first one (angular
inner tiles) looks the best. A quick scout around on Google Images turns up
nothing conclusive, because in real decorative mosaics the tiles generally
seem to be aligned with the edges in the actual design (try and automate
that!). The few regular circular patterns I did turn up seem to vary in
approach. Mosaic builders might not cut precise angles in every tile, but
they'd probably do it at least approximately for the inner rings. As for
plugs... one big circle? Four triangles approximating quadrants of a
circle? A drain cover?

I am suddenly reminded of the scene in Monty Python's Life of Brian, when
the PFJ sneak into Pilate's residence via the sewers, emerging from under a
fig leaf covering the genitals of a male figure in a giant floor mosaic.

"Stop! Stop! We must unite against the common enemy!"
"The Judean People's Front?"
"No! No! The ROMANS!"

B


Post a reply to this message

From: Chris B
Subject: Re: Archway macro
Date: 18 Aug 2006 10:05:09
Message: <44e5c915@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote in message 
news:web.44e43abb4f0e252c731f01d10@news.povray.org...
> Right, here's the macro.
>  .. snip ..
> Bill
>

Thanks Bill,

Makes a nice tunnel too and only took 50 seconds to render (without 
radiosity and just a simple agate normal)

Regards,
Chris B.


Post a reply to this message


Attachments:
Download 'Arch.gif' (30 KB)

Preview of image 'Arch.gif'
Arch.gif


 

<<< Previous 5 Messages Goto Initial 10 Messages

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