graphics Package¶
base Module¶
-
class
Axes(pos=(0, 0, 0), rot=None, cylinder_radius=0.05)[source]¶ Bases:
ars.graphics.base.Entity
-
class
Body(center, rot)[source]¶ Bases:
ars.graphics.base.EntityEntity representing a defined body with a given color.
-
class
Box(size, pos, rot=None)[source]¶ Bases:
ars.graphics.base.Body
-
class
Capsule(length, radius, center, rot=None, resolution=10)[source]¶ Bases:
ars.graphics.base.Body
-
class
Cone(height, radius, center, rot=None, resolution=100)[source]¶ Bases:
ars.graphics.base.BodyConstructor.
Parameters: resolution (int) – it is the circumferential number of facets
-
class
Cylinder(length, radius, center, rot=None, resolution=10)[source]¶ Bases:
ars.graphics.base.Body
-
class
Engine(*args, **kwargs)[source]¶ Bases:
objectAbstract class. Not coupled (at all) with VTK or any other graphics library
-
add_object(obj)[source]¶ Add
objto the visualization controlled by this adapter.Parameters: obj ( Body) –
-
-
class
Entity(pos, rot)[source]¶ Bases:
objectRenderable and movable object.
It has position and orientation. The underlying object is
actor, which connects to the real entity handled by the graphics library in use.-
actor¶
-
adapter= None¶
-
-
class
ScreenshotRecorder(base_filename)[source]¶ Bases:
object-
calc_filename(index=1)[source]¶ Calculate a filename using
indexfor a new image.Parameters: index (int) – image’s index to use for filename calculation Returns: image’s filename Return type: str
-
file_extension= None¶
-
write(index, time)[source]¶ Write render-window’s currently displayed image to a file.
The image format (thus the file extension too) to use must be defined by the implementation.
Image’s filename is determined by
calc_filename().Parameters: - index (int) – image’s index to use for filename calculation
- time –
-
-
class
Sphere(radius, center, rot=None, phi_resolution=50, theta_resolution=50)[source]¶ Bases:
ars.graphics.base.BodyConstructor.
Parameters: - phi_resolution (int) – resolution in the latitude (phi) direction
- theta_resolution (int) – resolution in the longitude (theta) direction
-
class
Trimesh(vertices, faces, pos=None, rot=None)[source]¶ Bases:
ars.graphics.base.Body
vtk_adapter Module¶
-
class
Axes(pos=(0, 0, 0), rot=None, cylinder_radius=0.05)[source]¶ Bases:
ars.graphics.vtk_adapter.Entity,ars.graphics.base.Axes
-
class
Body(*args, **kwargs)[source]¶
-
class
Capsule(length, radius, center, rot=None, resolution=20)[source]¶ Bases:
ars.graphics.vtk_adapter.Body,ars.graphics.base.Capsule
-
class
Cone(height, radius, center, rot=None, resolution=20)[source]¶ Bases:
ars.graphics.vtk_adapter.Body,ars.graphics.base.Cone
-
class
Cylinder(length, radius, center, rot=None, resolution=20)[source]¶ Bases:
ars.graphics.vtk_adapter.Body,ars.graphics.base.Cylinder
-
class
Engine(title, pos=None, size=(1000, 600), zoom=1.0, cam_position=(10, 8, 10), background_color=(0.1, 0.1, 0.4), **kwargs)[source]¶ Bases:
ars.graphics.base.EngineGraphics adapter to the Visualization Toolkit (VTK) library
-
class
ScreenshotRecorder(base_filename='screenshot_', graphics_adapter=None)[source]¶ Bases:
ars.graphics.base.ScreenshotRecorderBased on an official example script, very simple: http://www.vtk.org/Wiki/VTK/Examples/Python/Screenshot
-
file_extension= 'png'¶
-
-
class
Sphere(radius, center, rot=None, phi_resolution=20, theta_resolution=20)[source]¶ Bases:
ars.graphics.vtk_adapter.Body,ars.graphics.base.SphereVTK: sphere (represented by polygons) of specified radius centered at the origin. The resolution (polygonal discretization) in both the latitude (phi) and longitude (theta) directions can be specified.
-
class
Trimesh(vertices, faces, pos, rot=None)[source]¶ Bases:
ars.graphics.vtk_adapter.Body,ars.graphics.base.Trimesh