POV-Ray : Newsgroups : povray.binaries.images : HELP, table top clipped by object, HOW? : HELP, table top clipped by object, HOW? Server Time
4 Oct 2024 19:21:21 EDT (-0400)
  HELP, table top clipped by object, HOW?  
From: Mark Palmquist
Date: 24 Feb 1999 21:44:07
Message: <36D4BAA3.928622E7@earthlink.net>
I have made a loop to render [X] sided extruded polygons for an
octaconal table, gazebo, etc...  It works fine exept now I need a way to
clip a box with the object for shelves and top.  As a somewhat newcommer
to POV I just can't seem to get this solved.  I have attached an image
and here is the source.  The red 'top' was scaled to move it away from
the main base object.  I now that clipped_by is not right but how to end
up with an octagonal piece?

#include "colors.inc"
#include "metals.inc"
#include "glass.inc"

global_settings
{
  assumed_gamma 1.0
}

// ----------------------------------------
camera
{
  location  <1.0, 40, -10>
  direction 1.5*z
  right     4/3*x
  look_at   <1.0, 0.0, 0>
}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

#declare S = 6                        //number of segments
#declare OR = 4                       //object radius
#declare ANGLE = 360/S                //Angle of each segment

#declare PT = texture {T_Glass3}    //texture of panes
#declare PD = .1                      //pane thickness
#declare PH = 6                       //pane Top
#declare PB = 1                       //pane Bottom

#declare DT = texture {T_Copper_1D}   //texture of panes
#declare DH = 6.001                   //divider Top
#declare DB = 0                       //divider Bottom
#declare DD = .4                      //divider diameter

#declare L = (2*OR) * tan(radians(ANGLE/2))  //Pane length

//table

//base
#declare SA = S

#declare base =
union{
  #while (S >=0)
    union{
      box{ <-PD/2, PB, 0>, < PD/2, PH, L> texture {PT}}
      cylinder{ <0,DB,0>, <0,DH,0> DD texture {DT}}
      translate <OR,0,-L/2>
      rotate <0,(ANGLE*S),0>
    }
    #declare S = S - 1;
  #end
  }

#declare S = SA
#declare baseclip =
union{
  #while (S >=0)
    union{
      box{ <-PD/2, PB, 0>, < PD/2, PH, L> }
      translate <OR,0,-L/2>
      rotate <0,(ANGLE*S),0>
    }
    #declare S = S - 1;
  #end
  }

object {base}

  box {<-10,6,-10>,<10,6.1,10> pigment{Red}
  clipped_by{object{baseclip}}
  scale <1.5,1,1.5>
  }


Post a reply to this message


Attachments:
Download 'extrude_poly.jpg' (14 KB)

Preview of image 'extrude_poly.jpg'
extrude_poly.jpg


 

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