Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    POV-Ray Examples - How To Make Objects for POV-Ray
Italiano Italiano
Deutsch Deutsch

Home
- POV-Ray Tutorial
  - POV-Ray Examples
   Index of Content
  - Geometry
  - Architecture
  - Engineering
    - Ladder
    - Pylons
    - Railing
    - Bridge
    - Tubes
    - Tube Fork
    - Tube Stopcock
    - Chain
    - Coil of Wire
    - Torpedo
    - Cruise Missile
    - Rocket
    - Wheel
    - Truck
    - Propeller
    - Airplanes
    - Canoe
    - Guitar Body
    - 7-Segment Display
    - Ribbon Cable
    - Cable Harness
                                       
 
guitar

Guitar
The Construction of a Guitar Body.
Objects:    prism.
Methods: cubic_spline.


The Construction in Details:

We can acchieve the basic shape of a guitar body by a prism (generalized also with a curved line at the base surface!) if we use a cubic spline curve for the mantle.
For the definition of an appropriate prism we need a row of base points to model the outline of the guitar body. The placing of these base point is a matter of sensibility - this means: we have to us the method of "trial and error".
If we design the body of the guitar in the xy plane, then it's shape is symmetric to the yz plane. The easiest way to define the points symmetric to the yz plane by declaring them as variable depending form their mirror image.
// ----------- Dimensions
#declare G_z = 0.15;// -z value
// Silhuette right side:
// ----  values -----
#local S0 = < 0.00, 0.00>;
#local S1 = < 0.16, 0.05>;
#local S2 = < 0.22, 0.20>;
#local S3 = < 0.15, 0.35>;
#local S4 = < 0.17, 0.48>;
#local S5 = < 0.12, 0.56>;
#local S6 = < 0.00, 0.60>;
// vectors of 2 dim. S(u,v).
// If S= S(Xs,Yx),
// then S.u=Xs u. X.v=Ys.

// automatic mirror image
// Silhuette left side:
#local S7 = <-S5.u, S5.v>;
#local S8 = <-S4.u, S4.v>;
#local S9 = <-S3.u, S3.v>;
#local S10 = <-S2.u, S2.v>;
#local S11 = <-S1.u, S1.v>;
//--------------------------
// linear prism in y direction:
prism {
   linear_sweep
   cubic_spline
   G_z, 0.00, 15

   S0, S1, S2, S3, S4,
   S5, S6, S7, S8, S9,
   S10, S11,
   S0, // last = first
   S1, // 2 more !!!
   S2
   texture { /*as you like it!*/}
   rotate<-90,0,0>
   //roatates the prism in in plane xy!!!
   translate<0.0,0,0>
} // end of prism ------------
The Body of the Guitar: The base points of the silhuette line are marked by little spheres. The points from S7 to S11 in symmetric positions are marked green.
Click here for the complete scene file for POV-Ray:
"guitar.txt" or "guitar.pov"
If we define the prism from above to be an object called "Body_Shape" then we can model the body of the guitar with this basic shape.
Different textures on front/backside and on the sides, we can get, if we scale this basic shape in different scales and add them together by "union". For this the first shape has to show its surface the frontside only and the other shape has to show its surface only at the lateral parts of the outside of this "union".
After adding the shapes in such a way, we can subtract a smaller sized basic shape and a cylinder to cave out the inside and to get the hole in the body of the guitar.
This want to show the following example:
//-------- The Guitar_Body
difference{
union { //the positiv parts
 object{Body_Shape
  scale< 1.010,1.010,  0.95>
  translate<0,-0.005*G_y, -0.05*G_z/2>
  texture{G_Texture_outside1} }
 object{Body_Shape
  texture{G_Texture_outside  } }
}// end of the union of
 //the positiv parts of the body

// caving out the inside
object{Body_Shape
  scale<0.99,0.99,1-0.01*(1/G_z)>
  translate<0,0.005,-0.005>
  texture{G_Texture_inside}}
// the hole - das Loch
cylinder{<0,0,-0.1>,<0,0,0.1>,G_Hole_R
  translate<0,G_Hole_y,-G_z>
  texture{G_Texture_outside}
  } // end of cylinder  ----------
}// end of difference  -----------
// ------------ end of Guitar_Body
Scene file for POV-Ray:
"guitar.txt" or "guitar.pov"
 
top

© Friedrich A. Lohmüller, 2006
www.f-lohmueller.de