POV-Ray : Newsgroups : povray.advanced-users : IsoCSG rounded shape macros Server Time
1 Nov 2024 11:15:22 EDT (-0400)
  IsoCSG rounded shape macros (Message 1 to 5 of 5)  
From: Reuben Pearse
Subject: IsoCSG rounded shape macros
Date: 19 Apr 2002 05:55:11
Message: <3cbfe97f@news.povray.org>
Hi all

I am tying to create some shapes in POVRay 3.5 (beta.RC1) using Christoph
Hormann's IsoCSG Library (version 0.4) and
I have a couple of questions:

1. I want to create a rounded cylinder using the IC_Cylinder shape macro in
the iso_rcsg.inc (Rounded Shapes).
However the cylinder I get just looks like a normal cylinder created using
POV primitive. Below is the code I am using:

//=======================================================
#version 3.5;

global_settings {
  assumed_gamma 1.0
}

background { color <0.750,0.500,0.300> }

camera {
  location    <-10, 25, 10>*1.5
  direction   y
  sky         z
  up          z
  right       1.33333*x
  look_at     <0, 0, 1.7>
  angle       15
}


light_source {
  <-1000, 2500, 5000>
  color rgb 1.2
}

#include "iso_rcsg.inc"
#declare fn_1 = IC_Cylinder (-x, x, 0.8)
#declare fn_XX= function { fn_1(x, y, z) }

isosurface {
  function { fn_XX(x, y, z) }
  max_gradient 1.6
  contained_by { box { -8+z*5, 8+2*z } }
  pigment { rgb <0, 0.2, 1.1> }
  finish { specular 0.3 }
  scale 1.2
}

//===================================================

How do I create a smooth rounded cone using this macro?
What are general principles I need to use to get round edges on a object
created with IsoCSG?

2. How do you use the macros in the IsoCSG to do the equivalent of the blob
threshold as detailed in the POV help section 3.6.3.5

Thanks in advance

Reuben
doo### [at] breathemailnet


Post a reply to this message

From: Christoph Hormann
Subject: Re: IsoCSG rounded shape macros
Date: 19 Apr 2002 06:44:29
Message: <3CBFF50C.E043FCB7@gmx.de>
Reuben Pearse wrote:
> 
> Hi all
> 
> I am tying to create some shapes in POVRay 3.5 (beta.RC1) using Christoph
> Hormann's IsoCSG Library (version 0.4) and
> I have a couple of questions:
> 
> 1. I want to create a rounded cylinder using the IC_Cylinder shape macro in
> the iso_rcsg.inc (Rounded Shapes).
> However the cylinder I get just looks like a normal cylinder created using
> POV primitive. Below is the code I am using:
> 
> [...]

Calling the functions 'rounded' is a bit misleading, i will add a better
explanation in the next version.  The shape itself is not different from
normal iso_csg functions.

But you can use the rounding properties of the functions by changing the
threshold value, for example:

#declare fn_1 = IC_Threshold( IC_Cylinder (-x, x, 0.8), 0.2)

Note that the resulting shape no more has the measures given to the
cylinder macro.

> 
> How do I create a smooth rounded cone using this macro?
> What are general principles I need to use to get round edges on a object
> created with IsoCSG?

You can use the methods mentioned above or implement the CSG constructions
from the Round_Cone() macro in 'shapes.inc'.

The same applies for all other shapes of course.  For a rounded box you
can also use the f_rounded_box() function from functions.inc.

> 2. How do you use the macros in the IsoCSG to do the equivalent of the blob
> threshold as detailed in the POV help section 3.6.3.5

You can use the iso_csg functions like any other functions so you can also
use them in blob constructions (instead of fn_A()/fn_B() in the cited
example)

Future versions of iso_csg will probably also implement blob functions.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 16 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:
Subject: Re: IsoCSG rounded shape macros
Date: 19 Apr 2002 06:46:40
Message: <ftsvbu0n40gismmvt6u7ifuqpk9kkmemet@4ax.com>
On Fri, 19 Apr 2002 10:59:05 +0100, "Reuben Pearse"
<reu### [at] presence-systemscom> wrote:
> 1. I want to create a rounded cylinder using the IC_Cylinder shape macro in
> the iso_rcsg.inc (Rounded Shapes).
> However the cylinder I get just looks like a normal cylinder created using
> POV primitive.

Becouse it is rounded when you move surface outside. If you use only cylinder
in your isosurface then just use threshold keyword of isosurface to make
surface. If you want cylinder as part of bigger iso_csg then use IC_Threshold
macro as described in documentation.

> How do I create a smooth rounded cone using this macro?

The same way. Use threshold.

> 2. How do you use the macros in the IsoCSG to do the equivalent of the blob
> threshold as detailed in the POV help section 3.6.3.5

The same way. Just use result of macros in IsoCSG as blob component.

Sorry, have no time to make examples at this moment. Tell me if it is
necessary.

ABX


Post a reply to this message

From: Reuben Pearse
Subject: Re: IsoCSG rounded shape macros
Date: 22 Apr 2002 07:35:12
Message: <3cc3f570$1@news.povray.org>
Thanks for your help.

I have started experimenting with IC_Theshold function. This works with the
rounded cylinder.
However when I tried to use the rounded cone function I got an error. The
details are below:

//Rounded cone function declaration
#declare fn_1 = IC_Threshold( IC_Cone (-x, 0.2, x, 0.8), 0.2)

I get this error in the Reorient_Trans macro in transforms.inc
#error "error in Reorient_Trans macro: Axis1 may not be exact opposite of
Axis2"

Any ideas?

Reuben Pearse
doo### [at] breathemailnet

"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3CBFF50C.E043FCB7@gmx.de...
>
>
> Reuben Pearse wrote:
> >
> > Hi all
> >
> > I am tying to create some shapes in POVRay 3.5 (beta.RC1) using
Christoph
> > Hormann's IsoCSG Library (version 0.4) and
> > I have a couple of questions:
> >
> > 1. I want to create a rounded cylinder using the IC_Cylinder shape macro
in
> > the iso_rcsg.inc (Rounded Shapes).
> > However the cylinder I get just looks like a normal cylinder created
using
> > POV primitive. Below is the code I am using:
> >
> > [...]
>
> Calling the functions 'rounded' is a bit misleading, i will add a better
> explanation in the next version.  The shape itself is not different from
> normal iso_csg functions.
>
> But you can use the rounding properties of the functions by changing the
> threshold value, for example:
>
> #declare fn_1 = IC_Threshold( IC_Cylinder (-x, x, 0.8), 0.2)
>
> Note that the resulting shape no more has the measures given to the
> cylinder macro.
>
> >
> > How do I create a smooth rounded cone using this macro?
> > What are general principles I need to use to get round edges on a object
> > created with IsoCSG?
>
> You can use the methods mentioned above or implement the CSG constructions
> from the Round_Cone() macro in 'shapes.inc'.
>
> The same applies for all other shapes of course.  For a rounded box you
> can also use the f_rounded_box() function from functions.inc.
>
> > 2. How do you use the macros in the IsoCSG to do the equivalent of the
blob
> > threshold as detailed in the POV help section 3.6.3.5
>
> You can use the iso_csg functions like any other functions so you can also
> use them in blob constructions (instead of fn_A()/fn_B() in the cited
> example)
>
> Future versions of iso_csg will probably also implement blob functions.
>
> Christoph
>
> --
> POV-Ray tutorials, IsoWood include,
> TransSkin and more: http://www.tu-bs.de/~y0013390/
> Last updated 16 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:
Subject: Re: IsoCSG rounded shape macros
Date: 22 Apr 2002 07:51:06
Message: <dqt7cu4mss3h0jlm3lffj7f2b7nt0kb573@4ax.com>
On Mon, 22 Apr 2002 12:39:11 +0100, "Reuben Pearse"
<reu### [at] presence-systemscom> wrote:
> //Rounded cone function declaration
> #declare fn_1 = IC_Threshold( IC_Cone (-x, 0.2, x, 0.8), 0.2)
>
> I get this error in the Reorient_Trans macro in transforms.inc
> #error "error in Reorient_Trans macro: Axis1 may not be exact opposite of
> Axis2"
>
> Any ideas?

Reorient_Trans is a macro from transforms.inc in standard distribution.
As simple workaroud try to make your cone along y axis and rotate it around z
to place along x. Something like:

IC_Threshold( IC_Rotate( IC_Cone (-y, 0.2, y, 0.8) , z*90 ), 0.2)

Unfortunatelly additional rotation can a little slow down evaluation.

ABX


Post a reply to this message

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