POV-Ray : Newsgroups : povray.binaries.images : Rounded Prisms Server Time
15 Nov 2024 14:21:17 EST (-0500)
  Rounded Prisms (Message 1 to 10 of 26)  
Goto Latest 10 Messages Next 10 Messages >>>
From: PM 2Ring
Subject: Rounded Prisms
Date: 23 Nov 2005 09:45:01
Message: <web.43847f2f53a825ce74786be00@news.povray.org>
I've recently been playing around with my rounded prisms macros. As well as
regular polygon rounded prisms, I can now also do irregular polygons and
polyominoes. Here are a few examples. I'll post some SDL when it's fit for
human consumption. :)

The polyomino tesselations were found by a C program I wrote years ago on
the Amiga. I can post it (source & Linux binary) as well, if anyone wants
it.


Post a reply to this message


Attachments:
Download 'rpcblock0s.jpg' (169 KB)

Preview of image 'rpcblock0s.jpg'
rpcblock0s.jpg


 

From: PM 2Ring
Subject: Re: Rounded Prisms
Date: 23 Nov 2005 10:15:01
Message: <web.438487427ed7ae6c74786be00@news.povray.org>
"PM 2Ring" <nomail@nomail> wrote:
> I've recently been playing around with my rounded prisms macros.

Here are some more:


Post a reply to this message


Attachments:
Download 'rpdblock0s.jpg' (220 KB)

Preview of image 'rpdblock0s.jpg'
rpdblock0s.jpg


 

From: the ajj
Subject: Re: Rounded Prisms
Date: 23 Nov 2005 11:10:01
Message: <web.438493687ed7ae6ca43155f60@news.povray.org>
"PM 2Ring" <nomail@nomail> wrote:
> "PM 2Ring" <nomail@nomail> wrote:
> > I've recently been playing around with my rounded prisms macros.
>
> Here are some more:

Look fantastic - could make some great abstract images using these!! Be
great to post the source.  Great work!  Adrian


Post a reply to this message

From: Joanne Simpson
Subject: Re: Rounded Prisms
Date: 23 Nov 2005 17:15:00
Message: <web.4384e8e87ed7ae6cdc45bc820@news.povray.org>
> Look fantastic - could make some great abstract images using these!! Be
> great to post the source.  Great work!  Adrian

yes, please post the source - I am looking for some nice tesselations /
Penrose tilings for a garden pavement.
Joanne


Post a reply to this message

From: PM 2Ring
Subject: Re: Rounded Prisms
Date: 23 Nov 2005 21:50:00
Message: <web.438525007ed7ae6cdd5514710@news.povray.org>
"Joanne Simpson" <cor### [at] onewhiteravencom> wrote:
> > Look fantastic - could make some great abstract images using these!! Be
> > great to post the source.  Great work!  Adrian
>
> yes, please post the source - I am looking for some nice tesselations /
> Penrose tilings for a garden pavement.
> Joanne

Ok, this one can do regular & irregular polygons and polyominoes, but in a
few days I'll post one that does a better job with polyominoes (after I've
cleaned it up a bit more). The scene file below can do polyo's but they're
not suitable for tiling, since the rounding is added to the outside of the
shape. That's ok for regular polygons, since we can just use scaling to
make them fit together, but for polyominoes the rounding really needs to be
done within the borders of the squares.

// Persistence of Vision Ray Tracer Scene Description File
// File: IsoTest
// Vers: 3.5
// Desc: Sandy ground & other IsoSurfaces
// Date: 11 Apr 2004
// Auth: PM 2Ring
//
// -d +A0.2 +AM2 +R4
// -F -A0.4 +AM2 +R1
// +A0.1 +AM2 +R3
//

#version 3.6;

global_settings {
  assumed_gamma 1
  max_trace_level 7
}

#declare SkyBlue = rgb<.035, .27, .67>*.6;              //For water & sky
#declare SkyRad = 1E3;

camera {
  location <0, 8, -12.0> * 1.35
 // location <0, 5, -12.0> * 3 *1.3
  //location <0, 97, -5>
  right x*image_width/image_height
  direction 2*z
  angle 30
  look_at  -2*y
}

#declare LightLoc = <1, 4, -3> * 105;
light_source {
  LightLoc rgb 1.2
  //parallel point_at 0
  //looks_like{sphere{LightLoc, 3E2 pigment{rgb<1,1,.8>}finish{ambient 1.5
diffuse 0}}}
}

//---Textures--------------------------------------------------------------

#declare CM_Clouds =
color_map {
    [0.0   rgb 1]
    [0.05  rgb 0.85]
    [0.20  rgb 0.75]
    [0.45 SkyBlue]
}

#declare T_Clouds =
texture{
  pigment {
    bozo
    color_map {CM_Clouds}

    warp{
      //turbulence 0.75
      turbulence 0.175
      octaves 7
      omega 0.7
      lambda 2.25
    }
  }
  finish{ambient 0.9 diffuse 0.2}
}

#declare FThing =
finish{
  ambient 0.05 diffuse .85
  specular .75 roughness 1e-4
  reflection .25 diffuse .7
}

#declare TGround =
texture{
  pigment{
    //crackle
    //cells
    wrinkles
    color_map{[0 rgb 1][0.025 rgb .25][0.1 rgb .75][0.15 rgb <.85 .75
....65>][1 rgb 1]}
    scale 1.5 / 10
  }
  finish{
    ambient .05 diffuse .675
    //specular .5 roughness 1e-6
    specular .25 roughness 1e-3
    //reflection .15
  }
}

//---Objects-------------------------------------------

#declare Ground =
cylinder{
  -y, 0, SkyRad/20

  texture{TGround}
}

//Convert 2D to 3D
#macro V3D(A, H)<A.u,H,A.v>#end

//Generalized Rounded Prism
#macro RPrism(Vtx, Sides, SH, SR)
  //merge{
  union{
  #if(1)
    prism{
      linear_spline 0, SH, Sides+1,
      #local I=0;
      #while(I<=Sides)
        Vtx[I]
        #local I=I+1;
      #end
    }
    #end

    #local SH = SH - SR;
    #local I=0;
    #while(I<Sides)
      #local II = mod(I+1,Sides);
      #local A0 = V3D(Vtx[I],0);
      #local A1 = V3D(Vtx[I],SH);
      #local DV = Vtx[II]-Vtx[I];

      sphere{A1, SR}
      cylinder{0, SH*y, SR translate A0}
      cylinder{A1, V3D(Vtx[II],SH), SR }
      #local Panel = box{z*1e-3, <vlength(DV), SH, SR>}   //Side panel
      object{Panel rotate y*atan2(-DV.y,DV.x)*180/pi translate A0}

      #local I=I+1;
    #end
  }
#end

#macro NPrism(Rad, Sides, SH, SR)
  #local Vtx = array[Sides+1];    //To store polygon vertices
  #local Ang = -2*pi/Sides;
  #local Rad = Rad - SR;
  #local I=0;
  #while(I<=Sides)
    #local Vtx[I] = <cos(Ang*I), sin(Ang*I)>*Rad;
    #local I=I+1;
  #end
  #local Vtx[Sides/2] = Vtx[Sides/2] * -.5;          //perturb 1 vertex to
test rounding
  RPrism(Vtx, Sides, SH, SR)
#end


#macro PolyPrism(SH, SR)
  #local Sides = 8;
  #local Vtx = array[Sides+1]
  {
    <-3,2>, <3,2>, <3,0>,
    <1,0>, <1,-2>, <-1,-2>,<-1,0>,
    <-3,0>,<-3,2>
  }

  RPrism(Vtx, Sides, SH, SR)
#end

#declare Thing =
object{
  //PolyPrism(.75, .15)
  NPrism(3, 6, 1, .15)
  pigment{rgb 1}
  //pigment{rgb <0 .15 .75>}
  finish{FThing}

  translate y*1e-4
}

//--------------------------The actual scene-------------------

#declare Sky =
sphere{-y*SkyRad*.9, SkyRad
  inverse
  no_shadow
  texture{
    T_Clouds
    scale <1 .85 1> *  SkyRad/10 rotate 25*y
  }
}

#if(1)
  object{Sky}
#else
  background{SkyBlue}
  //background{rgb 1}
#end

object{Ground}
object{Thing rotate -35*y translate -3*z}

//-------------------------End of file-------------------------


Here's another sneak preview of tiled polyominoes:


Post a reply to this message


Attachments:
Download 'rprismdf4s.jpg' (101 KB)

Preview of image 'rprismdf4s.jpg'
rprismdf4s.jpg


 

From: Lonnie
Subject: Re: Rounded Prisms
Date: 24 Nov 2005 12:05:02
Message: <web.4385f22a7ed7ae6cd5d3b08c0@news.povray.org>
In a word, STUNNING!  Just what I am looking for - ancient Persian tilework
on the way!


Post a reply to this message

From: Jellby
Subject: Re: Rounded Prisms
Date: 24 Nov 2005 12:13:15
Message: <mo8h53-sl3.ln1@badulaque.unex.es>
Among other things, PM 2Ring saw fit to write:

> Here's another sneak preview of tiled polyominoes:

Would it be possible to have rounded inner corners as well?

I mean, where the polygon is concave, you see a "seam" in the rounded edge,
I guess you need a torus here.

-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

From: repiv
Subject: Re: Rounded Prisms
Date: 24 Nov 2005 13:29:17
Message: <4386067d@news.povray.org>
Jellby wrote:
> Would it be possible to have rounded inner corners as well?
> 
> I mean, where the polygon is concave, you see a "seam" in the rounded edge,
> I guess you need a torus here.
I wrote a macro for this once, with variable radii for each vertex. Never 
quite finished it.

Attached is a demo render, no HDRI, radiosity or checkered floor though, I 
apologize.


Post a reply to this message


Attachments:
Download 'test_var_rnd_lin_prism.png' (490 KB)

Preview of image 'test_var_rnd_lin_prism.png'
test_var_rnd_lin_prism.png


 

From: PM 2Ring
Subject: Re: Rounded Prisms
Date: 24 Nov 2005 20:35:00
Message: <web.43866a167ed7ae6cad93754b0@news.povray.org>
Jellby <me### [at] privacynet> wrote:
> Among other things, PM 2Ring saw fit to write:
>
> > Here's another sneak preview of tiled polyominoes:
>
> Would it be possible to have rounded inner corners as well?
>
> I mean, where the polygon is concave, you see a "seam" in the rounded edge,
> I guess you need a torus here.

Yes, a partial torus would do the job. And the algorithm that finds the
polyomino corners can tell the difference between inner & outer corners.
I've been thinking of adding rounded inner corners, but I'm trying to avoid
using differences & intersections, for efficiency reasons.


Post a reply to this message

From: PM 2Ring
Subject: Re: Rounded Prisms
Date: 24 Nov 2005 20:40:00
Message: <web.43866ad27ed7ae6cad93754b0@news.povray.org>
"Lonnie" <lon### [at] yahoocom> wrote:
> In a word, STUNNING!

Thanks!

> Just what I am looking for - ancient Persian tilework
> on the way!

I'm looking forward to it. I'll try to post the polyomino version tonight
and the polyomino puzzle solver, too.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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