Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
TracePro_User_Manual_5.0.pdf
Источник:
Скачиваний:
281
Добавлен:
03.05.2015
Размер:
6.09 Mб
Скачать

Using the Macro Language

Running a Scheme Program Stored in a File

To run a macro program, open its *.scm file in TracePro using Macros|Execute. The file is loaded, then executed. Informative messages can be displayed in the Message/Macro window. This is the same window in which informative messages are displayed during ray tracing.

FIGURE 8.2 - The Macro|Load/Execute Dialog Box.

Scheme Commands

We encourage you to investigate the changes and recommend, through TracePro Support, additions that could be made to TracePro Documentation. In all cases, the Help|Macro Reference provides the most up-to-date descriptions and examples for both the ACIS and TracePro Scheme commands.

Creating Solids

Solid objects are created using the solid class, e.g., solid:cone or solid:block. Solids can also be named, so that they can be manipulated later, for example, moved, rotated, or used with a Boolean operation.

Create a solid block:

(solid:block (position 0 0 0) (position 20 30 40))

This creates a block with one corner at (0,0,0) and the other at (20,30,40), oriented parallel to the coordinate axes.

Create a solid block named blk1:

(define blk1(solid:block(position 0 0 0)(position 20 30 40)))

This creates a block with one corner at (0,0,0) and the other at (20,30,40), oriented parallel to the coordinate axes with the name blk1. Naming an object lets you perform additional operations on it. Names are active only during the macro command session. They are not saved with the model.

8.8

TracePro 5.0 User’s Manual

Creating Solids

Create a solid cylinder:

(solid:cylinder (position 0 0 0) (position 20 30 40) 10)

This creates a solid cylinder with one end at (0,0,0), the other end at (20,30,40), with a radius of 10.

Create a solid elliptical cylinder:

(solid:cylinder (position 0 0 0) (position 20 30 40) 10 0.5)

This creates a solid elliptical cylinder with one end at (0,0,0), the other end at (20,30,40), with elliptical radii of 10 and 5 (i.e. 0.5*10). Note that the only difference between this command and the previous one is the extra number in the argument list. The scheme interpreter determines from context that it should create an elliptical cylinder.

Create a solid cone:

(solid:cone (position 0 0 0) (position 20 30 40) 10 5)

This creates a solid cone with one end at (0,0,0), the other end at (20,30,40), with a radius of 10 at the first end and 5 at the second end.

Create a solid elliptical cone:

(solid:cone (position 0 0 0) (position 20 30 40) 10 5 0.5)

This creates a solid cone with one end at (0,0,0), the other end at (20,30,40), with a major radius of 10 at the first end and 5 at the second end. The elliptical ends have a ratio of 0.5 between the major and minor axes.

Create a solid torus:

(solid:torus (position 0 0 0) 10 5)

This creates a solid torus with center at (0,0,0), a major radius of 10 and a minor radius of 5. When the major radius is larger than the minor radius, a doughnutshaped solid is created. When the major radius is smaller, an apple-shaped object is created. When the major radius is negative, a football-shaped (or lemonshaped) solid is created.

TracePro 5.0 User’s Manual

8.9

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]