diff --git a/.gitignore b/.gitignore index 10be81c..c6d765d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +__pycache__ development/ old/ temp/ diff --git a/36zaika.py b/36zaika.py index 254c5b4..b1a95a3 100644 --- a/36zaika.py +++ b/36zaika.py @@ -20,7 +20,7 @@ 1.9.1.0 Reworked normals, added triangle tile normal. 1.9.16.2 Added global transform, changed randoms in normal and move from + to +/-, changed globals in export to UTF-8, added gamma note etc. -1.10.29.1 Per thingie texture overlay. +1.11.1.1 Per thingie texture overlay. ------------------- Main site: @@ -36,7 +36,7 @@ __copyright__ = '(c) 2007-2024 Ilya Razmanov' __credits__ = 'Ilya Razmanov' __license__ = 'unlicense' -__version__ = '1.10.29.1' +__version__ = '1.11.1.1' __maintainer__ = 'Ilya Razmanov' __email__ = 'ilyarazmanov@gmail.com' __status__ = 'Production' @@ -130,13 +130,6 @@ def src_lum(x, y): # {#884400, 19} ''' - cx = int(x) - cy = int(y) - cx = max(0, cx) - cx = min((X - 1), cx) - cy = max(0, cy) - cy = min((Y - 1), cy) - if info['planes'] < 3: # supposedly L and LA yntensity = src(x, y, 0) else: # supposedly RGB and RGBA @@ -156,10 +149,6 @@ def src_lum_blin(x, y): # {#884400, 25} fx = float(x) fy = float(y) # Uses float input coordinates for interpolation - fx = max(0, fx) - fx = min((X - 1), fx) - fy = max(0, fy) - fy = min((Y - 1), fy) # Neighbor pixels coordinates (square corners x0,y0; x1,y0; x0,y1; x1,y1) x0 = int(x) @@ -188,16 +177,13 @@ def src_lum_blin(x, y): # {#884400, 25} 'Persistence of Vision Ray Tracer Scene Description File\n', 'Version: 3.7\n', 'Description: Mosaic picture consisting from solid spheres, triangle packing, Regular plane partition 3/6.\n', - 'Author: Automatically generated by 3zaika program, based on AmphiSoft POV Sphere Mosaic plug-in, see POVRay Mosaic project at\n', + 'Author: Automatically generated by 36zaika program, based on AmphiSoft POV Sphere Mosaic plug-in, see POVRay Mosaic project at\n', 'https://github.com/Dnyarri/POVmosaic\n', 'https://gitflic.ru/project/dnyarri/povmosaic\n\n', 'developed by Ilya Razmanov aka Ilyich the Toad\n', 'https://dnyarri.github.io\n', 'mailto:ilyarazmanov@gmail.com\n\n', - f'Generated by: {__file__} ver: {__version__} at: {localtime}\n' - f'Converted from: {sourcefilename}\n' - f'Source info: {info}\n' - '*/\n\n', + f'Generated by: {__file__} ver: {__version__} at: {localtime}\n' f'Converted from: {sourcefilename}\n' f'Source info: {info}\n' '*/\n\n', ] ) @@ -245,9 +231,9 @@ def src_lum_blin(x, y): # {#884400, 25} '#declare thingie_normal_3 = normal{bumps 0.05 scale<1.0, 0.05, 0.5>}\n', '#declare thingie_normal_4 = normal{spiral1 8 0.5 scallop_wave}\n', '#declare thingie_normal_5 = normal{tiling 3 scale <0.5, 5, 0.5> rotate <90, 0, 0>}\n', - '\n// Global modifiers for all thingies in the scene\n', + '\n/* ----------------------------------------------------\n | Global modifiers for all thingies in the scene |\n ---------------------------------------------------- */\n\n', '#declare thingie_texture_2 = texture { // Define transparent texture overlay here\n', - ' pigment {gradient z colour_map {[0.0, rgbt <0,0,0,1>] [1.0, rgbt <0,0,0,1>]} scale 0.1 rotate <30, 30, 0>}};\n', # Transparent texture overlay + ' pigment {gradient z colour_map {[0.0, rgbt <0,0,0,1>] [1.0, rgbt <0,0,0,1>]} scale 0.1 rotate <30, 30, 0>}};\n\n', # Transparent texture overlay '#declare yes_color = 1; // Whether source per-thingie color is taken or global patten applied\n', '// Color-relater settings below work only for "yes_color = 1;"\n', '#declare cm = function(k) {k} // Color transfer function for all channels, all thingies\n', @@ -285,7 +271,7 @@ def src_lum_blin(x, y): # {#884400, 25} '#declare thething_transform = transform {\n // You can place your global scale, rotate etc. here\n}\n', '\n// Seed random\n', f'#declare rnd_1 = seed({int(seconds * 1000000)});\n\n', - 'background{color rgbft <0, 0, 0, 1, 1>} // Hey, I''m just trying to be explicit in here!\n\n', + 'background{color rgbft <0, 0, 0, 1, 1>} // Hey, I' 'm just trying to be explicit in here!\n\n', # Camera {#ff0000, 0} '\n/*\n Camera and light\n\n', 'NOTE: Coordinate system match Photoshop,\norigin is top left, z points to the viewer.\nsky vector is important!\n\n*/\n\n', diff --git a/44zaika.py b/44zaika.py index d3aa00e..686dd01 100644 --- a/44zaika.py +++ b/44zaika.py @@ -25,7 +25,7 @@ 1.9.1.0 Reworked normals. 1.9.16.2 Added global transform, changed randoms in normal and move from + to +/-, changed globals in export to UTF-8, added gamma note etc. -1.10.29.1 Per thingie texture overlay. +1.11.1.1 Per thingie texture overlay. ------------------- Main site: @@ -41,7 +41,7 @@ __copyright__ = '(c) 2007-2024 Ilya Razmanov' __credits__ = 'Ilya Razmanov' __license__ = 'unlicense' -__version__ = '1.10.29.1' +__version__ = '1.11.1.1' __maintainer__ = 'Ilya Razmanov' __email__ = 'ilyarazmanov@gmail.com' __status__ = 'Production' @@ -135,13 +135,6 @@ def src_lum(x, y): # {#884400, 19} ''' - cx = int(x) - cy = int(y) # nearest neighbor for float input - cx = max(0, cx) - cx = min((X - 1), cx) - cy = max(0, cy) - cy = min((Y - 1), cy) - if info['planes'] < 3: # supposedly L and LA yntensity = src(x, y, 0) else: # supposedly RGB and RGBA @@ -165,7 +158,7 @@ def src_lum(x, y): # {#884400, 19} 'Description: Mosaic picture consisting from solid boxes, square packing, Regular plane partition 4/4.\n', ' Other included objects are cylinders, spheres, etc.\n', ' see list "#declare thingie_1=" and below.\n', - 'Author: Automatically generated by 4zaika program, based on AmphiSoft POV Sphere Mosaic plug-in, see POVRay Mosaic project at\n', + 'Author: Automatically generated by 44zaika program, based on AmphiSoft POV Sphere Mosaic plug-in, see POVRay Mosaic project at\n', 'https://github.com/Dnyarri/POVmosaic\n', 'https://gitflic.ru/project/dnyarri/povmosaic\n\n', 'developed by Ilya Razmanov aka Ilyich the Toad\n', @@ -227,15 +220,15 @@ def src_lum(x, y): # {#884400, 19} '#declare thingie_normal_4 = normal{spiral1 8 0.5 scallop_wave}\n', '#declare counts = 8; #declare thingie_normal_5 = normal{function{mod(abs(cos(counts*x)+cos(-counts*y)+cos(counts*z)), 1)}}\n', '#declare thingie_normal_6 = normal{function{mod(8*sqrt(pow(x,2)+pow(y,2)+pow(z,2)), 1.0)}}\n', - '\n// Global modifiers for all thingies in the scene\n', + '\n/* ----------------------------------------------------\n | Global modifiers for all thingies in the scene |\n ---------------------------------------------------- */\n\n', '#declare thingie_texture_2 = texture { // Define transparent texture overlay here\n', - ' pigment {gradient z colour_map {[0.0, rgbt <0,0,0,1>] [1.0, rgbt <0,0,0,1>]} scale 0.1 rotate <30, 30, 0>}};\n', # Transparent texture overlay + ' pigment {gradient z colour_map {[0.0, rgbt <0,0,0,1>] [1.0, rgbt <0,0,0,1>]} scale 0.1 rotate <30, 30, 0>}};\n\n', # Transparent texture overlay '#declare yes_color = 1; // Whether source per-thingie color is taken or global patten applied\n', '// Color-relater settings below work only for "yes_color = 1;"\n', '#declare cm = function(k) {k} // Color transfer function for all channels, all thingies\n', '#declare f_val = 0.0; // Filter value for all thingies\n', '#declare t_val = 0.0; // Transmit value for all thingies\n', - '#declare evenodd_rotate = <0.0, 0.0, 0.0>; // Odd lines rotate, rarely useful\n', + '\n#declare evenodd_rotate = <0.0, 0.0, 0.0>; // Odd lines rotate, rarely useful\n', '#declare evenodd_offset = <0.5, 0, 0>; // Even lines shift for brick wall\n', '#declare evenodd_offset = <0.0, 0, 0>; // Default 0 even lines shift for no brick wall\n', '#declare scale_all = <1, 1, 1>; // Base scale of all thingies. 1=original\n', @@ -272,7 +265,7 @@ def src_lum(x, y): # {#884400, 19} '#declare thething_transform = transform {\n // You can place your global scale, rotate etc. here\n}\n', '\n// Seed random\n', f'#declare rnd_1 = seed({int(seconds * 1000000)});\n\n', - 'background{color rgbft <0, 0, 0, 1, 1>} // Hey, I''m just trying to be explicit in here!\n\n', + 'background{color rgbft <0, 0, 0, 1, 1>} // Hey, I' 'm just trying to be explicit in here!\n\n', # Camera {#ff0000, 0} '\n/*\n Camera and light\n\n', 'NOTE: Coordinate system match Photoshop,\norigin is top left, z points to the viewer.\nsky vector is important!\n\n*/\n\n', diff --git a/63zaika.py b/63zaika.py index aa6058f..d5ffc77 100644 --- a/63zaika.py +++ b/63zaika.py @@ -28,7 +28,7 @@ 1.9.1.0 Reworked normals. 1.9.16.2 Added global transform, changed randoms in normal and move from + to +/-, changed globals in export to UTF-8, added gamma note etc. -1.10.29.1 Per thingie texture overlay. +1.11.1.1 Per thingie texture overlay. ------------------- Main site: @@ -44,7 +44,7 @@ __copyright__ = '(c) 2007-2024 Ilya Razmanov' __credits__ = 'Ilya Razmanov' __license__ = 'unlicense' -__version__ = '1.10.29.1' +__version__ = '1.11.1.1' __maintainer__ = 'Ilya Razmanov' __email__ = 'ilyarazmanov@gmail.com' __status__ = 'Production' @@ -138,13 +138,6 @@ def src_lum(x, y): # {#884400, 19} ''' - cx = int(x) - cy = int(y) # nearest neighbor for float input - cx = max(0, cx) - cx = min((X - 1), cx) - cy = max(0, cy) - cy = min((Y - 1), cy) - if info['planes'] < 3: # supposedly L and LA yntensity = src(x, y, 0) else: # supposedly RGB and RGBA @@ -164,10 +157,6 @@ def src_lum_blin(x, y): # {#884400, 25} fx = float(x) fy = float(y) # Uses float input coordinates for interpolation - fx = max(0, fx) - fx = min((X - 1), fx) - fy = max(0, fy) - fy = min((Y - 1), fy) # Neighbor pixels coordinates (square corners x0,y0; x1,y0; x0,y1; x1,y1) x0 = int(x) @@ -198,7 +187,7 @@ def src_lum_blin(x, y): # {#884400, 25} 'Description: Mosaic picture consisting from solid spheres, triangle packing, Regular plane partition 6/3.\n', ' Other included objects are hexagonal prisms (honeycomb packing), cylinders,\n', ' etc., see list "#declare thingie_1=" below.\n', - 'Author: Automatically generated by 3zaika program, based on AmphiSoft POV Sphere Mosaic plug-in, see POVRay Mosaic project at\n', + 'Author: Automatically generated by 63zaika program, based on AmphiSoft POV Sphere Mosaic plug-in, see POVRay Mosaic project at\n', 'https://github.com/Dnyarri/POVmosaic\n', 'https://gitflic.ru/project/dnyarri/povmosaic\n\n', 'developed by Ilya Razmanov aka Ilyich the Toad\n', @@ -263,15 +252,15 @@ def src_lum_blin(x, y): # {#884400, 25} '#declare thingie_normal_4 = normal{spiral1 8 0.5 scallop_wave}\n', '#declare counts = 8; #declare thingie_normal_5 = normal{function{mod(abs(cos(counts*x)+cos(-counts*y)+cos(counts*z)), 1)}} // Typically counts 4-16 is acceptable\n', '#declare thingie_normal_6 = normal{function{64*abs(x*y*z)}}\n', - '\n// Global modifiers for all thingies in the scene\n', + '\n/* ----------------------------------------------------\n | Global modifiers for all thingies in the scene |\n ---------------------------------------------------- */\n\n', '#declare thingie_texture_2 = texture { // Define transparent texture overlay here\n', - ' pigment {gradient z colour_map {[0.0, rgbt <0,0,0,1>] [1.0, rgbt <0,0,0,1>]} scale 0.1 rotate <30, 30, 0>}};\n', # Transparent texture overlay + ' pigment {gradient z colour_map {[0.0, rgbt <0,0,0,1>] [1.0, rgbt <0,0,0,1>]} scale 0.1 rotate <30, 30, 0>}};\n\n', # Transparent texture overlay '#declare yes_color = 1; // Whether source per-thingie color is taken or global patten applied\n', '// Color-relater settings below work only for "yes_color = 1;"\n', '#declare cm = function(k) {k} // Color transfer function for all channels, all thingies\n', '#declare f_val = 0.0; // Filter value for all thingies\n', '#declare t_val = 0.0; // Transmit value for all thingies\n', - '#declare evenodd_transform = transform {rotate <0.0, 0.0, 0.0>} // Odd lines rotate, rarely useful\n', + '\n#declare evenodd_transform = transform {rotate <0.0, 0.0, 0.0>} // Odd lines rotate, rarely useful\n', '\n/* Map function\nMaps are transfer functions control value (i.e. source pixel brightness) is passed through.\n', 'By default exported map is five points linear spline, control points are set in the table below,\n', 'first column is input, first digits in second column is output for this input.\n', @@ -304,7 +293,7 @@ def src_lum_blin(x, y): # {#884400, 25} '#declare thething_transform = transform {\n // You can place your global scale, rotate etc. here\n}\n', '\n// Seed random\n', f'#declare rnd_1 = seed({int(seconds * 1000000)});\n\n', - 'background{color rgbft <0, 0, 0, 1, 1>} // Hey, I''m just trying to be explicit in here!\n\n', + 'background{color rgbft <0, 0, 0, 1, 1>} // Hey, I' 'm just trying to be explicit in here!\n\n', # Camera {#ff0000, 0} '\n/*\n Camera and light\n\n', 'NOTE: Coordinate system match Photoshop,\norigin is top left, z points to the viewer.\nsky vector is important!\n\n*/\n\n', diff --git a/help.html b/help.html index 87b7a3e..ab23004 100644 --- a/help.html +++ b/help.html @@ -67,6 +67,7 @@

Predefined objects, properties and modifiers thereof

#declare thingie_finish_n = Defines thingie finish. Default one is smooth plastic, but you can use anything else. Surely, using POVRay include files is also possible.

#declare thingie_normal_n = Defines thingie surface normal modifier. Default one have zero intensity to simplify the picture appearance. Remember that normal may be rotated and moved on a per thingie basis later (see normal_move_rnd and normal_rotate_rnd below), so any "elongated" patterns will be giving interesting results.

Global modifiers for all thingies in the scene

+

#declare thingie_texture_2 = texture{} Defines texture overlay thingie_texture_2, applied above generated texture of each thingie, thus giving the capability to build layered textures. Default exported example overlay is completely transparent and therefore invisible gradient, just edit one of its control points to opaque to get a feeling of what it's all about.

#declare yes_color = 1; Switch defining whether source per-thingie color is taken or global texture applied. Default is 1, i.e. colored mosaic; 0 gives solid thething texture which, in combination with scale_map, may give interesting pseudo-heightfield effects.

#declare cm = function(k) {k} Color modifier. Transfer function(k), by default output = input, changing it to something like {k+0.1} or {0.9*k} may be useful for a quick fix of poor color scene.

#declare f_value = Input: float number. All thingies colors are specified as rgbft (red, green, blue, filter, transmit); while rgb is set according to source image pixel color, filter component value is set to f_value globally. Default is 0.0 (completely opaque), you may change it to turn thething into glass.