POV-Ray : Newsgroups : povray.newusers : portions of shapes and sor Server Time
29 Jul 2024 16:23:38 EDT (-0400)
  portions of shapes and sor (Message 1 to 4 of 4)  
From: vianagmo
Subject: portions of shapes and sor
Date: 3 Oct 2005 10:20:00
Message: <web.43413df8aabfdaaa58feb3830@news.povray.org>
Hi,

I have two puntual questions:

1. I want to know if there's a way to make a sor that revolves in an angle
smaller than 2*Pi.

2. Is it possible to do portions of primitive shapes (spheres, cones,
cylinders, torus) in a simple and fast way?. for example halfs or quarters
of spheres or cones.

Thanks for your any hint.


Post a reply to this message

From: Warp
Subject: Re: portions of shapes and sor
Date: 3 Oct 2005 11:22:56
Message: <43414cd0@news.povray.org>
vianagmo <vaa### [at] unaleduco> wrote:
> 1. I want to know if there's a way to make a sor that revolves in an angle
> smaller than 2*Pi.

> 2. Is it possible to do portions of primitive shapes (spheres, cones,
> cylinders, torus) in a simple and fast way?. for example halfs or quarters
> of spheres or cones.

  For sections larger than Pi radians, create an intersection of the object
and the union of two planes at correct orientations. For sections smaller
than Pi radians, create an intersection of the object and the intersection
of two planes at correct orientations.

-- 
                                                          - Warp


Post a reply to this message

From: Sebastian H 
Subject: Re: portions of shapes and sor
Date: 3 Oct 2005 20:54:41
Message: <4341d2d1$1@news.povray.org>
vianagmo schrieb:
> Hi,
> 
> I have two puntual questions:
> 
> 1. I want to know if there's a way to make a sor that revolves in an angle
> smaller than 2*Pi.

Two simple planes and an intersection operation can help here.
Remember that a plane has two sides. The space on the top side of
the plane is free space but everything on the other side is
_inside_ the plane. The visible plane is just the surface
of the infinite deep sea below.
Now one can intersect multiple planes to create new objects.
A box for example is an intersection of six planes.

To cut out an angle from your sor (but this works with most objects)
you can let it intersect with a union of two planes. The cut space
must be "above" both of the planes and therefore not within them.
This works because an Intersection is rendered as the surface of
the space of which can be said it is within every participating object.

The following scene explains it better.

#include "colors.inc"

background { rgb <1, 1, 0.75>*0.9 }

#declare cam_theta = 60;
#declare cam_phi = 30;
#declare cam_r = 8.0;
#declare cam_angle = 45;

camera {
   location -cam_r*z
   sky y
   up <0,image_height/image_width,0>
   right <1,0,0>
   look_at <0,0.5,0>
   angle cam_angle
   rotate -(cam_theta-90)*x
   rotate -cam_phi*y
}

light_source {
   <0, 0, 0> rgb <1, 1, 1>
   fade_distance 500
   fade_power 2
   translate <150, 150, -200>
}

union {
   cylinder {-x, x, 0.0001 pigment{Red}}
   cylinder {-y, y, 0.0001 pigment{Green}}
   cylinder {-z, z, 0.0001 pigment{Blue}}
   scale 100
}

#declare surface_of_revolution=
sor {
   9,
   <0.000000, 0.000000>
   <0.118143, 0.000000>
   <0.620253, 0.540084>
   <0.210970, 0.827004>
   <0.194093, 0.962025>
   <0.286920, 1.000000>
   <0.468354, 1.033755>
   <0.068354, 1.233755>
   <0.0, 1.333755>
}


/* Cut angle */
#declare phi=60;

/* Intersection planes */
#declare P1= plane { <1,0,0>, 0}
#declare P2= plane {-<1,0,0>, 0  rotate -phi*y}

intersection {
   object {surface_of_revolution}
   union {
     object {P1}
     object {P2}
   }
   pigment {rgb 1.0}
   finish {ambient 0.1 diffuse 1}
}


#declare show_planes=false;


#if(show_planes)

   /* Show intersection planes */
   object {
     P1
     pigment {checker rgbf <1,0,0,0.75>, rgbt <1,1,0,0.5> scale 0.2}
   }

   object {
     P2
     pigment {checker rgbf <0,0,1,0.75>, rgbt <0,1,1,0.5> scale 0.2 
rotate -phi*y}
   }

#end

> 2. Is it possible to do portions of primitive shapes (spheres, cones,
> cylinders, torus) in a simple and fast way?. for example halfs or quarters
> of spheres or cones.

Do the intersection above with your favourite object.

of both planes but both planes directly. Just figure out
for which space it can be said it is within every of the
intersecting objects.

Regards,
Sebastian


Post a reply to this message

From: vianagmo
Subject: Re: portions of shapes and sor
Date: 11 Jan 2006 11:35:01
Message: <web.43c532b91e4ef9173c328cf0@news.povray.org>
Well, I certainly have solved this problem of the portions and revolutions
solids, thank you both (long time ago). Now I have other problem, I am
making a rotation and translation over these hole intersections that
produce the portions of the objects and something is wrong, I have tried
rotation and then translation and inverse but the result is not the
expected. I think that when you make a rotation you also rotate the X,Y,Z
axis, I dont know how to solve this...can anyone help me? Maybe there's
something with relative and absolute positions.

THANKS A LOT FOR YOUR HELP!


Post a reply to this message

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