POV-Ray : Newsgroups : povray.binaries.images : Rounded block section, isosurface equivalent : Re: Rounded block section, isosurface equivalent Server Time
7 Nov 2024 04:51:51 EST (-0500)
  Re: Rounded block section, isosurface equivalent  
From: Le Forgeron
Date: 5 Sep 2016 16:09:04
Message: <57cdd0e0$1@news.povray.org>
Help yourself,

Le 05/09/2016 à 21:04, StephenS a écrit :
> abs(x-Radius/2)-Radius/2+Block_gap   // wrong except for 90 degrees
>    )

What is abs(x-Radius/2)-Radius/2+Block_gap, but the projection of the coordinate on
the normal of the plane, for a very particular case,

Actually, abs is slicing twice, so
abs(x-Radius/2)-Radius/2+Block_gap can be replaced by -x+Block_gap for the same effect
of cutting along a plane.

now, replace the -x by the computation of the distance along the normal at 120° and
you are nearly done.


isosurface{
 function {
  max(
   sqrt(pow(x,2)+pow(z,2))-Radius+Block_gap,
   abs(y-Height/2)-Height/2+Block_gap,  // cylinder height
   abs(z-Radius/2)-Radius/2+Block_gap,  // my reference edge
   -x*sin(radians(120))+z*cos(radians(120))+Block_gap
   )
 }
 contained_by { box { <-Radius,0,-Radius>, <Radius,Height,Radius> } }
 texture { pigment { color rgb 1 } }
}


Have a good night.


Post a reply to this message

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