POV-Ray : Newsgroups : povray.general : Segmentation fault : Segmentation fault Server Time
29 Jul 2024 06:15:49 EDT (-0400)
  Segmentation fault  
From: Anthony D  Baye
Date: 12 Oct 2012 21:15:01
Message: <web.5078c0212d73b82bd97ee2b90@news.povray.org>
anybody else get a seg-fault running this code?

Not sure what the problem is, but if I had to guess, it's too many objects in a
union...

Regards,
A.D.B.

#include "kolors.inc"
#include "rand.inc"
#include "math.inc"
#include "woods.inc"

#version 3.7;

global_settings {
     assumed_gamma 1.0
     }

light_source {
     0*x
     rgb 1
     translate <100, 500, -300>
     }
camera {
     perspective
     location <0.75, 4.5, -3.75>
     up y
     right x*(image_width/image_height)
     look_at <0.0, 4.0, 0.0>
     }

#declare ft = 12;

#declare dP =
pigment {
     image_map {
          jpeg "aperture_science_logo_800.jpg"
          map_type 0
          interpolate 4
          once
          }
          translate <-0.5, -0.5, 0.0>
          scale 1.0
          translate 4.0*y
     }

#declare P_OldWood =
pigment {
     wood
     turbulence <0.3, 0.1, 0.5>
     color_map { M_Wood1A }
      scale <0.125*ft, 1.0, 1.0*ft>
     }
#declare F_OldWood =
function {
 pattern {
  wood
  turbulence <0.3, 0.1, 0.5>
  scale <0.125*ft, 1.0, 1.0*ft>
  }
 }

#macro Board(W, T, L)
#local grain_seed = 15643544181;
#local _X = Rand_Normal(0.0, 1.0, RdmA)*2e5;
#local _Y = Rand_Normal(0.0, 1.0, RdmB)*2e5;
#local _Z = Rand_Normal(0.0, 1.0, RdmC)*2e5;

isosurface {
 function {
      f_rounded_box(x,y,z,0.125,
           W/2-0.03125*F_OldWood(x-_X,y-_Y,z-_Z),
           T/2-0.078125*F_OldWood(x-_X,y-_Y,z-_Z),
           L/2+0.25)
      }
 threshold 0
 max_gradient 2
 contained_by { box { <-W/2, -T/2, -L/2> <W/2, T/2, L/2> } }
 all_intersections
          pigment { P_OldWood translate <_X,_Y,_Z> }
  finish { ambient 0 diffuse 0.38 specular 0.07 roughness 0.3 }
 }
#end
plane {
     y, 0
     pigment {
          checker
          color White,
          color rgb <0.078125, 0.375, 0.75>
          }
     }

#declare Env =
object { Board(12, 2, 30) scale 1/12 rotate <-90, 0.0, -90> translate 4.0*y }
/*
plane {
     -z, 0
     pigment {
          checker
          color White,
          color White*0.3
          }
     }
*/
#declare Pattern = union {}

//#declare pSubT = -1.0;
//#while(PSubT <= 1.0)

#local a = 0;
#while(a < 60000)

     #local PHI = Rand_Normal(0.0, 1.0, RdmA)*10;
     #local THETA = Rand_Normal(0.0, 1.0, RdmB)*180;
     #local Trajectory = <sind(PHI)*cosd(THETA), sind(PHI)*sind(THETA),
cosd(PHI)>;
     // Begin trace
     #local Norm = <0, 0, 0> ; // degenerate Normal vector.
     #local Start = <0.0, 4.0, -3.0> ; // The object starts here.

     #local Pos = trace (Env, Start,  Trajectory,  Norm) ; // And comes to rest
here.
     // End trace

/*     #if(
          vlength(
               <eval_pigment(dP, Pos).red,
                eval_pigment(dP, Pos).green,
                eval_pigment(dP, Pos).blue>
                ) = 0
          )*/
          #declare Pattern =
          union {
               object { Pattern }
               sphere { Pos, 0.001 }
               }
//     #end

#local a = a + 1;
#end

//#declare pSubT = pSubT + 0.

union {
     object { Env }
     object { Pattern pigment { Black } }
     }


Post a reply to this message

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