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
Français français
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
                                       
coil

Coil of Wire
The winding of a wire

Objects: cylinder, Segment_of_Torus.
Methods: #local, union, #while, cos, tan, atan, VAngleD(), vlength()

The basic dimensions:
#local WR = 0.065;// wire radius
#local WD = 0.19; // wire distance (pitch)
#local BR = 0.50; // base radius
#local Rmaj= 0.30; // corner radius major
#local Revolutions = 3 ;// 
A quarter turn of the wire, from point A (start)
to corner Co and end point B.
The height of a quarter is WD/4: (image 2)
#local A  = < 0, 0, -BR>;
#local B  = < BR, WD/4, 0>;
#local Co = < BR, WD/8, -BR>;//corner     


Necessary include files:
#include "math.inc" // for VAngleD()
#include "shapes3.inc"// Segment_of_Torus 



Calculation of the angles:


Calculation of the yellow angle: (image 3)
// angle of vector ACo against xz plane
#local Wire_Angle = VAngleD(Co-A,<1,0,0>);

Calculation of the violet angle: (image 3)
#local Len_Cyan =
            WD/8*cos(radians(Wire_Angle));
// rotation angle of 2nd part CoB
#local Inner_Angle =
              degrees(atan2(Len_Cyan,BR));



Calculation of the corner angle: (image 4 + 5)
The corner angle at Co is smaller than 90° !!!
#local Corner_Angle = VAngleD(Co-A,B-Co);
 // corner linear length:
#local Co_Len =
    Rmaj*tan(radians(Corner_Angle/2));
 // linear wire part
#local Len_X = vlength(Co-A)-Co_Len;      


coil
  1) Coil of Wire with 3 revolutions.
coil
  2) A single revolution.
coil
  3) Geometry of a quarter revolution.
coil
  4) The torus segment at the corner.
coil
  5) Length of the corner part.

A quarter revolution of the wire:
#local W_Corner =
object{ Segment_of_Torus(
           Rmaj, // radius major,
           WR,   // radius minor,
           -Corner_Angle // segment angle
         ) //----------------------------
        rotate<0,90,0>
        translate<-0,0,+Rmaj>
      } // ------------------------------
#local Quarter =
union{
   cylinder{ <0,0,0>,<Len_X,0,0>, WR }
   object{   W_Corner
             rotate<-Inner_Angle,0,0>
             translate< Len_X,0,0> }
   cylinder{ <0,0,0>,<Len_X,0,0>, WR
             translate<0,0,-Rmaj>
               rotate<0,-Corner_Angle,0>
                 translate<0,0,Rmaj>
             rotate<-Inner_Angle,0,0>
             translate<Len_X,0,0>
           } //------------------
  translate<0,0,-BR>
  rotate<0,0,Wire_Angle>
} // end of union  ---------------------- 
Winding the wire:
union{ //--------------------------------
 #local Nr = 0;                // start
 #local EndNr = 4*Revolutions; // end
 #while (Nr< EndNr)            // loop
   object{ Quarter
           translate<0, Nr*WD/4,0>
           rotate<0,-Nr*90,0>
         } //----------------

 #local Nr = Nr + 1; // next Nr
 #end // ---------------// end of loop
// translate<0,WR ,0>
 texture{ Wire_Texture }
 rotate<0,0,0>
 translate<0,0,0>
} // end of union ----------------------- 

Scene file for POV-Ray:
"Winding_Wire_x1.txt" or "Winding_Wire_x1.pov"


coil
coil
coil
top

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