POV-Ray : Newsgroups : povray.unofficial.patches : Megapov: is there a bug? mesh in environment Server Time
18 Apr 2024 22:29:24 EDT (-0400)
  Megapov: is there a bug? mesh in environment (Message 1 to 1 of 1)  
From: Agostino De Matteis
Subject: Megapov: is there a bug? mesh in environment
Date: 9 Jul 2006 13:42:39
Message: <44b1400f$1@news.povray.org>
I don't know if this could interest anyone here, but I don't know where 
else to post it :-)

Defining the object in the environment section I used a mesh2 but 
Megapov 1.21 had a problem, the error message was:

"The POV-Ray core rendering code threw an unhandled exception.
The backend thread has been shut down and you will not be able to 
perform any further renders.
[....]"

The mesh2 object was created using param.inc, from 
http://members.home.nl/seedseven/#param

Code example that gives that problem:

======cut=====
#version unofficial MegaPov 1.21;

#include "mechsim.inc"
#include "colors.inc"
#include "param.inc"
#include "math.inc"

#declare FR=function{pattern{bozo scale 0.3}}
#declare R1=function(u,v){
         f_ridged_mf(14*u,14*v,0, 1, 4.77, 31, 0.5, 2, 1)
}

#declare F1= function(u,v){u}
#declare F2= function(u,v){v}
#declare F3= function(u,v){
                 R1(u,v)*0.2+FR(u,v,0)*0.1
                 +sin(u-1.5)/2.5+
                 sin(v-1.5)/10
         }

#declare base=
object{
    Parametric(
       F1, F3, F2,
       <-3, -3>,
       < 3, 3>,
       35,35,
       ""
    )
    scale 5
    uv_mapping
    rotate<0,180,0>
    pigment{
         White
    }

}

#declare ob_env=union{
         object{ base}
}


global_settings {
   assumed_gamma 1.0

   mechsim {
     gravity <0, -9.81, 0>
         method 1
     environment {
         object ob_env
         stiffness 240000
         damping 50000
         friction 0.1, 1.01
         method 1
     }

     #declare fname="bug00-";
     #if (clock_on)
         #declare start=0;
         #declare 
datin=concat(fname,"-",str(start+frame_number-1,-2,0),".dat");
         #declare 
datout=concat(fname,"-",str(start+frame_number,-2,0),".dat");

         #debug concat ("read ",datin," write ",datout,"\n")

         #declare ffn=30;
         #declare stc=30;//0-2 1400;//1400
         #declare dvc=80;//0-2 1400;//1400
         step_count stc
         time_step (1/ffn)/dvc

       topology {
         load_file datin //datfile

         save_file datout //datfile
       }
     #else
       step_count 0
       #local dde=25000;
       #local ddi=25000;
       topology {
         MechSim_Generate_Sphere(<0, 0, 0>, 0.05, dde, 1900, 2000, ddi, 
1600, 2000, true, 1, 0.75,
                 transform{
                         scale<1,1.5,1>
                         rotate<0,0,135>
                         translate<0,4,0>
         }
         )
         #declare datout=concat(fname,"-00.dat"); 


         save_file datout
       }
     #end
   }
}

#declare MSim_Tex_N=texture{
         pigment { Red }
}
#declare MSim_Tex_C =texture{
         pigment{Yellow}
}
#declare MSim_Tex_Mesh=texture{
         pigment{
                 Red
                 }
}


MechSim_Show_All_Objects(-1, false, -1, "")

object{
         ob_env
}


light_source {
   <0, 120, 0>
   color rgb <1, 1, 1>

}

sky_sphere {
   pigment {
     gradient y
     color_map {
       [0.0 rgb <0.3,0.35,0.8>]
       [0.7 rgb <0.0,0.1,0.4>]
     }
   }
}

#declare cax=0;
#declare caxd=0;

#declare cay=3.25;
#declare cayd=-0.5;
#declare caz=-26.0;
#declare cazd=16.0;

#declare caxl=cax+caxd;
#declare cayl=cay+cayd;
#declare cazl=caz+cazd;;


camera {
   location  <cax, cay, caz>
   up y*1
   right     x*image_width/image_height
   look_at   <caxl, cayl,  cazl>
}
======cut=====

If clock_on is false all works and the .dat file is created, after that, 
using the -kff switch, it gives the error message.

The operative system used to run Megapov is Windows 98 SE.

Using a parametric object instead of the mesh2 works fine.

'bye


Post a reply to this message

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