/* This file started with: http://robottrouble.com/wp-content/uploads/2009/11/pov_layout.tmpl Linked to from http://www.robottrouble.com/2009/12/01/auto-rendering-stl-files-to-png/ Then I took the suggestions from Thingiverse.com's Google group. Then I added a bit more to center and scale the mesh. Then I threw on (basic) animation support (Circles object around the Z axis.) Uses axes_macro.inc found at http://lib.povray.org/searchcollection/download.php?objectName=AxesAndGridMacro&contributorTag=SharkD&version=1.2 Works with stl2pov 2.4.3 Tested with stl2pov 3.0.0beta, camera block below requires removal of sky, right and up lines. (May be different in final version.) License: Use and abuse this file however you want. You are not allowed to sue me and/or my employer(s). Please apply any licence that sends me the most money (or not, your choice, see Paypal donation link on my webpage.) Aaron "Robot Hacker" Shaw http://www.robhack.com/ */ #declare testing = true; #if( testing ) #include "axes_macro.inc" #include "d10_3.inc" // A lovely 10 sided die from http://www.thingiverse.com/thing:3018 #declare main_mesh = m_D10; #else // This is from Zach 'Hoeken' Smith' post at: // http://groups.google.com/group/thingiverse/browse_thread/thread/24bb045c63dd6d63# #include "/tools/povray/axes_macro.inc" #include "" #declare main_mesh = m_ #end // *** No modifcations required below here for quick renders of stl2pov output *** // *** No modifcations required below here for quick renders of stl2pov output *** // *** No modifcations required below here for quick renders of stl2pov output *** #declare temp_location = z * 200; #declare Camera_location = vrotate( z * 200 , <55,0,-45> ); #if(clock_on) // Animated circle around mesh #declare Camera_location = vrotate( z * 200 , <55,0,( frame_number * 360 / final_frame )> ); #end #declare Light1_location = vrotate( Camera_location , z * 20 ); #declare Light2_location = vrotate( Camera_location , z * -20 ); background { color rgb 0.9 } light_source { Light1_location rgb 1 } light_source { Light2_location rgb 1 } camera { perspective location Camera_location sky z right -4/3*y // Correct to left hand handedness (use this and/or sky z , up z.) up z look_at <0,0,0> } #declare Min = min_extent( main_mesh ); #declare Max = max_extent( main_mesh ); #declare Center = ( Min + Max ) / 2; #declare Size = Max - Min; #declare Scale_Desired = 175 / max( Size.x , Size.y , Size.z * 2 ); // scale to 175 units from which ever dimension is largest object { main_mesh texture { pigment {color rgb <0.1, 0.6, 0.1>} finish { ambient 0.15 diffuse 0.85 specular 0.3 } } translate < -Center.x , -Center.y , -Min.z > // Bottom on z=0 plane, centered x,y scale Scale_Desired } // the coordinate grid and axes Axes_Macro ( 100, // Axes_axesSize, The distance from the origin to one of the grid's edges. (float) 50, // Axes_majUnit, The size of each large-unit square. (float) 10, // Axes_minUnit, The number of small-unit squares that make up a large-unit square. (integer) 0.005, // Axes_thickRatio, The thickness of the grid lines (as a factor of axesSize). (float) on, // Axes_aBool, Turns the axes on/off. (boolean) on, // Axes_mBool, Turns the minor units on/off. (boolean) off, // Axes_xBool, Turns the plane perpendicular to the x-axis on/off. (boolean) off, // Axes_yBool, Turns the plane perpendicular to the y-axis on/off. (boolean) on // Axes_zBool, Turns the plane perpendicular to the z-axis on/off. (boolean) ) object { Axes_Object }