POV-Ray : Newsgroups : povray.binaries.images : Rotating isosurface cylinder : Rotating isosurface cylinder Server Time
7 Nov 2024 04:52:16 EST (-0500)
  Rotating isosurface cylinder  
From: StephenS
Date: 11 Oct 2016 21:25:39
Message: <57fd9113@news.povray.org>
I can make a sphere where i want;
sqrt(
pow(x-Inside_length,2)
+pow(y-Height+Edge,2)
+pow(z-Edge,2)
)-Block_Round_corner,//sphere outside top

I can rotate the sphere;
//x=x*cos(radians(Angle)) - z*sin(radians(Angle))
//z=x*sin(radians(Angle)) + z*cos(radians(Angle))
//Inside_length=Inside_length*cos(radians(Angle)) - Edge*sin(radians(Angle))
//Edge=Inside_length*sin(radians(Angle)) + Edge*cos(radians(Angle))

sqrt(
pow(x-(Inside_length*cos(radians(-Angle)) - Edge*sin(radians(-Angle))),2)
+pow(y-Height+Edge,2)
+pow(z+(Inside_length*sin(radians(-Angle)) + Edge*cos(radians(-Angle))),2)
)-Block_Round_corner,//sphere outside top

I can make a cylinder;
max(//reference edge good
  sqrt(pow(x-Inside_length,2)+pow(z-Edge,2))-Block_Round_corner,
  y-Height+Edge,
  -y+Edge
)

I can rotate this cylinder, but only on its infinite axis;
max(//rotated edge good
sqrt(
  pow(x-Inside_length*cos(radians(Angle)) - Edge*sin(radians(Angle)),2)
+pow(z-Inside_length*sin(radians(Angle)) + Edge*cos(radians(Angle)),2)
)-Block_Round_corner,
y-Height+Edge,
-y+Edge
)

Now my question;
How do I rotate around y axis
max(//reference edge good
  sqrt(pow(y-Edge,2)+pow(z-Edge,2))-Block_Round_corner,
  x-Inside_length,
  -x+Inside_corner
)
I can substitute my z, but what do I use for my x?


After trying some other stuff, I also have;
sqrt(
  pow(y-Edge,2)
  +pow(z-Edge,2)
 
+pow(x-select(min(x-Inside_length,0),max(x,Inside_corner),min(x,Inside_length)),2)
)-Block_Round_corner

Witch seems to give a cylinder with rounded ends.
I can't seem to rotate this ether.

Suggestions, hints?

First image: my work so far on an isosurface rounded_cylinder_section.
Second image: my cylinder with rounded ends equation.

Stephen S


Post a reply to this message


Attachments:
Download 'stone_blocks_0000.png' (769 KB) Download 'stone_blocks_0002.png' (267 KB)

Preview of image 'stone_blocks_0000.png'
stone_blocks_0000.png

Preview of image 'stone_blocks_0002.png'
stone_blocks_0002.png


 

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