POV-Ray : Newsgroups : povray.general : Problem shaping a CSG object Server Time
2 Nov 2024 09:22:04 EDT (-0400)
  Problem shaping a CSG object (Message 1 to 10 of 21)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Thomas de Groot
Subject: Problem shaping a CSG object
Date: 29 Jul 2009 05:27:58
Message: <4a70161e@news.povray.org>
Hi all,

I need a CSG object that basically has the shape of a cone, but with the 
apex as a straight edge parallel to the base, with a length equal to the 
diameter of the base. I tried all kinds of combinations but am unable to get 
this right.

Any help will be much appreciated. Thanks a lot.

-- 
All the best,

Thomas

"Sic vive, tanquam cras moriturus, sic stude, quasi semper victurus." 
Desiderius Erasmus


Post a reply to this message

From: Roman Reiner
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 06:40:00
Message: <web.4a7026819ce95c17d98590c80@news.povray.org>
I doubt this can be done with a (finite) CSG.

Just for clarity, what you need is something like this?

isosurface {
  function { x*x + z*z*(1-y)*(1-y)/4 - (1-y)*(1-y)/4 }
  contained_by { box { -1, 1 } }
}


"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
> Hi all,
>
> I need a CSG object that basically has the shape of a cone, but with the
> apex as a straight edge parallel to the base, with a length equal to the
> diameter of the base. I tried all kinds of combinations but am unable to get
> this right.
>
> Any help will be much appreciated. Thanks a lot.
>
> --
> All the best,
>
> Thomas
>
> "Sic vive, tanquam cras moriturus, sic stude, quasi semper victurus."
> Desiderius Erasmus


Post a reply to this message

From: Chris B
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 06:50:32
Message: <4a702978@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
news:4a70161e@news.povray.org...
> Hi all,
>
> I need a CSG object that basically has the shape of a cone, but with the 
> apex as a straight edge parallel to the base, with a length equal to the 
> diameter of the base. I tried all kinds of combinations but am unable to 
> get this right.
>
> Any help will be much appreciated. Thanks a lot.
>
> -- 
> All the best,
>
> Thomas
>
> "Sic vive, tanquam cras moriturus, sic stude, quasi semper victurus." 
> Desiderius Erasmus

An Isosurface is the easiest and quickest and is technically CSGable.
Otherwise you can get the same shape by taking slices of a squashed sphere.
Both are illustrated below. Turning up the interval for the slicing gives 
smoother results, but less interesting render times.

Regards,
Chris B.



camera {location <-2, 2.5, -1.5> look_at <1,0.25,0>}
light_source {<2,20,-15> color rgb 1}


isosurface {
  function { (x*x*(y*y)+z*z-y*y)}
    accuracy 0.001
    max_gradient 4
    contained_by{box{<-1,-1,-1>,<1,0,1>}}
    pigment {rgb <1,1,0>}
    finish {phong 0.5 phong_size 10}
    translate y
    translate x*3
}

#local Interval = 0.05;
merge {
  #local I = 0;
  #while (I<1)
     intersection {
       sphere {0,1}
       box {<-1,0,-1><1,Interval,1>}
       scale z*(1-I)
       translate I*y
     }
     #local I = I+Interval;
  #end
  pigment {rgb 1}
}


Post a reply to this message

From: Chris B
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 07:22:30
Message: <4a7030f6@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote in message 
news:4a702978@news.povray.org...
>
> "Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
> news:4a70161e@news.povray.org...
>> Hi all,
>>
>> I need a CSG object that basically has the shape of a cone, but with the 
>> apex as a straight edge parallel to the base, with a length equal to the 
>> diameter of the base. I tried all kinds of combinations but am unable to 
>> get this right.
>>
>> Any help will be much appreciated. Thanks a lot.
>
> An Isosurface is the easiest and quickest and is technically CSGable.
> Otherwise you can get the same shape by taking slices of a squashed 
> sphere.
> Both are illustrated below. Turning up the interval for the slicing gives 
> smoother results, but less interesting render times.
>
> Regards,
> Chris B.
>

While making a cup of tea it just occurred to me that you can also do it 
with two sheared cones and a filler:

#include "transforms.inc"
merge {
  cone {0,1,y,0 Shear_Trans(x,<-1,1,0>,z)}
  cone {0,1,y,0 Shear_Trans(x,< 1,1,0>,z)}
  intersection {
    plane {< 0, 1, 1>,0 translate y}
    plane {< 0, 1,-1>,0 translate y}
    plane {<-1,-1, 0>,0}
    plane {< 1,-1, 0>,0}
  }
  pigment {rgb 1}
}

Just goes to show that a good cup of tea can solve many problems  :-)

Regards,
Chris B.


Post a reply to this message

From: Chris B
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 07:31:29
Message: <4a703311@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote in message 
news:4a7030f6@news.povray.org...
>
> it just occurred to me that you can also do it with two sheared cones and 
> a filler:

This is a slightly different shape of course, but it still seems to fit the 
description you gave.

Regards,
Chris B.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 07:33:16
Message: <4a70337c$1@news.povray.org>
Roman, Chris, Thank you for the tips! I had not thought about the use of an 
isosurface.

Chris, your cup of tea did it! That is exactly what I was looking for. I had 
been struggling with cones but did not think of shearing them indeed.

You're the Boss! Thanks a lot.

Thomas

P.S. Drink more tea...


Post a reply to this message

From: clipka
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 10:10:00
Message: <web.4a7057989ce95c17edb9d8df0@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
> I need a CSG object that basically has the shape of a cone, but with the
> apex as a straight edge parallel to the base, with a length equal to the
> diameter of the base. I tried all kinds of combinations but am unable to get
> this right.

You might take two half-cones with point apexes, spread their apexes apart by
means of shearing matrix transformations, and fill the gap with a tetrahedrical
wedge.


Post a reply to this message

From: Darren New
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 11:02:44
Message: <4a706494$1@news.povray.org>
clipka wrote:
> You might take two half-cones with point apexes

Could one start with a cylinder instead? Since the top is as wide as the 
bottom in at least one direction?

-- 
   Darren New, San Diego CA, USA (PST)
   "We'd like you to back-port all the changes in 2.0
    back to version 1.0."
   "We've done that already. We call it 2.0."


Post a reply to this message

From: clipka
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 11:55:00
Message: <web.4a70706f9ce95c17edb9d8df0@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Could one start with a cylinder instead? Since the top is as wide as the
> bottom in at least one direction?

Hm, yes, I guess a cylinder intersected with a wedge would fit Thomas' bill, too
(at least nominally, though it may not be what he looked for, due to the hard
edges this would produce)


Post a reply to this message

From: Darren New
Subject: Re: Problem shaping a CSG object
Date: 29 Jul 2009 12:29:04
Message: <4a7078d0$1@news.povray.org>
clipka wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Could one start with a cylinder instead? Since the top is as wide as the
>> bottom in at least one direction?
> 
> Hm, yes, I guess a cylinder intersected with a wedge would fit Thomas' bill, too
> (at least nominally, though it may not be what he looked for, due to the hard
> edges this would produce)

I was thinking more scale it from x=1.0 y=1.0 to x=1.0 y=0.0 as you move 
from z=0 to z=1, if that makes sense. Not an intersection, but a non-linear 
scaling.

-- 
   Darren New, San Diego CA, USA (PST)
   "We'd like you to back-port all the changes in 2.0
    back to version 1.0."
   "We've done that already. We call it 2.0."


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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