POV-Ray : Newsgroups : povray.binaries.images : CSG problem Server Time
18 Aug 2024 10:20:20 EDT (-0400)
  CSG problem (Message 1 to 7 of 7)  
From: Nekar Xenos
Subject: CSG problem
Date: 21 May 2001 04:49:25
Message: <3b08d695@news.povray.org>
I'm having trouble with this CSG.
I can't seem to cut off the sharp edge of the inner part of this letter 'c'.
The source is posted under p.t.s-f.
Help will be appreciated.

Thanks,

Nekar

--
#local N=<-20,40,100>;#local K=<20,-40,100>;#local R=seed(0);blob{#while((K-N).
x>0)#local X=N;#local N=N+<rand(R),rand(R),1>/3;#local N=(vlength(N-K)<vlength(
X-K)?N:2*X-N);sphere{<N.y,-N.x,N.z>,1,1 scale .02}sphere{N,1,1 scale.02}sphere{
<-N.x-40,N.y,N.z>1,1 scale.01}sphere{<N.x+40,-N.y,N.z>1,1 scale.01 }#end
pigment{rgbt 1}interior{media{emission <2,4,5>*5}}hollow}// Nekar Xenos


Post a reply to this message


Attachments:
Download 'Cp.jpg' (42 KB)

Preview of image 'Cp.jpg'
Cp.jpg


 

From: Christoph Hormann
Subject: Re: CSG problem
Date: 21 May 2001 07:33:18
Message: <3B08FD41.74319130@gmx.de>
Nekar Xenos wrote:
> 
> I'm having trouble with this CSG.
> I can't seem to cut off the sharp edge of the inner part of this letter 'c'.
> The source is posted under p.t.s-f.
> Help will be appreciated.
> 

Sorry, but i don't understand what exactly you are having problems with.  

If you want perfectly smooth edges, you will have to use some
trigonometry, it usually helps to calculate things in the 2D case by
drawing the cross section on paper...

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Nekar Xenos
Subject: Re: CSG problem
Date: 21 May 2001 07:58:59
Message: <3b090303@news.povray.org>
I don't know if it's a bug. But if you take a look at the code under
povray.text.scene-files you'll see  there is a section I marked out that doesn't
want to cut off the edge. I've checked the placement and it is in the right
place so I must be missing something.

--
#local N=<-20,40,100>;#local K=<20,-40,100>;#local R=seed(0);blob{#while((K-N).
x>0)#local X=N;#local N=N+<rand(R),rand(R),1>/3;#local N=(vlength(N-K)<vlength(
X-K)?N:2*X-N);sphere{<N.y,-N.x,N.z>,1,1 scale .02}sphere{N,1,1 scale.02}sphere{
<-N.x-40,N.y,N.z>1,1 scale.01}sphere{<N.x+40,-N.y,N.z>1,1 scale.01 }#end
pigment{rgbt 1}interior{media{emission <2,4,5>*5}}hollow}// Nekar Xenos


"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3B08FD41.74319130@gmx.de...
>
>
> Nekar Xenos wrote:
> >
> > I'm having trouble with this CSG.
> > I can't seem to cut off the sharp edge of the inner part of this letter 'c'.
> > The source is posted under p.t.s-f.
> > Help will be appreciated.
> >
>
> Sorry, but i don't understand what exactly you are having problems with.
>
> If you want perfectly smooth edges, you will have to use some
> trigonometry, it usually helps to calculate things in the 2D case by
> drawing the cross section on paper...
>
> Christoph
>
> --
> Christoph Hormann <chr### [at] gmxde>
> IsoWood include, radiosity tutorial, TransSkin and other
> things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Christoph Hormann
Subject: Re: CSG problem
Date: 21 May 2001 13:58:33
Message: <3B09578D.F520ED61@gmx.de>
Nekar Xenos wrote:
> 
> I don't know if it's a bug. But if you take a look at the code under
> povray.text.scene-files you'll see  there is a section I marked out that doesn't
> want to cut off the edge. I've checked the placement and it is in the right
> place so I must be missing something.
> 

I checked the code and to me it seems to render just as i would expect it
(apart from missing pigment etc.)

If you could mark the edge you think that's wrong it could help.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Nekar Xenos
Subject: Re: CSG problem
Date: 22 May 2001 03:05:59
Message: <3b0a0fd7@news.povray.org>
It was the part marked problem in the code. Thanks for your patience with me ;).
I've figured it out and fixed it now. I've still got to do the corners but that
shouldn't be a problem now.

--
/* Nekar Xenos */#local N=<-20,40,100>;#local K=<20,-40,100>;#local R=seed(0);
blob{#while((K-N).x>0)#local X=N;#local N=N+<rand(R),rand(R),1>/3;#local N=(
vlength(N-K)<vlength(X-K)?N:2*X-N);sphere{<N.y,-N.x,N.z>,1,1 scale .02}sphere{N
,1,1 scale.02}sphere{<-N.x-40,N.y,N.z>1,1 scale.01}sphere{<N.x+40,-N.y,N.z>1,1
scale.01 }#end pigment{rgbt 1}interior{media{emission <2,4,5>*5}}hollow}

"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3B09578D.F520ED61@gmx.de...
>
>
> Nekar Xenos wrote:
> >
> > I don't know if it's a bug. But if you take a look at the code under
> > povray.text.scene-files you'll see  there is a section I marked out that
doesn't
> > want to cut off the edge. I've checked the placement and it is in the right
> > place so I must be missing something.
> >
>
> I checked the code and to me it seems to render just as i would expect it
> (apart from missing pigment etc.)
>
> If you could mark the edge you think that's wrong it could help.
>
> Christoph
>
> --
> Christoph Hormann <chr### [at] gmxde>
> IsoWood include, radiosity tutorial, TransSkin and other
> things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Mike Williams
Subject: Re: CSG problem
Date: 22 May 2001 04:35:32
Message: <ZcuNaCA1VeC7EwHz@econym.demon.co.uk>
Wasn't it Nekar Xenos who wrote:

>I don't know if it's a bug. But if you take a look at the code under
>povray.text.scene-files you'll see  there is a section I marked out that doesn't
>want to cut off the edge. I've checked the placement and it is in the right
>place so I must be missing something.

Check the placement again. It's *not* in the right place.



One way to visualize what's happening is to look at the detail with an
orthographic camera, and to add a visible copy of the suspect difference
to the scene

E.g. temporarily change your camera to

   camera {location <6,-4,0>
        look_at <6,-4,10>         
        orthographic
        }

And temporarily add this at the very end of the scene

   difference {
      box{<4,-2,18>,<7,-5,-18>}
      cylinder{<7,-5,19>,<7,-5,-19> 2}
       pigment {rgb x}
       translate <0,0,50>
   }

When you render that, you'll see that the suspect bit touches the main
object in two places. You really don't want the one around <4,-5,*>, and
the one around <7,-3,*> doesn't do very much.

I reckon that the correct shape is more like

   difference {
      box{<4,-2,18>,<7.5,-4,-18>}
      cylinder{<7.5,-5,19>,<7.5,-5,-19> 2}
    }




-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Nekar Xenos
Subject: Re: CSG problem
Date: 22 May 2001 05:06:05
Message: <3b0a2bfd@news.povray.org>
> Wasn't it Nekar Xenos who wrote:
>
> >I don't know if it's a bug. But if you take a look at the code under
> >povray.text.scene-files you'll see  there is a section I marked out that
doesn't
> >want to cut off the edge. I've checked the placement and it is in the right
> >place so I must be missing something.

Looks like it - um... yes, that was me. Thanks anyway, I've already fixed it.
>
> Check the placement again. It's *not* in the right place.
>
>
>
> One way to visualize what's happening is to look at the detail with an
> orthographic camera, and to add a visible copy of the suspect difference
> to the scene
>
> E.g. temporarily change your camera to
>
>    camera {location <6,-4,0>
>         look_at <6,-4,10>
>         orthographic
>         }
>
> And temporarily add this at the very end of the scene
>
>    difference {
>       box{<4,-2,18>,<7,-5,-18>}
>       cylinder{<7,-5,19>,<7,-5,-19> 2}
>        pigment {rgb x}
>        translate <0,0,50>
>    }
>
> When you render that, you'll see that the suspect bit touches the main
> object in two places. You really don't want the one around <4,-5,*>, and
> the one around <7,-3,*> doesn't do very much.
>
> I reckon that the correct shape is more like
>
>    difference {
>       box{<4,-2,18>,<7.5,-4,-18>}
>       cylinder{<7.5,-5,19>,<7.5,-5,-19> 2}
>     }


At the moment I've got it at

difference {
                                box{<4,-1,18>,<7.5,-4.1,-18>}
                                cylinder{<7.5,-5,19>,<7.5,-5,-19> 2  }
                                   }


I'll see if -4 in the box works better than the -4.1 I've got at the moment, but
it's looking good now.
I also need to brush up on my trig (it's been about 12 years since I touched the
subject). If I had worked it all out with trig I guess I wouldn't have had these
problems.

Thanks Mike,

--
/* Nekar Xenos */#local N=<-20,40,100>;#local K=<20,-40,100>;#local R=seed(0);
blob{#while((K-N).x>0)#local X=N;#local N=N+<rand(R),rand(R),1>/3;#local N=(
vlength(N-K)<vlength(X-K)?N:2*X-N);sphere{<N.y,-N.x,N.z>,1,1 scale .02}sphere{N
,1,1 scale.02}sphere{<-N.x-40,N.y,N.z>1,1 scale.01}sphere{<N.x+40,-N.y,N.z>1,1
scale.01 }#end pigment{rgbt 1}interior{media{emission <2,4,5>*5}}hollow}


Post a reply to this message

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