Dystlab software has its own scripting engine (Scripter) that supports Pascal and Basic programming languages. Scripter can be used to develop applications, draw frames in reports, graphical visualizations, and more.


Scene library

procedure Scene.AddCone(x, y, z, Radius, Height: Double);

Description: Adds a cone with coordinates (x,y,z), base radius Radius, and height Height to the scene.

Example:

Scene.AddCone(0, 0, 0, 0.55, 2.5);

procedure Scene.AddCube(x, y, z, SizeX, SizeY, SizeZ: Double);

Description: Adds a cuboid with center coordinates (x,y,z) and dimensions SizeX, SizeY, SizeZ to the scene.

Example:

Scene.AddCube(0, 0, 0, 2.5, 10, 15);

procedure Scene.AddCylinder(x, y, z, Radius, Height: Double);

Description: Adds a cylinder with coordinates (x,y,z), radius Radius, and height Height to the scene.

Example:

procedure Scene.AddDisk(x, y, z, r: Double);

Description: Adds a flat disk with center coordinates (x,y,z) and radius "r" to the scene.

Example:

Scene.AddDisk(0, 0, 0, 5.5);

procedure Scene.AddGridXY(x1, x2, StepX, y1, y2, StepY: Double);

Description: Adds a grid to the scene in the XY plane. The arguments x1, x2 are the coordinates of the start and end of the grid along the "x" axis. The y1, y2 arguments are the same, along the "y" axis. The arguments StepX, StepY are the grid steps along the "x" and "y" axis, respectively.

Example:

Scene.AddGridXY(-10, 10, 0.5, -20, 20, 2.5);

procedure Scene.AddGridXZ(x1, x2, StepX, z1, z2, StepZ: Double);

Description: Adds a grid to the scene in the XZ plane. The arguments x1, x2 are the coordinates of the start and end of the grid along the "x" axis. The z1, z2 arguments are the same, along the "z" axis. The arguments StepX, StepZ are the grid steps along the "x" and "z" axis, respectively.

Example:

Scene.AddGridXZ(-10, 10, 0.5, -20, 20, 2.5);

procedure Scene.AddGridYZ(y1, y2, StepX, z1, z2, StepZ: Double);

Description: Adds a grid to the scene in the YZ plane. The arguments y1, y2 are the coordinates of the start and end of the grid along the "y" axis. The z1, z2 arguments are the same, along the "z" axis. The arguments StepY, StepZ are the grid steps along the "y" and "z" axis, respectively.

Example:

Scene.AddGridYZ(-10, 10, 0.5, -20, 20, 2.5);

procedure Scene.AddLine(x1, y1, z1, x2, y2, z2: Double);

Description: Adds a line to the scene with start (x1,y1,z1) and end (x2,y2,z2) coordinates.

Example:

Scene.AddLine(0, 0, 0, 100, 100, -2);

procedure Scene.AddLineSegment(x, y, z: Double);

Description: Adds a polyline point with coordinates (x,y,z) to the scene. The start of the polyline is the first point after the "Scene.StartLineGroup" command. You can end the polyline with the "Scene.CloseLineGroup" command.

Example:

Scene.AddLineSegment(10, 0, -20);

procedure Scene.AddPoint(x, y, z: Double);

Description: Adds a point with coordinates (x,y,z) to the scene. For large groups, it is recommended to add points between the StartPointGroup..ClosePointGroup commands.

Example:

Scene.AddPoint(0, 0, 0);

procedure Scene.AddScreenText(S: string; x, y: Integer);

Description: Adds the text "S" to the scene in the screen coordinates (x,y). The origin of the screen coordinate system is the upper left corner.

Example:

Scene.AddScreenText(DateToStr(Now), 5, 5);

procedure Scene.AddSphere(x, y, z, Radius: Double);

Description: Adds a sphere to the scene with center coordinates (x,y,z) and radius Radius.

Example:

Scene.AddSphere(0, 0, 0, 12);

procedure Scene.AddText(S: string; x, y, z: Double);

Description: Adds the text "S" to the scene in the (x,y,z) coordinates.

Example:

Scene.AddText('XYZ', 0, 0, 0);

procedure Scene.Clear;

Description: Clears the scene — removes all graphic objects.

Example:

Scene.Clear;

procedure Scene.CloseLineGroup;

Description: Closes the polyline that was started with the "Scene.StartLineGroup" command. The points of the polyline are added with the "Scene.AddLineSegment" command.

Example:

Scene.CloseLineGroup;

procedure Scene.ClosePointGroup;

Description: Closes the point group started with the "Scene.StartPointGroup" command.

Example:

Scene.ClosePointGroup;

property Scene.DefaultDirection.X [Y] [Z] : Double;

Description: Defines the "direction" vector for new scene objects.

Example:

Scene.DefaultDirection.X := 1.0;

property Scene.DefaultPosition.X [Y] [Z] : Double;

Description: Defines the position for new scene objects.

Example:

Scene.DefaultPosition.Z := -5;

property Scene.DefaultRotation.X [Y] [Z] : Double;

Description: Defines the orientation (rotation angles) for new objects in the scene. The angles are specified in degrees.

Example:

Scene.DefaultRotation.Y := 90;

property Scene.DefaultUp.X [Y] [Z] : Double;

Description: Defines the "top" vector for new scene objects.

Example:

Scene.DefaultUp.Z := 1.0;

property Scene.LineStyle.Color: TColor;

Description: Returns the current line color or sets a new one. By default "clBlack".

Example:

Scene.LineStyle.Color := clRed;

property Scene.LineStyle.Pattern: Word;

Description: Returns the current line type or sets a new one. By default "$FFFF" (solid line).

Example:

Scene.LineStyle.Pattern := 0;

property Scene.LineStyle.Width: Double;

Description: Returns the current line thickness or sets a new one. Applies to all subsequent objects. By default 1.

Example:

Scene.LineStyle.Width := 1.5;

property Scene.Material.Back.Ambient: TColor;

Description: Same as Scene.Material.Front.Ambient, but for the back side of the object.

Example:

Scene.Material.Back.Ambient := clRed;

property Scene.Material.Back.Diffuse: TColor;

Description: The same as Scene.Material.Front.Diffuse, but for the back side of the object.

Example:

Scene.Material.Back.Diffuse := clRed;

property Scene.Material.Back.Emission: TColor;

Description: Same as Scene.Material.Front.Emission, but for the back side of the object.

Example:

Scene.Material.Back.Emission := clRed;

property Scene.Material.Back.Shininess: Byte;

Description: Same as Scene.Material.Front.Shininess, but for the back side of the object.

Example:

Scene.Material.Back.Shininess := 10;

property Scene.Material.Back.Specular: TColor;

Description: The same as Scene.Material.Front.Specular, but for the back side of the object.

Example:

Scene.Material.Back.Specular := clRed;

property Scene.Material.Front.Ambient: TColor;

Description: Returns the current color or sets a new "Ambient" color to the front of the object.

Example:

Scene.Material.Front.Ambient := clRed;

property Scene.Material.Front.Diffuse: TColor;

Description: Returns the current color or sets a new "Diffuse" color to the front of the object.

Example:

Scene.Material.Front.Diffuse := clRed;

property Scene.Material.Front.Emission: TColor;

Description: Returns the current color or sets a new "Emission" color to the front of the object.

Example:

Scene.Material.Front.Emission := clRed;

property Scene.Material.Front.Shininess: Byte;

Description: Returns the current or sets a new shine intensity for the front of the object.

Example:

Scene.Material.Front.Shininess := 10;

property Scene.Material.Front.Specular: TColor;

Description: Returns the current color or sets a new "Specular" color for the front of the object.

Example:

Scene.Material.Front.Specular := clRed;

property Scene.PointStyle.Color: TColor;

Description: Returns the current color or sets a new color for the points. By default "clBlack".

Example:

Scene.PointStyle.Color := clRed;

property Scene.PointStyle.Size: Double;

Description: Returns the current or sets a new point size. By default 6.

Example:

Scene.PointStyle.Size := 1.5;

procedure Scene.RotateAbsolute(Obj: TObject; rx, ry, rz: Double);

Description: Rotates the object Obj by an angle (rx,ry,rz) relative to the corresponding "x", "y", "z" axes. The angle is specified in degrees.

Example:

Scene.RotateAbsolute(Cube1, 0, 45, 0);

procedure Scene.StartLineGroup;

Description: Starts the polyline. The points of the polyline are added with the "Scene.AddLineSegment" command. Closes the polyline with the "Scene.CloseLineGroup" command.

Example:

Scene.StartLineGroup;

procedure Scene.StartPointGroup;

Description: Starts a group of points that are added with the "Scene.AddPoint" command. You can close a group of points with the "Scene.ClosePointGroup" command.

Example:

Scene.StartPointGroup;

property Scene.TextStyle.Alignment: TAlignment;

Description: Returns the current or sets a new horizontal text alignment. Can have values "taLeftJustify", "taRightJustify", "taCenter".

Example:

Scene.TextStyle.Alignment := taCenter;

property Scene.TextStyle.Angle: Double;

Description: Returns the current or sets a new text rotation angle. The angle is specified in degrees.

Example:

Scene.TextStyle.Angle := 45.0;

property Scene.TextStyle.Font.Color: TColor;

Description: Returns the current text color or sets a new one.

Example:

Scene.TextStyle.Font.Color := clBlue;

property Scene.TextStyle.Font.Name: string;

Description: Returns the current text font or sets a new one.

Example:

Scene.TextStyle.Font.Name := 'Times New Roman';

property Scene.TextStyle.Font.Size: Integer;

Description: Returns the current text size or sets a new one.

Example:

Scene.TextStyle.Font.Size := 12;

property Scene.TextStyle.Font.Style: TFontStyle;

Description: Returns the current text style or sets a new one. Can be set to "fsBold", "fsItalic", "fsUnderline", "fsStrikeOut".

Example:

Scene.TextStyle.Font.Style := [fsBold, fsItalic];

property Scene.TextStyle.VerticalAlignment: TVerticalAlignment;

Description: Returns the current or sets a new vertical alignment of the text. Can have values "taAlignTop", "taAlignBottom", "taVerticalCenter".

Example:

Scene.TextStyle.VerticalAlignment := taVerticalCenter;

procedure Scene.Translate(Obj: TObject; dx, dy, dz: Double);

Description: Moves the "Obj" object in the scene space by a distance (dx,dy,dz) relative to the corresponding x, y, and z axes.

Example:

Scene.Translate(Sphere1, 1.5, -2.6, 0);

property Scene.View.AntiAliasing: TGLAntiAliasing;

Description: Returns the current AntiAliasing mode or sets a new one. It can have the values "aaDefault", "aaNone", "aa2x", "aa2xHQ", "aa4x", "aa4xHQ", "aa6x", "aa8x", "aa16x", "csa8x", "csa8xHQ", "csa16x", "csa16xHQ".

Example:

Scene.View.AntiAliasing := aaNone;

property Scene.View.BackgroundColor: TColor;

Description: Returns the current background color or sets a new one.

Example:

Scene.View.BackgroundColor := clGray;

property Scene.View.BackgroundAlpha: Single;

Description: Returns the current or sets a new background transparency level.

Example:

Scene.View.BackgroundAlpha := 0.5;

property Scene.View.Lighting: Boolean;

Description: Returns the current lighting mode or changes it. If True, the scene uses light sources to illuminate objects.

Example:

Scene.View.Lighting := False;