POV-Ray : Newsgroups : povray.newusers : Subtract Planes ? Server Time
2 Nov 2024 01:19:56 EDT (-0400)
  Subtract Planes ? (Message 1 to 2 of 2)  
From: Hans-Werner
Subject: Subtract Planes ?
Date: 24 Sep 2004 18:30:00
Message: <web.41549f48342b5660536167b10@news.povray.org>

I head the idea to construct a screw and the opposite part; a nut ? (Sorry,

For this I had the idea to contruct a flat polygon (6 corners), cut off a
circle inside, sweep it to the third dimension and then use CSG to do the
remaining.
But how to cut off the circle inside the polygon ?
So, the first step is to define the polygon.

# declare Radius_Aussen = 0.5;
# declare Radius_Innen  = 0.3;
# declare Anfangswinkel = 0.0;
# declare Mittelpunkt   = <0.0, 0.0, 0.0>;
# declare Winkel = Anfangswinkel;
# declare Increment = pi/3.0;
# declare X_Koordinate  = 0.0;
# declare Y_Koordinate  = 0.0;
# declare Eckpunkt      = array [6];
# declare Index         = 0;


# while (Index < 6)
  # X_Koordinate = Mittelpunkt.x + Radius_Aussen * Winkel; // This does not
work
  # Y_Koordinate = Mittelpunkt.y + Radius_Aussen * Winkel; // This does not
work
  # Eckpunkt [Index] = <X_Koordinate, Y_Koordinate>;
  # Index = Index + 1;
  # Winkel = Anfangswinkel + Index * Increment;
# end
# declare Grundflaeche =
polygon
{
  6, Eckpunkt[0], Eckpunkt[1], Eckpunkt[2],
     Eckpunkt[3], Eckpunkt[4], Eckpunkt[5]
}

Thank you


Post a reply to this message

From: Alain
Subject: Re: Subtract Planes ?
Date: 25 Sep 2004 09:30:49
Message: <41557309@news.povray.org>
Hans-Werner nous apporta ses lumieres ainsi en ce 2004-09-24 18:27... :


>I head the idea to construct a screw and the opposite part; a nut ? (Sorry,

>For this I had the idea to contruct a flat polygon (6 corners), cut off a
>circle inside, sweep it to the third dimension and then use CSG to do the
>remaining.
>But how to cut off the circle inside the polygon ?
>So, the first step is to define the polygon.
>
># declare Radius_Aussen = 0.5;
># declare Radius_Innen  = 0.3;
># declare Anfangswinkel = 0.0;
># declare Mittelpunkt   = <0.0, 0.0, 0.0>;
># declare Winkel = Anfangswinkel;
># declare Increment = pi/3.0;
># declare X_Koordinate  = 0.0;
># declare Y_Koordinate  = 0.0;
># declare Eckpunkt      = array [6];
># declare Index         = 0;
>
>
># while (Index < 6)
>  # X_Koordinate = Mittelpunkt.x + Radius_Aussen * Winkel; // This does not
>work
>  # Y_Koordinate = Mittelpunkt.y + Radius_Aussen * Winkel; // This does not
>work
>  # Eckpunkt [Index] = <X_Koordinate, Y_Koordinate>;
>  # Index = Index + 1;
>  # Winkel = Anfangswinkel + Index * Increment;
># end
># declare Grundflaeche =
>polygon
>{
>  6, Eckpunkt[0], Eckpunkt[1], Eckpunkt[2],
>     Eckpunkt[3], Eckpunkt[4], Eckpunkt[5]
>}
>
>Thank you
>
>
>  
>
Planes are objects that can be intersected (intersection{}) or 
diferenced (difference{}), they do have a deffinite interior and exterior.
In your case, you can start with a cylinder or a sphere, use 6 planes to 
chop off the faces and a cylinder to bore the hole.
You can also start with a prism from whitch you subtract a cylinder.

Alain


Post a reply to this message

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