home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 November / Dppcpro1198.iso / Nov / Intelcad / Uncompressed / API / Scripts / 3dmeshes.scr < prev    next >
Encoding:
Text File  |  1998-03-18  |  9.6 KB  |  876 lines

  1. ;---------------------------------------------
  2. ;File name: 3dmeshes.SCR
  3. ;Purpose: Demonstrate 
  4. ;
  5. ;Last Modified: 3/18/98
  6. ;---------------------------------------------
  7. CMDECHO
  8. 0
  9. PICKBOX
  10. 3
  11. APERTURE
  12. 10
  13. ;
  14. ; Erase anything that's there already.
  15. erase
  16. all
  17.  
  18. ; Turn blips off
  19. blipmode
  20. off
  21. ; Set the current layer to zero.
  22. layer
  23. s
  24. 0
  25.  
  26. color
  27. bylayer
  28. ; Look at the whole scene from just below the SouthWest Isometric Viewpoint.
  29. vpoint
  30. -1,-1,.7
  31. ; Zoom to a big window.
  32. zoom
  33. c
  34. 118,80
  35. 500
  36. ; Setting all the other necessary system variables:
  37. elev
  38. 0
  39. 0
  40. gridmode
  41. 0
  42. fillmode
  43. 1
  44. snapmode
  45. 0
  46. linetype
  47. s
  48. bylayer
  49.  
  50. ; Draw everything in continuous lines.
  51. linetype
  52. s
  53. continuous
  54.  
  55. ; Draw 8 white lines for visual reference.
  56. line
  57. 0,240
  58. 200,240
  59.  
  60. line
  61. 0,200
  62. 200,200
  63.  
  64. line
  65. 0,160
  66. 200,160
  67.  
  68. line
  69. 0,120
  70. 200,120
  71.  
  72. line
  73. 0,80
  74. 200,80
  75.  
  76. line
  77. 0,40
  78. 200,40
  79.  
  80. line
  81. 0,0
  82. 200,0
  83.  
  84. line
  85. 0,-40
  86. 200,-40
  87.  
  88. line
  89. 240,-40
  90. 240,200
  91. ;*************************************************************************
  92. ;*************************************************************************
  93. ;BOXES
  94. ;*************************************************************************
  95. ;*************************************************************************
  96.  
  97. ; Draw the boxes in red.
  98. layer
  99. m
  100. boxes3dm
  101. c
  102. red
  103.  
  104.  
  105. ; Draw 2 boxes (not cubes) next to each other.
  106. box
  107. 10,120,0
  108. length
  109. 16
  110. 12
  111. 8
  112. box
  113. 26,118,0
  114. length
  115. 16
  116. 16
  117. 10
  118. ; Draw a stack of 3 cubes by specifying starting points and lengths.
  119. box
  120. 50,120,0
  121. c
  122. 10
  123. box
  124. 51,121,10
  125. c
  126. 8
  127. box
  128. 52,122,18
  129. c
  130. 6
  131. ; Draw 4 concentric cubes by specifying centers and cube lengths.
  132. box
  133. c
  134. 100,130,10
  135. c
  136. 20
  137. box
  138. c
  139. 100,130,10
  140. c
  141. 15
  142. box
  143. c
  144. 100,130,10
  145. c
  146. 10
  147. box
  148. c
  149. 100,130,10
  150. c
  151. 5
  152. ;Boxes using Center and length, width and height
  153. box
  154. c
  155. 127,160
  156. l
  157. 10
  158. 10
  159. 10
  160. box
  161. c
  162. 140,160,10
  163. l
  164. 5
  165. 5
  166. 5
  167. ;Boxes using center, corner and height
  168. box
  169. c
  170. 155,160
  171. 161,167
  172. 5
  173. box
  174. c
  175. 155,160,10
  176. 157,163,5
  177. ;Boxes using Corner, and then other Corner and Height
  178. box
  179. 176,160
  180. 188,168
  181. 5
  182. box
  183. 176,160,20
  184. 180,168,20
  185. 5
  186. box
  187. 176,160,10
  188. 180,168,15
  189. ;3D>Box command using Corner, length, cube and rotation
  190. 3D
  191. box
  192. 193,160
  193. 193,169
  194. cube
  195. 15
  196. ;3D>Box command using corner, length, width, height and rotation
  197. 3D
  198. box
  199. 193,160
  200. 20
  201. 15
  202. 5
  203. 15
  204. ; Show what the boxes look like.
  205. ; hide
  206. ;*************************************************************************
  207. ;*************************************************************************
  208. ;SPHERES
  209. ;*************************************************************************
  210. ;*************************************************************************
  211. ; Make a blue layer for spheres.
  212. layer
  213. m
  214. spheres3dm
  215. c
  216. blue
  217.  
  218.  
  219. ; Draw 2 spheres by specifying centers and radii.
  220. ; Accept the defaults of 16 segments in both directions.
  221. 3d
  222. sphere
  223. 10,80,10
  224. 10
  225.  
  226.  
  227. 3d
  228. sphere
  229. 30,80,10
  230. 10
  231.  
  232.  
  233. ;Again, but with negative values
  234. 3d
  235. sphere
  236. 10,80,-10
  237. 10
  238.  
  239.  
  240. ; And with no Z value
  241. 3d
  242. sphere
  243. 30,80
  244. 5
  245.  
  246.  
  247. ; Draw a stack of spheres by specifying centers and diameters.
  248. 3d
  249. sphere
  250. 80,80,10
  251. d
  252. 20
  253. 32
  254. 32
  255. ;Draw these spheres using Sphere, rather than 3d > Sphere
  256. sphere
  257. 80,80,26
  258. 6
  259. sphere
  260. 80,80,35
  261. d
  262. 6
  263. ; Draw 4 concentric spheres.
  264. 3d
  265. sphere
  266. 120,80,20
  267. 20
  268. 32
  269. 16
  270. color
  271. green
  272. 3d
  273. sphere
  274. 120,80,20
  275. 15
  276. 20
  277. 10
  278. color
  279. yellow
  280. 3d
  281. sphere
  282. 120,80,20
  283. 10
  284. 16
  285. 8
  286. color
  287. white
  288. 3d
  289. sphere
  290. 120,80,20
  291. 5
  292. 6
  293. 4
  294. color
  295. bylayer
  296. ; Show what we have so far.
  297. ; hide
  298. ;*************************************************************************
  299. ;*************************************************************************
  300. ;WEDGES & 3D WEDGES
  301. ;*************************************************************************
  302. ;*************************************************************************
  303. ; Make a layer for wedges specified by their corners.
  304. layer
  305. m
  306. wedges-corner3dm
  307. c
  308. yellow
  309.  
  310.  
  311. ; Draw 4 wedges (all back-to-back) using opposite corners.
  312. wedge
  313. 20,40,0
  314. 30,60,10
  315. wedge
  316. 20,40,0
  317. 10,60,0
  318. 10
  319. wedge
  320. 20,40,0
  321. 30,60,-10
  322. wedge
  323. 20,40,0
  324. 10,60,-10
  325. ; Draw 4 wedges using corner/cube method. Command should repeat on its own.
  326. wedge
  327. 50,40,0
  328. c
  329. 20
  330.  
  331. 70,60,20
  332. c
  333. -20
  334.  
  335. 50,60,0
  336. c
  337. -20
  338.  
  339. 30,40,-20
  340. c
  341. 20
  342. ; Draw wedges using opposite corners and height.
  343. wedge
  344. 80,60
  345. 100,40
  346. 5
  347. wedge
  348. 100,40
  349. 120,60
  350. 15
  351. ; Draw 4 wedges using length, width and height.
  352. wedge
  353. 130,40,0
  354. length
  355. -10
  356. 30
  357. 15
  358.  
  359. 130,40,0
  360. length
  361. 10
  362. 30
  363. 15
  364.  
  365. 130,50,0
  366. length
  367. -10
  368. -10
  369. -30
  370.  
  371. 130,50,0
  372. length
  373. 10
  374. -10
  375. -30
  376. ;hide
  377. ; Make a new layer for wedges specified by their centers.
  378. layer
  379. m
  380. wedges-center3dm
  381. c
  382. green
  383.  
  384.  
  385. ; Draw little spheres to show where the centers of the wedges are.
  386. ; The spheres should end up being "embedded" in the faces of each wedge.
  387. 3d
  388. sphere
  389. 0,0,0
  390. 1
  391. 4
  392. 4
  393. 3d
  394. sphere
  395. 20,0,0
  396. 1
  397. 4
  398. 4
  399. 3d
  400. sphere
  401. 40,0,0
  402. 1
  403. 4
  404. 4
  405. 3d
  406. sphere
  407. 60,0,0
  408. 1
  409. 4
  410. 4
  411. 3d
  412. sphere
  413. 80,0,0
  414. 1
  415. 4
  416. 4
  417. 3d
  418. sphere
  419. 100,0,0
  420. 1
  421. 4
  422. 4
  423. ; Draw wedges by specifying the center first.
  424. ; First, center, 3D-corner
  425. wedge
  426. c
  427. 0,0,0
  428. -5,5,5
  429. ; Next, center, 2D-corner, height
  430. wedge
  431. c
  432. 20,0,0
  433. 22,16
  434. 12
  435. ; Center, cube, length
  436. wedge
  437. c
  438. 40,0,0
  439. cube
  440. 10
  441.  
  442. c
  443. 60,0,0
  444. cube
  445. -10
  446. ; Center, length, width, height
  447. wedge
  448. c
  449. 80,0,20
  450. l
  451. 15
  452. 30
  453. 10
  454. wedge
  455. c
  456. 100,0,20
  457. l
  458. -15
  459. -30
  460. -10
  461. ; Again, but with no Z values
  462. wedge
  463. c
  464. 80,0
  465. l
  466. 15
  467. 30
  468. 10
  469. wedge
  470. c
  471. 100,0
  472. l
  473. -15
  474. -30
  475. -10
  476. ; Using 3D > Wedge 
  477. 3d
  478. wedge
  479. 80,0,-30
  480. 10
  481. 10
  482. 10
  483. 15
  484. ; Another one, but with no z value
  485. 3d
  486. wedge
  487. 80,30
  488. 10
  489. 10
  490. 10
  491. 15
  492. ; Show what we have so far.
  493. ;hide
  494. ;*************************************************************************
  495. ;*************************************************************************
  496. ;CONES
  497. ;*************************************************************************
  498. ;*************************************************************************
  499. ; Make a magenta layer for cones
  500. layer
  501. m
  502. cones3dm
  503. c
  504. magenta
  505.  
  506.  
  507. ; Draw some cylindrical pointy cones next to the yellow wedges.
  508. ; The first 4 are specified by radius.
  509. 3d
  510. cone
  511. 160,40,0
  512. 8
  513. 0
  514. 30
  515. 16
  516. ; This one should accept the default of zero for the radius of the top.
  517. 3d
  518. cone
  519. 180,40,0
  520. 8
  521.  
  522. 20
  523. 8
  524. 3d
  525. cone
  526. 200,40,0
  527. .0001
  528. 6
  529. 30
  530. 12
  531. 3d
  532. cone
  533. 200,40,30
  534. 6
  535. 0
  536. 30
  537. 12
  538. ; These pointy cones use diameter.
  539. 3d
  540. cone
  541. 120,0,-50
  542. d
  543. .0001
  544. 10
  545. 50
  546. 32
  547. 3d
  548. cone
  549. 140,0,0
  550. d
  551. 20
  552. 0
  553. 10
  554. 32
  555. 3d
  556. cone
  557. 140,0,-10
  558. d
  559. .0001
  560. 10
  561. 10
  562. 32
  563. 3d
  564. cone
  565. 160,0,0
  566. d
  567. 16
  568. 0
  569. 20
  570. 32
  571. 3d
  572. cone
  573. 160,0,-20
  574. d
  575. .0001
  576. 8
  577. 20
  578. 32
  579. ; Draw cut-off cones using radius and diameter along the first line (-40)
  580. ; The first one uses radii in both places.
  581. 3d
  582. cone
  583. 0,-40,0
  584. 10
  585. 5
  586. 10
  587. 24
  588. ; The second one uses diameters in both places.
  589. 3d
  590. cone
  591. 20,-40,0
  592. d
  593. 20
  594. d
  595. 10
  596. 10
  597. 24
  598. ; This one should look "upside down".
  599. 3d
  600. cone
  601. 40,-40,0
  602. 5
  603. 10
  604. 20
  605. 32
  606. ; This last set should look like a slow-motion water drop...sort of.
  607. 3d
  608. cone
  609. 180,-40,0
  610. 20
  611. 40
  612. 5
  613. 64
  614. 3d
  615. cone
  616. 180,-40,0
  617. 20
  618. 10
  619. 7
  620. 32
  621. 3d
  622. cone
  623. 180,-40,0
  624. 6
  625. 10
  626. 7
  627. 24
  628. 3d
  629. cone
  630. 180,-40,0
  631. 6
  632. 0
  633. 15
  634. 16
  635. ;This cone uses radius and then diameter
  636. 3d
  637. cone
  638. 200,120
  639. 10
  640. d
  641. 1
  642. 10
  643. 4
  644. ;cone with elliptical > center > height
  645. cone
  646. e
  647. c
  648. 98,200
  649. 98,215
  650. 97,184
  651. 10
  652. ;Again, with 3d points
  653. cone
  654. e
  655. c
  656. 98,200,10
  657. 98,215,10
  658. 97,184,10
  659. 10
  660. ;Here's a spare sphere
  661. 3d
  662. sphere
  663. 180,-40,25
  664. 2
  665. 8
  666. 8
  667. ;Cone with elliptical > axis > height
  668. cone
  669. e
  670. 52,200
  671. 51,212
  672. 52,192
  673. 15
  674. ;Another one with Z values
  675. cone
  676. e
  677. 52,200,10
  678. 51,212,10
  679. 52,192,10
  680. 15
  681. ;Cone with Centerpoint > Diameter > Apex
  682. Cone
  683. 81,200
  684. d
  685. 10
  686. a
  687. 81,200,20
  688. ;Again, but with X, Y and Z values.
  689. cone
  690. 81,200,20
  691. d
  692. 10
  693. a
  694. 81,200,40
  695. ;Again, but with negative values
  696. cone
  697. 81,200,0
  698. d
  699. 10
  700. a
  701. 81,200,-20
  702. ;Cone with Centerpoint > Diameter > Height
  703. cone
  704. 98,200
  705. d
  706. 10
  707. 10
  708. ;Again, with Z values
  709. cone
  710. 98,200,20
  711. d
  712. 10
  713. 10
  714. ;Again, with negative values - Commented out until fixed
  715. cone
  716. 98,200,-10
  717. d
  718. 10
  719. -10
  720. ;Cone with Centerpoint > Radius >Apex 
  721. cone
  722. 116,200
  723. 8
  724. a
  725. 116,208
  726. ;Again, with Z values
  727. cone
  728. 116,200,10
  729. 8
  730. a
  731. 116,200,20
  732. ;Cone with Centerpoint > Radius > Height
  733. cone
  734. 135,200
  735. 6
  736. 15
  737. ;Again, with Z values
  738. cone
  739. 135,200,20
  740. 6
  741. 5
  742. ;Again, with negative values 
  743. cone
  744. 135,200,-10
  745. 6
  746. 5
  747. ;
  748. ;hide
  749. ;*************************************************************************
  750. ;*************************************************************************
  751. ;TORI
  752. ;*************************************************************************
  753. ;*************************************************************************
  754. ; Now we'll do toruses/tori.
  755. layer
  756. m
  757. toriods3dm
  758. c
  759. green
  760.  
  761.  
  762. ; The first two should look the same, one hovering over the other.
  763. ; Torus > Radius > Radius
  764. 3d
  765. torus
  766. 20,200,4
  767. 20
  768. 4
  769. 16
  770. 32
  771. ; Torus > Radius > Diameter
  772. 3d
  773. torus
  774. 20,200,50
  775. 10
  776. d
  777. 4
  778. 30
  779. 20
  780. ; Again using no z value
  781. 3d torus
  782. 20,200
  783. 10
  784. d
  785. 4
  786. 30
  787. 20
  788. ; Torus using Center > Diameter > Radius
  789. 3d
  790. torus
  791. 20,200,80
  792. d
  793. 10
  794. 2
  795. 12
  796. 12
  797. ; Again, but no z value
  798. 3d
  799. torus
  800. 40,200
  801. d
  802. 10
  803. 2
  804. 12
  805. 12
  806. ; Again, but with a negative z value
  807. 3d
  808. torus
  809. 20,200,-30
  810. d
  811. 10
  812. 2
  813. 3
  814. 12
  815. ; 3D >Torus using Center > Diameter > Diameter
  816. 3d
  817. torus
  818. 20,200,24
  819. d
  820. 40
  821. d
  822. 8
  823. 16
  824. 32
  825. ; Torus without 3D > Center > Radius > Radius
  826. Torus
  827. 20,200,60
  828. 10
  829. 4
  830. ;Torus without 3D > Center > Radius > Diameter
  831. torus
  832. 20,200,50
  833. 20
  834. d
  835. 5
  836. ; Again, but with no Z value
  837. torus
  838. 70,200
  839. 20
  840. d
  841. 5
  842. ; Torus without 3d > Center > Diameter
  843. torus
  844. 70,200,50
  845. d
  846. 20
  847. d
  848. 5
  849. ; Again, but with no z
  850. torus
  851. 70,200
  852. d
  853. 20
  854. d
  855. 5
  856. zoom
  857. c
  858. 118,80
  859. 200
  860. ; Show what we have so far, then regen to show everything.
  861. hide
  862. setvar
  863. cmdecho
  864. 0
  865. ;----------------------------------------------------------------------
  866. ;Now for the grand finale
  867. text
  868. -67,15,0
  869. 6
  870.  
  871. Done!
  872.  
  873.  
  874.  
  875. ;----------------------------------------------------------------------
  876.