POV-Ray : Newsgroups : povray.binaries.images : A method creat uniform thick shell Server Time
5 May 2024 21:09:07 EDT (-0400)
  A method creat uniform thick shell (Message 21 to 30 of 45)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: And
Subject: Re: A method creat uniform thick shell
Date: 23 Jul 2018 08:00:01
Message: <web.5b55c221dce0719ae897ce530@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> On 7/22/2018 6:19 AM, And wrote:
> > Mike Horvath <mik### [at] gmailcom> wrote:
> >>
> >> Never mind. I figured it out.
> >>
> >> Mike
> >
> > Is it ok?
> >
>
> Yes, it works well!
>
> The routine would be very helpful in this object collection:
>
>
http://lib.povray.org/searchcollection/index2.php?objectName=ShapeGrid&version=1.11&contributorTag=SharkD
>
> Would it be okay if I added it there? The license for the collection is
> CC-LGPL.
>
> Thanks!
>
> Mike

I saw your links and not very understand what is that object function. Can you
describe?


Post a reply to this message

From: Mike Horvath
Subject: Re: A method creat uniform thick shell
Date: 23 Jul 2018 19:16:42
Message: <5b5661da$1@news.povray.org>
On 7/23/2018 7:55 AM, And wrote:
> I saw your links and not very understand what is that object function. Can you
> describe?
> 

Normally, a person might create internal lines of latitude and longitude 
on a sphere by drawing one outer shape and then simply scaling it 
smaller as you go deeper inside the sphere. The macros I linked to 
ensure that the *lines* are always the same thickness, throughout the 
entire object.

An offset surface such as what is generated by your macro is ideal for 
this purpose, when it's not possible to use regular CSG objects to 
accomplish the same. (Isosurfaces are kind of slow.)


Mike


Post a reply to this message

From: And
Subject: Re: A method creat uniform thick shell
Date: 24 Jul 2018 08:25:00
Message: <web.5b571a06dce0719ae897ce530@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> On 7/23/2018 7:55 AM, And wrote:
> > I saw your links and not very understand what is that object function. Can you
> > describe?
> >
>
> Normally, a person might create internal lines of latitude and longitude
> on a sphere by drawing one outer shape and then simply scaling it
> smaller as you go deeper inside the sphere. The macros I linked to
> ensure that the *lines* are always the same thickness, throughout the
> entire object.
>
> An offset surface such as what is generated by your macro is ideal for
> this purpose, when it's not possible to use regular CSG objects to
> accomplish the same. (Isosurfaces are kind of slow.)
>
>
> Mike

Well, I permit you to release it on CC-LGPL. But my macro is still far from what
you want I think


Post a reply to this message

From: And
Subject: Re: A method creat uniform thick shell
Date: 24 Jul 2018 08:40:00
Message: <web.5b571d64dce0719ae897ce530@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
> I have written a macro which uses above technique to make an isosurface thin
> shell. I post it below. But I found that it is only for a small thickness or it
> don't have a constant thickness result. Furthermore, for many functions its
> result is not expect.
>
> So, don't take too much expect with it.
>
> //-------------------macro-----------------------------
>
> #macro Shape_ThinShellOf3DFunction(input_function, _min_extent, _max_extent,
> _thickness, _max_gradient)
> #local CSG_OVERLAP=0.001;
> #local h=0.00001;
> #local normalized_function =
> function(var1,var2,var3)
> {
> input_function(var1,var2,var3)
> /sqrt(
> pow((input_function(var1+h,var2,var3)-input_function(var1,var2,var3))/h,2)
> +pow((input_function(var1,var2+h,var3)-input_function(var1,var2,var3))/h,2)
> +pow((input_function(var1,var2,var3+h)-input_function(var1,var2,var3))/h,2)
> )
> }
> difference{
> isosurface{
> function{normalized_function(x,y,z)-_thickness/2}
> max_gradient _max_gradient
> contained_by{box{_min_extent,_max_extent}}
> all_intersections
> }
> isosurface{
> function{normalized_function(x,y,z)+_thickness/2}
> max_gradient _max_gradient
>
contained_by{box{_min_extent-<CSG_OVERLAP,CSG_OVERLAP,CSG_OVERLAP>,_max_extent+<CSG_OVERLAP,CSG_OVERLAP,CSG_OVERLAP>}
}
> all_intersections
> }
> }
> #end
>
>
>
>
>
> //---------------------Here is a good look example------
>
> #declare f_noise3d = function { internal(76) }
> #declare f_test=
> function(x,y,z){
> x*x+y*y+z*z-1- 0.5*f_noise3d(x/0.3,y/0.3,z/0.3)
> }
>
> difference{
> Shape_ThinShellOf3DFunction(f_test, <-1.3,-1.3,0>, <1.3,1.3,1.3>, 0.04, 10)
> box{<-1.5,-1.5,-0.1>,<1.5,0,1.5>}
> texture{
>     pigment{rgb<1,1,1>}
>     finish{
>         ambient 0.1
>         diffuse 0.6
>     }
> }
> }
>
> //----------------------------------------------------------


Use the macro. and input function below

#declare f_parabola=function(x,y,a){
y-a*x*x
}

#declare f_curve = function(x,y) {
pow(f_parabola(x,y,1), 2) + 0.2*y*y - 0.02
}

#declare f_circle = function(x,y) {
x*x + y*y - 0.5*0.5
}


#declare h = 0.5;


#declare f_test=
function(x,y,z){
(z/h)*f_curve(x,y) + (1-z/h)*f_circle(x,y) - 0.2*f_noise3d(x/0.2,y/0.2,z/0.2)
}


object{
Shape_ThinShellOf3DFunction(f_test, <-1.4,-1.3,0>, <1.4,1.4,0.5>, 0.024, 10)

texture{
    pigment{rgbt<0.014,0.011,0.007, 0.9>}
    finish{
        ambient 0.0
        diffuse 1.0

        reflection {0.01, 0.89 fresnel}conserve_energy
    }
}
interior{
    ior 1.46
    fade_colour rgb<0.6, 0.4, 0.3>
    fade_distance 2.6
    fade_power 1001
}
no_radiosity


}


Post a reply to this message


Attachments:
Download 'scene glass.png' (104 KB)

Preview of image 'scene glass.png'
scene glass.png


 

From: Paolo Gibellini
Subject: Re: A method creat uniform thick shell
Date: 25 Jul 2018 02:54:25
Message: <5b581ea1$1@news.povray.org>
And wrote on 24/07/2018 14:36:
> "And" <49341109@ntnu.edu.tw> wrote:
>> I have written a macro which uses above technique to make an isosurface thin
>> shell. I post it below. But I found that it is only for a small thickness or it
>> don't have a constant thickness result. Furthermore, for many functions its
>> result is not expect.
>>
>> So, don't take too much expect with it.
>>

Nice effect.
Now, I'm curious to see the jar filled of water.
;-)
Paolo


Post a reply to this message

From: And
Subject: Re: A method creat uniform thick shell
Date: 25 Jul 2018 05:30:01
Message: <web.5b584307dce0719a5341e80e0@news.povray.org>
Paolo Gibellini <p.g### [at] gmailcom> wrote:
> And wrote on 24/07/2018 14:36:
> > "And" <49341109@ntnu.edu.tw> wrote:
> >> I have written a macro which uses above technique to make an isosurface thin
> >> shell. I post it below. But I found that it is only for a small thickness or it
> >> don't have a constant thickness result. Furthermore, for many functions its
> >> result is not expect.
> >>
> >> So, don't take too much expect with it.
> >>
>
> Nice effect.
> Now, I'm curious to see the jar filled of water.
> ;-)
> Paolo

The rendering is very slow. I 'd rather sculpt one using mesh than using this
method.


Post a reply to this message

From: Thomas de Groot
Subject: Re: A method creat uniform thick shell
Date: 25 Jul 2018 07:02:23
Message: <5b5858bf$1@news.povray.org>
On 24-7-2018 14:36, And wrote:
> "And" <49341109@ntnu.edu.tw> wrote:
>> I have written a macro which uses above technique to make an isosurface thin
>> shell. I post it below. But I found that it is only for a small thickness or it
>> don't have a constant thickness result. Furthermore, for many functions its
>> result is not expect.
>>
>> So, don't take too much expect with it.
>>

I like it very much. As always, I shall note down the macro for future 
reference/use.

-- 
Thomas


Post a reply to this message

From: And
Subject: Re: A method creat uniform thick shell
Date: 25 Jul 2018 08:20:00
Message: <web.5b586a43dce0719a5341e80e0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 24-7-2018 14:36, And wrote:
> > "And" <49341109@ntnu.edu.tw> wrote:
> >> I have written a macro which uses above technique to make an isosurface thin
> >> shell. I post it below. But I found that it is only for a small thickness or it
> >> don't have a constant thickness result. Furthermore, for many functions its
> >> result is not expect.
> >>
> >> So, don't take too much expect with it.
> >>
>
> I like it very much. As always, I shall note down the macro for future
> reference/use.
>
> --
> Thomas

Oh, it's nice


Post a reply to this message

From: Mike Horvath
Subject: Re: A method creat uniform thick shell
Date: 28 Jul 2018 09:48:22
Message: <5b5c7426$1@news.povray.org>
I am trying to do the same, but am having trouble toning down the 
reflections. I can barely see through the glass, and the finish is 
reflecting too much and too brightly.

Mike


Post a reply to this message


Attachments:
Download 'offset_surface_save_01.png' (229 KB) Download 'utf-8' (4 KB)

Preview of image 'offset_surface_save_01.png'
offset_surface_save_01.png

From: Jim Holsenback
Subject: Re: A method creat uniform thick shell
Date: 28 Jul 2018 09:53:08
Message: <5b5c7544@news.povray.org>
On 07/28/2018 09:48 AM, Mike Horvath wrote:
> I am trying to do the same, but am having trouble toning down the 
> reflections. I can barely see through the glass, and the finish is 
> reflecting too much and too brightly.
> 
> Mike
just a guess .. diffuse and / or reflection too high


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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