POV-Ray : Newsgroups : povray.newusers : difference declared mesh2 object : Re: difference declared mesh2 object Server Time
2 Jun 2024 12:38:07 EDT (-0400)
  Re: difference declared mesh2 object  
From: Alain
Date: 27 Dec 2012 18:31:30
Message: <50dcda52@news.povray.org>

> Hi all,
>
> This is my first post. I tried searching the forum, be couldn't find what I'm
> looking for ...
>
> Can I difference the same object on itself?
> I tried it and no error comes up, but the scene is empty.
> Thanks, Dick
>
> Code:
>
> difference {
>   object {
>    myBox
>    translate <0, 0, 0>
>    scale <1, 1, 1>
>   }
>   object {
>    myBox
>    translate <0.25, -0.01, 0.25>
>    scale <0.5, 1.01, 0.5>
>   }
> }
>
>

If your object is a regular, solid, primitive, or union of regular 
primitives, as you translate and unevenly scale the second instance, you 
should see something, unless the camera is not looking in the correct 
direction.
You also need some light source or it's going to be very dark.

If your object "myBox" is a regular primitive, declared like this or 
similarly:

#declare myBox = box{<-1,-1,-1>,<1,1,1> rotate<1,2,3> scale<0.7,1,2>}

You should have no problem.


If your myBox object is a mesh, or composed of a collection of polygons 
or any other "patch" object, you are heading for some problems.
For a mesh, take the advice of Warp, it's very good.
Just make sure that the inside_vector is not parallel to a face as it 
can confuse the insideness tests.

If you use a collection of polygons, the inside_vector will not work.
Same thing apply for the bicubic_patch.
If you have an union of triangles, make it into a mesh by replacing 
"union{" by "mesh{" and add an inside_vector, like "inside_vector 1".




Alain


Post a reply to this message

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