home *** CD-ROM | disk | FTP | other *** search
/ Learning Maya 3 / Learning_Maya_3.iso / docs / mel_scripts / includes / spiralSurface.mel < prev    next >
Encoding:
Text File  |  2000-05-17  |  1.6 KB  |  46 lines

  1. //
  2. // Copyright (C) 1997-2000 Alias|Wavefront,
  3. // a division of Silicon Graphics Limited.
  4. //
  5. // The information in this file is provided for the exclusive use of the
  6. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  7. // and incorporate this code into other products for purposes authorized
  8. // by the Alias|Wavefront license agreement, without fee.
  9. //
  10. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  11. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  12. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  13. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  14. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. // PERFORMANCE OF THIS SOFTWARE.
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //
  22. //
  23. //    Description:This proc creates a spiral centred about the origin, with a 
  24. //    specific height, radius and number of rounds/turns/cycles.  Then it 
  25. //    extrudes a circle of "tubeRadius" along it.
  26. //
  27. //    Note: This script requires spiral.mel
  28. //
  29. //    Usage: spiralSurface height radius turns tubeRadius
  30. //    example: spiralSurface 3 1 5 .2
  31. //
  32. //
  33. //
  34. global proc string spiralSurface( float $ht, float $radius, float $numRounds,
  35.     float $tubeRadius)
  36.  
  37. {
  38.     string $path = `spiral $ht $radius $numRounds`;
  39.     string $circle[] = `circle -ch off -r $tubeRadius`;
  40.  
  41.     string $result[] = `extrude -n "spiral" -ch off -rn false -po 0 -et 2 -ucp 1 -fpt 1 -upn 1 $circle[0] $path`;
  42.  
  43.     delete $path $circle[0];
  44.     return $result[0];
  45. }
  46.