POV-Ray : Newsgroups : povray.windows : Looks like #if isnt working Server Time
28 Mar 2024 09:15:32 EDT (-0400)
  Looks like #if isnt working (Message 1 to 2 of 2)  
From: gharryh
Subject: Looks like #if isnt working
Date: 23 Oct 2012 06:20:01
Message: <web.50866ebda5ea52fc520168c30@news.povray.org>
Could someone telle what is wrong here.
During development i would like to display a grid.
Therefore i use the inc_testmode variable.
But it seems not to work in anyway.

/** code **/
#declare inc_testmode = on;
#declare global_res_shape = 1;
#declare global_res_colselect = 0;
#declare global_res_col = 1;
#declare pcb_upsidedown = off;
#declare pcb_rotdir = x;
#declare pin_length = 2.5;
#declare global_diode_bend_radius = 1;
#declare global_res_bend_radius = 1;
#declare global_solder = on;

#declare global_show_screws = on;
#declare global_show_washers = on;
#declare global_show_nuts = on;

#declare global_use_radiosity = on;

#declare global_ambient_mul = 1;
#declare global_ambient_mul_emit = 0;

//Animation
#declare global_anim = off;
#local global_anim_showcampath = no;

#declare global_fast_mode = off;

#declare col_preset = 2;
#declare pin_short = on;

#declare e3d_environment = off;

#local cam_x = 0;
#local cam_y = 260;
#local cam_z = -86;
#local cam_a = 25;
#local cam_look_x = 0;
#local cam_look_y = -3;
#local cam_look_z = 0;

#local pcb_rotate_x = 0;
#local pcb_rotate_y = 0;
#local pcb_rotate_z = 0;

#local pcb_board = on;
#local pcb_parts = on;
#local pcb_wire_bridges = off;
#if(global_fast_mode=off)
 #local pcb_polygons = on;
 #local pcb_silkscreen = on;
 #local pcb_wires = on;
 #local pcb_pads_smds = on;
#else
 #local pcb_polygons = off;
 #local pcb_silkscreen = off;
 #local pcb_wires = off;
 #local pcb_pads_smds = off;
#end

#local lgt1_pos_x = 30;
#local lgt1_pos_y = 46;
#local lgt1_pos_z = 19;
#local lgt1_intense = 0.743527;
#local lgt2_pos_x = -30;
#local lgt2_pos_y = 46;
#local lgt2_pos_z = 19;
#local lgt2_intense = 0.743527;
#local lgt3_pos_x = 30;
#local lgt3_pos_y = 46;
#local lgt3_pos_z = -13;
#local lgt3_intense = 0.743527;
#local lgt4_pos_x = -30;
#local lgt4_pos_y = 46;
#local lgt4_pos_z = -13;
#local lgt4_intense = 0.743527;

//Do not change these values
#declare pcb_height = 1.500000;
#declare pcb_cuheight = 0.035000;
#declare pcb_x_size = 81.250000;
#declare pcb_y_size = 37.500000;
#declare pcb_layer1_used = 1;
#declare pcb_layer16_used = 1;
#declare inc_testmode = off;
#declare global_seed=seed(241);
#declare global_pcb_layer_dis = array[16]
{
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 0.000000,
 1.535000,
}
#declare global_pcb_real_hole = 2.000000;
#include "e3d_tools.inc"
#include "e3d_user.inc"

global_settings{charset utf8}


#if(inc_testmode = on)

        //Size of the Grid Plane (+/- span)
        #local XYZ_span=20;

        //Orientation axes
        cylinder{<-XYZ_span,0,0><XYZ_span,0,0>0.1 pigment{Blue}} //X
        cylinder{<0,-XYZ_span,0><0,XYZ_span,0>0.1 pigment{Red}}  //Y
        cylinder{<0,0,-XYZ_span><0,0,XYZ_span>0.1 pigment{Yellow}} //Z

        // Useful GRIDS:
        #local XYZ_step= 1 ;          // axis increment
        #local XYZ_cnt = 0;           //  loop counter
        #local xyz_thick = 0.025;      // grid line thickness

        // GRID PLANES: Remove comment begin/end to activate & select PLANES:
        #while (XYZ_cnt <= XYZ_span)

         cylinder{<-XYZ_span,0,XYZ_cnt><XYZ_span,0,XYZ_cnt>xyz_thick
pigment{Blue}}  // Positive Z-Lines
         cylinder{<-XYZ_span,0,-XYZ_cnt><XYZ_span,0,-XYZ_cnt>xyz_thick
pigment{Blue}} // Negative Z-Lines

         //cylinder{<0,XYZ_cnt,-XYZ_span><0,XYZ_cnt,XYZ_span>xyz_thick
pigment{Red}}  // Positive Y-Z Plane Lines
         //cylinder{<0,-XYZ_cnt,-XYZ_span><0,-XYZ_cnt,XYZ_span>xyz_thick
pigment{Red}} // Negative Y-Z Plane Lines

         cylinder{<-XYZ_span,XYZ_cnt,0><XYZ_span,XYZ_cnt,0>xyz_thick
pigment{Red}}  // Positive Y-X Plane Lines
         cylinder{<-XYZ_span,-XYZ_cnt,0><XYZ_span,-XYZ_cnt,0>xyz_thick
pigment{Red}} // Negative Y-X Plane Lines

         //cylinder{<XYZ_cnt,0,-XYZ_span><XYZ_cnt,0,XYZ_span>xyz_thick
pigment{Yellow}} // Positive X-Lines
         //cylinder{<-XYZ_cnt,0,-XYZ_span><-XYZ_cnt,0,XYZ_span>xyz_thick
pigment{Yellow}} // Negative X-Lines

         #local XYZ_cnt = XYZ_cnt+XYZ_step;
        #end
#end

#declare global_show_screws=on;
#declare global_show_nuts=on;
#declare global_show_washers=on;

#local Vue=0;
#local D=50;
#local dx=0;
#local dy=50;
#local dz=-0;
#local Target = 0;
/*
0 Front
1 Left
2 Right
3 Back
4 Front-Left
5 Front-Right
6 Top
7 Top Front
8 Top Left
9 Top Right
10 Bottom
11 Back-Left

0 zero
1 straight
*/

#switch(Vue)
        #case(0) // Front
                camera{ location <dx,dy,-D+dz>
        #break
        #case(1) // Left side
                camera{ location <-D+dx,dy,dz>
        #break
        #case(2) // Right side
                camera{ location <D+dx,dy,dz>
        #break
        #case(3) // Back
                camera{ location <dx,dy,D+dz>
        #break
        #case(4) // Left-Front
                camera{ location <-D+dx,dy,-D+dz>
        #break
        #case(5) // Right Front
                camera{ location <D+dx,dy,-D+dz>
        #break
        #case(6) // Top
                camera{ location <dx,D+dy,dz>
        #break
        #case(7) // Top Front
                camera{ location <dx,D+dy,-D+dz>
        #break
        #case(8) // Top Left
                camera{ location <-D+dx,D+dy,dz>
        #break
        #case(9) // Top Right
                camera{ location <D+dx,D+dy,dz>
        #break
        #case(10) // Bot
                camera{ location <dx,-D+dy,dz>
        #break
        #case(11) // Left-back
                camera{ location <-D+dx,dy,D-dz>
        #break
        #case(100) // Free
                camera{ location <0,0,0>
        #break
#end

#if (Target = 0)
     look_at  <0,0,0>}
#else
        #switch(Vue)
                #case(0) // Front
                        look_at  <dx,dy,0>}
                #break
                #case(1) // Left side
                        look_at  <0,dy,dz>}
                #break
                #case(2) // Right side
                        look_at  <0,dy,dz>}
                #break
                #case(3) // Back
                        look_at  <dx,dy,0>}
                #break
                #case(4) // Left-Front
                        look_at  <0,dy,0>}
                #break
                #case(5) // Right Front
                        look_at  <0,dy,0>}
                #break
                #case(6) // Top
                        look_at  <dx,0,0>}
                #break
                #case(7) // Top Front
                        look_at  <dx0,dz>}
                #break
                #case(8) // Top Left
                        look_at  <0,0,dz>}
                #break
                #case(9) // Top Right
                        look_at  <0,0,dz>}
                #break
                #case(10) // Free
                        look_at  <5,5.71,0>}
                #break
        #end
#end

light_source{ <-100,200,-200> color White}
light_source{ <+100,200,-200> color White}
light_source{ <+100,200,200> color White}
light_source{ <00,-200,00> color White}
light_source{ <-50,00,00> color White}

//sky_sphere {pigment {rgb <0.8,0.8,1>}}
sky_sphere {pigment {rgb <1,1,1>}}

union{
#if(inc_testmode = on)
        object {CAP_DIS_WIMA_25_025_046_075("10n",)}
#else
        object {CAP_DIS_WIMA_25_025_046_075("100n",)}
#end

}

//rotate <0,0,360*clock>

/** end code **/


Post a reply to this message

From: clipka
Subject: Re: Looks like #if isnt working
Date: 23 Oct 2012 18:07:44
Message: <50871530$1@news.povray.org>
Am 23.10.2012 12:17, schrieb gharryh:
> Could someone telle what is wrong here.
> During development i would like to display a grid.
> Therefore i use the inc_testmode variable.
> But it seems not to work in anyway.

You set inc_testmode at two places:

>
> /** code **/
> #declare inc_testmode = on;
...
> //Do not change these values
> #declare pcb_height = 1.500000;
> #declare pcb_cuheight = 0.035000;
> #declare pcb_x_size = 81.250000;
> #declare pcb_y_size = 37.500000;
> #declare pcb_layer1_used = 1;
> #declare pcb_layer16_used = 1;
> #declare inc_testmode = off;
...

Maybe that's why you don't get what you expected.


Post a reply to this message

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