POV-Ray : Newsgroups : povray.newusers : Internal surface visible with Merge Server Time
23 Dec 2024 01:35:33 EST (-0500)
  Internal surface visible with Merge (Message 1 to 7 of 7)  
From: Der Minimalist
Subject: Internal surface visible with Merge
Date: 30 Oct 2010 05:20:00
Message: <web.4ccbe1f15b909b70fec5f1b80@news.povray.org>
Hi guys,

I hope you can help me out with the following.

I'm trying to make a glass flask and, despite using merge, I'm having problems
with visible internal surfaces. I use an image_map to get some text on the flask
and to prevent it from showing up on both sides I cut the flask in half and join
it with another half that doesn't have the image map.

However, when you join these two, with a small overlap so that the surfaces
don't coincide, you can clearly see where both halves have joined by a slightly
darker internal surface.

I have included a simple overlap of two transparent spheres below to show you
what I mean. I reckon there is a simple solution to this, but I wasn't able to
find it on the internet..



#include "colors.inc"
#include "textures.inc"

camera { location <10, 1, 4>      //location <7, 10, -10>


look_at <0,1,0> angle 60   //look_at <1,0,2> angle 67
translate x*-2
translate z*-2
}

/*old settings camera:
{ location <6, 15, -10>


look_at <-1.6,0,-0.3> angle 70
translate x*-2
translate z*-2
} */



         //<-4.5,-1.37,-11>

light_source {
        <0,15,0>
        color rgb <.8, .7, .6>*4.6
fade_distance 6 fade_power 1.2
  area_light x*3, y*3, 12, 12 circular orient adaptive 0

}

//Appearance plane---------------------------------------------------
#declare Surface =
texture {
pigment { rgb <0.15,0.15,0.15> }     //pigment { rgb <.7,.95,1> }
  finish { specular .5 reflection .2 }}


//plane-----------------------------------------------------------------------------------------
plane
{ y, -1.4
  texture {Surface}
}


plane
{ y, 160
  texture {Surface}
}


//Material glass------------------------------------------------------------
#declare myGlass = material{
                   texture { pigment{ color rgbt<1,1,1,0.95>}
                             finish {

                                      specular .8
                                      roughness .001
                                      conserve_energy

                                    }
                  } // end of texture
                        interior{ ior 1.03
                                  caustics 0.25
                                } // end of interior
}

//2 overlapping spehres-----------------------------------------------
merge {sphere {<0,0,0> 1.5

material {myGlass}}

sphere {<0,0,0> 1.5

material {myGlass}
rotate y*30
translate <0,0,0.2>}
}


Post a reply to this message

From: clipka
Subject: Re: Internal surface visible with Merge
Date: 30 Oct 2010 08:24:06
Message: <4ccc0e66@news.povray.org>
Am 30.10.2010 11:14, schrieb Der_Minimalist:
> Hi guys,
>
> I hope you can help me out with the following.
>
> I'm trying to make a glass flask and, despite using merge, I'm having problems
> with visible internal surfaces. I use an image_map to get some text on the flask
> and to prevent it from showing up on both sides I cut the flask in half and join
> it with another half that doesn't have the image map.
>
> However, when you join these two, with a small overlap so that the surfaces
> don't coincide, you can clearly see where both halves have joined by a slightly
> darker internal surface.
>
> I have included a simple overlap of two transparent spheres below to show you
> what I mean. I reckon there is a simple solution to this, but I wasn't able to
> find it on the internet..

It is rather difficult to judge from the sample scene you provided, as 
the effect might just as well be an optical effect of the "kink" in the 
CSG object's surface.

But the same effect can be seen with two cylinders joined end-to-end, 
too, so there /is/ something fishy there.


Post a reply to this message

From: StephenS
Subject: Re: Internal surface visible with Merge
Date: 30 Oct 2010 11:45:00
Message: <web.4ccc3c61d610b901723de3e00@news.povray.org>
"Der_Minimalist" <nomail@nomail> wrote:
> Hi guys,
>
> I hope you can help me out with the following.
>
> I'm trying to make a glass flask and, despite using merge, I'm having problems
> with visible internal surfaces.
....
Place your material in the merge not the individual spheres (in sample code).
Is this closer to what you want?
If your useing a difference{} make sure it's only at the top level of all csg's.
For example:define both sides of your flask first(overlap) then remove the
inside. You didn't say how you where doing the flask, I did a glass food
container and needed to use this method.

Stephen S


Post a reply to this message

From: Der Minimalist
Subject: Re: Internal surface visible with Merge
Date: 31 Oct 2010 04:25:00
Message: <web.4ccd2695d610b901fec5f1b80@news.povray.org>
Hi Stephen,

It works nicely in the sample code, but it didn't completely solve the problem
in my flask model. However,your advice did allow me to trace back the last
problem. I use a transparent image_map with some text on one half of the flask
and on the other half not. The "transparent" part of the .png seems to affect
the texture of the entire half of the sphere.

I could solve the problem by applying a blank .png image_map to the second half
and now the textures are the same. Maybe not the best way of solving this, but
it works for now. Many thanks for your time!


Post a reply to this message

From: Alain
Subject: Re: Internal surface visible with Merge
Date: 31 Oct 2010 13:50:11
Message: <4ccdac53$1@news.povray.org>

> Hi Stephen,
>
> It works nicely in the sample code, but it didn't completely solve the problem
> in my flask model. However,your advice did allow me to trace back the last
> problem. I use a transparent image_map with some text on one half of the flask
> and on the other half not. The "transparent" part of the .png seems to affect
> the texture of the entire half of the sphere.
>
> I could solve the problem by applying a blank .png image_map to the second half
> and now the textures are the same. Maybe not the best way of solving this, but
> it works for now. Many thanks for your time!
>
>
>
>

In this case, you should try using a cylindrical maping using a 
warp{cylindrical}. That way, you get somewhat less distortion and the 
image on one side don't repears on the oposite side.

Be sure to add "once".
Translate the image by -0.5*y to center it verticaly before scalling.
Use a scale statement before the warp: scale<1/3, 3,1> will result in 
your image covering 1/3 of the circumference and be 3 units high.

Sample:
pigment{image_map{png "Your Image.png" once }translate -0.5*y 
scale<1/3,3,1> warp{cylindrical}}

You may add a rotation on the Z axis before the scale to tilt the image 
if you want.
Don't translate on the X axis before the warp as it will result in your 
image been cut.


Alain


Post a reply to this message

From: Der Minimalist
Subject: Re: Internal surface visible with Merge
Date: 1 Nov 2010 03:10:01
Message: <web.4cce66b1d610b901fec5f1b80@news.povray.org>
A>
> In this case, you should try using a cylindrical maping using a
> warp{cylindrical}. That way, you get somewhat less distortion and the
> image on one side don't repears on the oposite side.
>
> Be sure to add "once".
> Translate the image by -0.5*y to center it verticaly before scalling.
> Use a scale statement before the warp: scale<1/3, 3,1> will result in
> your image covering 1/3 of the circumference and be 3 units high.
>
> Sample:
> pigment{image_map{png "Your Image.png" once }translate -0.5*y
> scale<1/3,3,1> warp{cylindrical}}
>
> You may add a rotation on the Z axis before the scale to tilt the image
> if you want.
> Don't translate on the X axis before the warp as it will result in your
> image been cut.
>
>
> Alain

Thanks Alain,

I had never heard of the warp command before. I will give it a try this week and
see what happens!


Post a reply to this message

From: Alain
Subject: Re: Internal surface visible with Merge
Date: 1 Nov 2010 15:40:22
Message: <4ccf17a6@news.povray.org>

> A>
>> In this case, you should try using a cylindrical maping using a
>> warp{cylindrical}. That way, you get somewhat less distortion and the
>> image on one side don't repears on the oposite side.
>>
>> Be sure to add "once".
>> Translate the image by -0.5*y to center it verticaly before scalling.
>> Use a scale statement before the warp: scale<1/3, 3,1>  will result in
>> your image covering 1/3 of the circumference and be 3 units high.
>>
>> Sample:
>> pigment{image_map{png "Your Image.png" once }translate -0.5*y
>> scale<1/3,3,1>  warp{cylindrical}}
>>
>> You may add a rotation on the Z axis before the scale to tilt the image
>> if you want.
>> Don't translate on the X axis before the warp as it will result in your
>> image been cut.
>>
>>
>> Alain
>
> Thanks Alain,
>
> I had never heard of the warp command before. I will give it a try this week and
> see what happens!
>
>
>
>

The warp is a somewhat "advanced" feature. Look at it in the 
documentations, the application I gave you is just one of the many uses 
for it.
Sections 3.5.12  Pattern Modifiers and 3.5.12.6  Warps (and followings) 
in the included documentation for the windows version.



Alain


Post a reply to this message

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