POV-Ray : Newsgroups : povray.binaries.images : Isosurfaces CSG problems (2 x JPG 400x300, 14+14 KB) : Re: Isosurfaces CSG problems (2 x JPG 400x300, 14+14 KB) Server Time
14 Aug 2024 05:17:29 EDT (-0400)
  Re: Isosurfaces CSG problems (2 x JPG 400x300, 14+14 KB)  
From: Marc-Hendrik Bremer
Date: 2 Dec 2002 12:58:24
Message: <3deb9f40@news.povray.org>

news:3DE89EA8.8809C9DF@tiscalinet.de...
> Then I tried simulated CSG within the isosurface function:
>
> isosurface
> {
>   function { max(f_rounded_box( x, y-YDispl(x,y,z), z, 0.05, 5, 1.5,
> 2.5)-Brick_Fun_New(x, y/3, z)*0.3,
>   -f_rounded_box( x, y-YDispl(x,y,z), z+2.35, 0.05, 0.5, 1,
> 0.25)-Brick_Fun_New(x, y/3, z+2.35)*0.3) }
>
>   contained_by { box {-50, 50} }
>    max_gradient 5
>   translate <0, 1.4, 0>
>    texture { Afghan_Classic_Mud }
>   }
>
> but then now subtractions at all show up (2nd image; for convenience, I
> left out the inner hollow of the building and just tried to cut a door
> from the front side). The main body is 10 by 3 by 5 meters, the door
> subtraction body is 1 by 2 by 0.5 meters and
> translated -2.35 meters along the z axis. I asked myself how to
> implement that "+2.35" when using a multi-partite function like in this
> example... only in the rounded_box part or also in the YDispl and
> Brick_Fun_New parts?
>

Hi!

If you want to use "normal" CSG, you have to use a higher max_trace as
allready suggested. If you want to construct the whole thing in one
Isosurface (which is the better soultion in my opinion), the easiest way is
to use Cristhoph Hormanns Iso-CSG-Library. Never used it myself, though.

If you would like to go the whole way by yourself (as I would do :-)), you
could try this (untested):

#declare shape_fun= function {max(f_rounded_box( x, y, z, 0.05, 5, 1.5,
2.5),
   -f_rounded_box( x, y, z+2.35, 0.05, 0.5, 1, 0.25))}

isosurface
 {
   function { shape_fun(x, y-YDispl(x,y,z),z)-Brick_Fun_New(x, y/3, z)*0.3 }
   contained_by { box {<-6,-1.6,-3>,<6,1.6,3>}
    max_gradient 5
   translate <0, 1.4, 0>
   texture { Afghan_Classic_Mud }
}

Your container-box was much to large (if your dimensions are 1 meter= 1
Pov-Unit) this way you are wasting time (as the function has to be calculate
more often) and you have to use higher max_gradient values. Might be not
that important in this stage of your project but will be later on.

What did I do? First I calculated the shape of the house in the
extra-function "shape_fun".  The resulting shape get's displaced by YDispl
and Brick_Fun_New. This way your doorway will get displaced, too and you
don't have to worry about straigth walls there (as you would have to if you
would use conventional CSG).

Regards,

Marc-Hendrik


Post a reply to this message

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