12.4.2. Body¶
12.4.2.1. Attributes:¶
General attributes for all the bodies:
.material: a material, with density, etc
.color: a default color. This can be overriden, as there are bodies with more than one color
.tags: an array of tags that can be used later to group or select
.volume [RW]: returns the volume of this. Setting the volume scales the body
.mass [RW]: returns the mass of the body
.weight [R]: returns the weight of the body. If a name is given, it will be takes as a place where to return the weight:
>> c = Sphere: .radius 40km .material titanium >> c.weight .at saturn? >> 45kgs
.print Saves this object to a graphical file. Directly saving a 3d object is a shortcut to putting it in the scene, selecting and placing a camera and choosing a renderer to the filename.
This method is used to easily get images of an object: it allows some tuning as the parameters below shoe, but for the full control you probably want to place the object in a scene, define a camera and render it.
- Parameters:
- .filename: name of the file. Format will be inferred from the extension, if given
- .format allows specifying the format. Overrides any extension
- .size: size for the image, in pixels.
- .outlook: a vector with the direction for the camera. Camera will be placed in a ray starting at the center at tha object and parallel to the vector given. Distance is regulated by the autoframe routine
- .camera: allows setting the camera (with all parameters, position, aperture, etc)
- .render: sets the rendering style. One of
pov
,phong
.
- See also: scene has, too, a quick-and-dirty
print
method that sets a camera and places it so it frames all the objects. - print is a function that focus the given object and prints it to a file. If the scene is more complex, all the objects in the focus will be included, unless the flag
..isolate
is given.
Note
print could be a global function, that can be applied to any object
- Parameters:
12.4.2.2. Methods:¶
asdfasfd