Base class of all geometrical objects to be sliced.
Methods
accepted | |
copy | |
fd_close | |
fd_open | |
from_conf | |
get_aligned_bounding_box | |
get_dict | |
get_intersector | |
get_origin_bounding_box | |
has_intersection | |
init_intersection_counters | |
init_trait | |
intersects | |
objects_from_dict | |
report | |
set_conf | |
set_default_traits | |
setup_orientation | |
store_intersection | |
update_stats |
Called when an object’s placement is accepted.
Just adds one to the actual object class count.
Return an object class instance, based on conf.kind. The conf.kind should correspond to a module in the ‘gensei’ package directory. That module should contain a class named as the capitalized conf.kind, for example:
conf.kind = 'ellipsoid'
means the module gensei.ellipsoid with the Ellipsoid class.
Get the objects’s axes-aligned bounding box.
Get the objects’s axes-aligned bounding box as if centered at the origin.
Test whether two objects intersect. Some objects may provide only an approximate answer using a kind of bounding box (an intersector). In that case -1 is returned in place of 1 or 2, and the objects may not actually intersect (but should be mutually very close).
Returns: | flag : int
|
---|
If direction (orientation of the long axis of an object in space) is set in self.conf, compute the corresponding rot_axis (the direction vector of rotation axis) and rot_angle (the rotation angle around the rotation axis), that map the unrotated object (with direction0 orientation) to the rotated one.
From rot_axis and rot_angle form the rotation matrix rot_mtx, so that:
- direction = dot(rot_mtx.T, direction0)
- direction0 = dot(rot_mtx, direction)
If direction is not set in self.conf, use rot_axis and rot_angle from self.conf, and compute the direction using the above relation.
Store intersection if it occurred.
Parameters: | mask : bool array
axis : ‘x’, ‘y’ or ‘z’
coor: float :
|
---|