POV-Ray : Newsgroups : povray.general : Cross-stitch and print on canvas (RFC, sort of) Server Time
23 Nov 2024 16:18:39 EST (-0500)
  Cross-stitch and print on canvas (RFC, sort of) (Message 1 to 5 of 5)  
From: Ilya Razmanov
Subject: Cross-stitch and print on canvas (RFC, sort of)
Date: 9 Feb 2024 08:40:26
Message: <65c62b4a@news.povray.org>
Greetings hunams,

I'm sort of in hopes of some feedback. As some may have noticed, I keep 
exploring idea of turning 2D image pixels into POVRay 3D objects and 
seeing what happens, and keep trying to use Python for that.

Attached are two small programs and one combined preview. One program 
turns image into something like print on canvas, while other turns image 
int cross-stitch.

The main problem is I'm not satisfied with normal. I did simulation os 
textile long ago and have some algorithmic normals witten in mini-C, 
but, unfortunately, I don't see the way to reproduce in with POVRay. SO 
far, I used spiral, but it's far from ideal.

Also I'm not quite satisfied with finish, but that's mostly problem of 
my not so perfect vision.

I have a high hope that someone take a look at it, dare to start it 
(hopefully Python is installed already) and probably give some feedback.

Note that these programs are not released yet, only sent here since I 
hope for feedback allowing me to improve it.

Ilyich the Toad
https://github.com/Dnyarri/  -  image to POV utils


Post a reply to this message


Attachments:
Download 'torimix.png' (185 KB) Download 'tori.zip' (7 KB)

Preview of image 'torimix.png'
torimix.png

From: Bald Eagle
Subject: Re: Cross-stitch and print on canvas (RFC, sort of)
Date: 9 Feb 2024 10:00:00
Message: <web.65c63d80a5dd03951f9dae3025979125@news.povray.org>
Hi Ilya,

> I'm sort of in hopes of some feedback. As some may have noticed, I keep
> exploring idea of turning 2D image pixels into POVRay 3D objects and
> seeing what happens, and keep trying to use Python for that.

You can certainly do that in POV-Ray itself, using the eval_pigment macro.


> The main problem is I'm not satisfied with normal. I did simulation os
> textile long ago and have some algorithmic normals witten in mini-C,
> but, unfortunately, I don't see the way to reproduce in with POVRay. SO
> far, I used spiral, but it's far from ideal.

Post the code for the normal, and we'll see if we can convert it into something
POV-Ray can do.

Until then, here's a few link that you might find interesting:

http://news.povray.org/povray.binaries.images/thread/%3C4a1e679e@news.povray.org%3E/

http://news.povray.org/povray.binaries.images/thread/%3C39f3b2ee@news.povray.org%3E/?mtop=8&moff=26


https://news.povray.org/povray.newusers/message/%3C64744689%241%40news.povray.org%3E/#%3C64744689%241%40news.povray.org
%3E

- BW


Post a reply to this message

From: Ilya Razmanov
Subject: Re: Cross-stitch and print on canvas (RFC, sort of)
Date: 9 Feb 2024 10:29:54
Message: <65c644f2$1@news.povray.org>
On 09.02.2024 17:58, Bald Eagle wrote:

> Post the code for the normal, and we'll see if we can convert it into something
> POV-Ray can do.

I'm using POVRay normal spiral1 scallop_wave with scale, rotate etc. It 
very roughly simulate threads, but is completely useless for multythreads.

I would like to superimpose several different wavy patterns, and 
probably something else for fluff. Maybe add, of maybe multiply them to 
each other. But for doung so, I need writing my own functions for 
normals, and I have no idea whether it's possible or not.

> Until then, here's a few link that you might find interesting:

I'm trying to limit scene to static primitives, preferrably small, to 
avoid slow rendering.

Ilyich the Toad


Post a reply to this message

From: Bald Eagle
Subject: Re: Cross-stitch and print on canvas (RFC, sort of)
Date: 9 Feb 2024 13:10:00
Message: <web.65c66a32a5dd03951f9dae3025979125@news.povray.org>
Ilya Razmanov <ily### [at] gmailcom> wrote:

> I would like to superimpose several different wavy patterns, and
> probably something else for fluff. Maybe add, of maybe multiply them to
> each other. But for doung so, I need writing my own functions for
> normals, and I have no idea whether it's possible or not.

Of course.

I gave you the link to the documentation on POV-Ray's functions.
Pigments and normals are just functions that take x, y, and z as their arguments
and use that to create the procedural pattern.

You can access them by using the pigment {} statement as a sort of look-up table
into the function, and then use normal {function {}} to apply it.

Here's a small scene to show how that's done.



#version 3.8;
global_settings {assumed_gamma 1.0 }
#include "functions.inc"

camera {
 location <0, 20, -50>
 right x*image_width/image_height
 up y
 look_at <0, 10, 0>
 rotate -y*20
}

light_source {<20, 50, -50> rgb 1} // for documentation illustrations

sky_sphere {pigment {rgb 1}}

#declare fmod = function (Value, Modulo) {select (Value, 1 - mod (abs (Value),
Modulo), mod (abs (Value), Modulo))}

#declare BW = color_map {
 [0 rgb 0]
 [1 rgb x+y]
}
#declare Spiral = function {pigment {spiral1 5}}
#declare Leopard = function {pigment {leopard}}
#declare Checker = function {pigment {checker 0 1 scale 3}}
#declare Crackle= function {pigment {crackle}}

#declare Mesh = function {f_mesh1 (x, z, y, 1, 0.2, 1, 0.1, 2)}
#declare Mesh2 = function {max(Mesh (x, y, z), 0)}

#declare Mixed = function {select (Checker (x, y, z).red, 0, Spiral(x, y,
z).red, Crackle (x, y, z).red)}

box {-10, 10 texture {pigment {rgb z} finish {specular 0.4} normal {function
{Spiral(x, y, z).red} bump_size 2}} }
box {-10, 10 texture {pigment {rgb z} finish {specular 0.4} normal {function
{Spiral(x, y, z).red*Leopard (x, y, z).red} bump_size 2}} translate x*20}
box {-10, 10 texture {pigment {rgb z} finish {specular 0.4} normal {function
{Spiral(x, y, z).red*(sin(x)+1)/2} bump_size 2}} translate -x*20}
box {-10, 10 texture {pigment {rgb z} finish {specular 0.4} normal {function
{Mixed (x, y, z)} bump_size 2}} translate -x*20 translate y*20}
box {-10, 10 texture {pigment {function {Mesh2(x, y, z)} color_map {BW}} finish
{specular 0.4} normal {function {Mesh (x, y, z)} bump_size 2}} translate x*20
translate y*20}




- BW


Post a reply to this message


Attachments:
Download 'normal function.png' (790 KB)

Preview of image 'normal function.png'
normal function.png


 

From: Ilya Razmanov
Subject: Re: Cross-stitch and print on canvas (RFC, sort of)
Date: 9 Feb 2024 14:30:45
Message: <65c67d65$1@news.povray.org>
On 09.02.2024 21:08, Bald Eagle wrote:

> Here's a small scene to show how that's done.

- Directions even your brother can understand. (c) Hudson Hawk

Well, basically for now it seems like all I need are functions of 
coordinates, once I manage to understand syntaxis, I'll manage to 
combine functions into something. And it seems like I understand your 
example (surely, nothing cant stop me from being wrong, lol); well, 
basically.

So thank you very much, I'll try to gather some understanding.

Ilyich the Toad


Post a reply to this message

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