POV-Ray : Newsgroups : povray.newusers : Newbie 'difference' question Server Time
31 Oct 2024 10:21:44 EDT (-0400)
  Newbie 'difference' question (Message 1 to 7 of 7)  
From: Graham
Subject: Newbie 'difference' question
Date: 31 Dec 2008 07:10:01
Message: <web.495b60b84df161259fd2e7280@news.povray.org>
Not sure if this is the right place to ask, but here goes:

I have two objects that each render individually and as a CSG union, but when I
use the CSG difference function on the two objects (both mesh2 objects with
some common and unique volume) neither appears in the render.

Does anyone have some wisdom to impart?


Post a reply to this message

From: Stephen
Subject: Re: Newbie 'difference' question
Date: 31 Dec 2008 08:13:28
Message: <cvrml4lpe7oouk0mmjf5f14e6npjggh5vr@4ax.com>
On Wed, 31 Dec 2008 07:08:24 EST, "Graham" <nomail@nomail> wrote:

>Not sure if this is the right place to ask, but here goes:
>
>I have two objects that each render individually and as a CSG union, but when I
>use the CSG difference function on the two objects (both mesh2 objects with
>some common and unique volume) neither appears in the render.
>
>Does anyone have some wisdom to impart?
>

I just did a quick test with two Poser Models and I got the difference and
intersections to render OK. If the meshes are not too big you could post a
scene.
-- 

Regards
     Stephen


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Newbie 'difference' question
Date: 31 Dec 2008 09:30:00
Message: <web.495b8159befd7453c67b294d0@news.povray.org>
"Graham" <nomail@nomail> wrote:
> Not sure if this is the right place to ask, but here goes:
>
> I have two objects that each render individually and as a CSG union, but when I
> use the CSG difference function on the two objects (both mesh2 objects with
> some common and unique volume) neither appears in the render.
>
> Does anyone have some wisdom to impart?

Make sure that there is an inside vector listed for the mesh and that the mesh
is continuous across the CSG region (no holes).  Either of those two can be
culprits in stealing the CSGed mesh.

-tgq


Post a reply to this message

From: Graham
Subject: Re: Newbie 'difference' question
Date: 1 Jan 2009 06:50:00
Message: <web.495cacb3befd74539fd2e7280@news.povray.org>
Stephen <mcavoysAT@aolDOTcom> wrote:
> I just did a quick test with two Poser Models and I got the difference and
> intersections to render OK. If the meshes are not too big you could post a
> scene.
> --
>
> Regards
>      Stephen

I had been through and thought I had the objects closed, but I may have that
wrong. Here it is, with excess code culled:

#include "colors.inc"
#include "glass.inc"
#include "shapes.inc"
#include "textures.inc"
#include "camera-context.inc"

#declare CamPos = <-.28,0,-.96>;
#declare LightPos = <0,0,-25>;
#declare CamDist = 0.5;
#declare HemiWidth = 0.367;


camera {location CamDist*CamPos look_at -1*CamPos }
sky_sphere{pigment {colour White}}
light_source {LightPos White*3.0 parallel}

#declare Gem = mesh2 {
   vertex_vectors { 5,
        <-HemiWidth,0,-2>, <-HemiWidth,0.722,-1.865>, <HemiWidth,0.367,-1.966>,
<-HemiWidth/3,0.361,-1.932>, 1.15*<-HemiWidth/3,0.361,-1.932>
   }
   texture_list { 1,
      texture{pigment{Col_Glass_Dark_Green}} //pigment{Col_Glass_Dark_Green}}
//0
   }
   face_indices { 6,
 <3,2,1>,0 <0,3,1>,0 <0,2,3>,0 <4,2,1>,0 <0,4,1>,0 <0,2,4>,0
   }
}

#declare GemFaceAlt = 1.03;

#declare GemFacer = mesh2 {
   vertex_vectors { 6,
        <-HemiWidth,0,-2>*GemFaceAlt, <-HemiWidth,0.722,-1.865>*GemFaceAlt,
<HemiWidth,0.367,-1.966>*GemFaceAlt,
        <-HemiWidth,0,-2>*(0.25+GemFaceAlt),
<-HemiWidth,0.722,-1.865>*(0.25+GemFaceAlt),
<HemiWidth,0.367,-1.966>*(0.25+GemFaceAlt)
   }
   texture_list { 1,    texture{pigment{Col_Glass_Ruby}} //0
   }
   face_indices { 8,    <0,2,1>,0  <0,1,3>,0 <1,2,4>,0 <2,0,5>,0  <0,5,3>,0
<1,3,4>,0 <2,4,5>,0  <3,4,5>,0
   }
}

//#declare Gemstone = object{Gem} //works
//#declare Gemstone = object{GemFacer} //works
#declare Gemstone = union {object{Gem} object{GemFacer}} //works
//#declare Gemstone = intersection {object{Gem} object{GemFacer}} //renders
blank
//#declare Gemstone = difference {object{Gem} object{GemFacer}} //renders blank

object{Gemstone rotate y*120  translate <2,0,0>}//moves this object into a
close-up position


Post a reply to this message

From: Stephen
Subject: Re: Newbie 'difference' question
Date: 1 Jan 2009 08:17:12
Message: <lfgpl4pbgfd909rtkm0sj04q5obthheski@4ax.com>
On Thu,  1 Jan 2009 06:44:51 EST, "Graham" <nomail@nomail> wrote:

>
>I had been through and thought I had the objects closed, but I may have that
>wrong. Here it is, with excess code culled:

Sorry Graham, this problem is beyond my ability to help. I get the same problem
as you do. I hope that someone else takes it up.
-- 

Regards
     Stephen


Post a reply to this message

From: Warp
Subject: Re: Newbie 'difference' question
Date: 1 Jan 2009 09:04:49
Message: <495ccd81@news.povray.org>
Graham <nomail@nomail> wrote:
> I have two objects that each render individually and as a CSG union, but when I
> use the CSG difference function on the two objects (both mesh2 objects with
> some common and unique volume) neither appears in the render.

  I really can't believe nobody has answered this completely trivial problem.

  Just add "inside_vector y" to your meshes.

-- 
                                                          - Warp


Post a reply to this message

From: Graham
Subject: Re: Newbie 'difference' question
Date: 3 Jan 2009 00:15:01
Message: <web.495ef3f3befd74539fd2e7280@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   I really can't believe nobody has answered this completely trivial problem.
>
>   Just add "inside_vector y" to your meshes.
>
> --
>                                                           - Warp

Thank you Warp, Stephen, et al.

I've used the "inside_vector y", and I've also replaced the need for some CSG by
doing the math (but that's okay - I like the math).

What I've drawn isn't up to the standard of things on this site, but if you're
interested (and, again, have any comments or suggestions) I've uploaded it to:

http://au.geocities.com/gjdolby/jpgs/ringprog.jpg

and here is the picture I wanted that brought me to POV Ray in the first place:

http://au.geocities.com/gjdolby/jpgs/rwg.jpg

-Graham


Post a reply to this message

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