cellpack.autopack.ingredient package

Submodules

cellpack.autopack.ingredient.Ingredient module

class cellpack.autopack.ingredient.Ingredient.DistributionOptions(value)[source]

Bases: MetaEnum

An enumeration.

LIST_VALUES = 'list_values'
MAX = 'max'
MEAN = 'mean'
MIN = 'min'
STD = 'std'
class cellpack.autopack.ingredient.Ingredient.DistributionTypes(value)[source]

Bases: MetaEnum

An enumeration.

LIST = 'list'
NORMAL = 'normal'
UNIFORM = 'uniform'
class cellpack.autopack.ingredient.Ingredient.Ingredient(type='single_sphere', color=None, count=0, count_options=None, cutoff_boundary=None, cutoff_surface=0.0, distance_expression=None, distance_function=None, force_random=False, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), molarity=0.0, name=None, jitter_attempts=5, object_name=None, offset=[0, 0, 0], orient_bias_range=[-3.141592653589793, 3.141592653589793], overwrite_distance_function=True, packing_mode='random', priority=0, partners=None, perturb_axis_amplitude=0.1, place_method='jitter', principal_vector=(1, 0, 0), rejection_threshold=30, representations=None, resolution_dictionary=None, rotation_axis=None, rotation_range=6.2831, size_options=None, use_orient_bias=False, use_rotation_axis=False, weight=0.2)[source]

Bases: Agent

ARGUMENTS = ['color', 'count', 'count_options', 'cutoff_boundary', 'cutoff_surface', 'distance_expression', 'distance_function', 'force_random', 'gradient', 'gradient_weights', 'is_attractor', 'max_jitter', 'molarity', 'name', 'jitter_attempts', 'offset', 'orient_bias_range', 'overwrite_distance_function', 'packing_mode', 'priority', 'partners', 'perturb_axis_amplitude', 'place_method', 'principal_vector', 'rejection_threshold', 'representations', 'resolution_dictionary', 'rotation_axis', 'rotation_range', 'size_options', 'type', 'use_orient_bias', 'use_rotation_axis', 'weight', 'length', 'closed', 'uLength', 'biased', 'marge', 'orientation', 'walkignMode', 'constraintMarge', 'useHalton', 'compMask', 'use_rbsphere']
DecomposeMesh(poly, edit=True, copy=False, tri=True, transform=True)[source]
alignRotation(jtrans, gradients)[source]
apply_rotation(rot, point, origin=[0, 0, 0])[source]
attempt_to_pack_at_grid_location(env, ptInd, grid_point_distances, max_radius, spacing, usePP, collision_possible)[source]
buildMesh(mesh_store)[source]

Create a polygon mesh object from a dictionary verts,faces,normals

checkDistance(liste_nodes, point, cutoff)[source]
checkIfUpdate(nbFreePoints, threshold)[source]

Check if we need to update the distance array. Part of the hack free points

check_against_one_packed_ingr(index, level, search_tree)[source]
close_partner_check(env, translation, rotation, compartment, afvi, moving)[source]
correctBB(p1, p2, radc)[source]
deleteblist(d, n)[source]
far_enough_from_surfaces(point, cutoff)[source]
getAxisRotation(rot)[source]

combines a rotation about axis to incoming rot. rot aligns the principal_vector with the surface normal rot aligns the principal_vector with the biased diretion

getBiasedRotation(rot, weight=None)[source]

combines a rotation about axis to incoming rot

getData()[source]
getEncapsulatingRadius(mesh=None)[source]
getIngredientsInBox(env, jtrans, rotMat, compartment)[source]
getListCompFromMask(cId, ptsInSphere)[source]
getMaxJitter(spacing)[source]
getMesh(filename, geomname, mesh_store)[source]

Create a mesh representation from a filename for the ingredient

@type filename: string @param filename: the name of the input file @type geomname: string @param geomname: the name of the output geometry

@rtype: DejaVu.IndexedPolygons/HostObjec @return: the created mesh

get_all_positions_to_check(packing_location)[source]

Takes a starting position in the packing space, and returns all the points that need to be tested for a collision as an array.

If the point isn’t close to an edge, will return just the staring point. If the point is close to the side of the bounding box, will return an array of 2. If the point is close to an edge of the bb (which is a “corner” in 2D), will return an array of 3. If the point is close to a corner in 3D will return an array of 8.

get_compartment(env)[source]
get_cuttoff_value(spacing)[source]

Returns the min value a grid point needs to be away from a surfance in order for this ingredient to pack. Only needs to be calculated once per ingredient once the jitter is set.

get_list_of_free_indices(distances, free_points, nbFreePoints, spacing, comp_ids, threshold)[source]
get_new_distances_and_inside_points(env, packing_location, rotation_matrix, grid_point_index, grid_distance_values, new_dist_points, inside_points, signed_distance_to_surface=None)[source]
get_new_jitter_location_and_rotation(env, starting_pos, starting_rotation)[source]
get_new_pos(ingr, pos, rot, positions_to_adjust)[source]

Takes positions_to_adjust, such as an array of spheres at a level in a sphere tree, and adjusts them relative to the given position and rotation

get_partners(env, jtrans, rotMat, organelle)[source]
get_rbNodes(close_indice, currentpt, removelast=False, prevpoint=None, getInfo=False)[source]
get_rb_model(alt=False)[source]
get_rotation(pt_ind, env, compartment)[source]
handle_real_time_visualization(helper, ptInd, target_point, rot_mat)[source]
has_mesh()[source]
has_pdb()[source]
initialize_mesh(mesh_store)[source]
is_point_in_correct_region(point)[source]
jitterPosition(position, spacing, normal=None)[source]

position are the 3d coordiantes of the grid point spacing is the grid spacing this will jitter gauss(0., 0.3) * Ingredient.max_jitter

jitter_place(env, targeted_master_grid_point, rot_mat, moving, distance, dpad, pt_index)[source]

Check if the given grid point is available for packing using the jitter collision detection method. Returns packing location and new grid point values if packing is successful.

lookForNeighbours(env, trans, rotMat, organelle)[source]
merge_place_results(new_results, accum_results)[source]
np_check_collision(packing_location, rotation)[source]
oneJitter(env, trans, rotMat)[source]
pack_at_grid_pt_location(env, jtrans, rotation_matrix, dpad, grid_point_distances, inside_points, new_dist_points, pt_index)[source]
perturbAxis(amplitude)[source]
place(env, dropped_position, dropped_rotation, grid_point_index, new_inside_points)[source]
point_is_available(newPt)[source]

Takes in a vector returns a boolean

randomize_rotation(rotation, env)[source]
randomize_translation(env, translation, rotation)[source]
reject()[source]
remove_from_realtime_display(moving)[source]
reset()[source]

reset the states of an ingredient

rigid_place(env, ptInd, compartment, target_grid_point_position, rotation_matrix, nbFreePoints, distance, dpad, moving)[source]

drop the ingredient on grid point ptInd

setTilling(comp)[source]
spheres_SST_place(env, compartment, ptInd, target_grid_point_position, rotation_matrix, moving, distance, dpad)[source]

drop the ingredient on grid point ptInd

static_id = 0

Base class for Ingredients that can be added to a Recipe. Ingredients provide:

  • a molarity used to compute how many to place

  • a generic density value

  • a unit associated with the density value

  • a jitter amplitude vector specifying by how much the jittering

algorithm can move from the grid position. - a number of jitter attempts - an optional color used to draw the ingredient default (white) - an optional name - an optional pdb ID - an optional packing priority. If omitted the priority will be based on the radius with larger radii first ham here: (-)priority object will pack from high to low one at a time (+)priority will be weighted by assigned priority value (0)packignPriority will be weighted by complexity and appended to what is left of the (+) values - an optional principal vector used to align the ingredient - recipe will be a weakref to the Recipe this Ingredient belongs to - compartment_id is the compartment number (0 for cytoplasm, positive for compartment surface and negative compartment interior - Attributes used by the filling algorithm: - count counts the number of placed ingredients during a fill - counter is the target number of ingredients to place - completion is the ratio of placed/target - rejectionCounter is used to eliminate ingredients after too many failed attempts

store_packed_object(position, rotation, index)[source]
swap(d, n)[source]
transformPoints(trans, rot, points)[source]
transformPoints_mult(trans, rot, points)[source]
update_data_tree()[source]
update_display_rt(current_instance, translation, rotation)[source]
update_ingredient_size()[source]
use_mesh()[source]
use_pdb()[source]
static validate_distribution_options(distribution_options)[source]

Validates distribution options and returns validated distribution options

static validate_ingredient_info(ingredient_info)[source]

Validates ingredient info and returns validated ingredient info

class cellpack.autopack.ingredient.Ingredient.IngredientInstanceDrop(ptId, position, rotation, ingredient, rb=None)[source]

Bases: object

cellpack.autopack.ingredient.Ingredient.random() x in the interval [0, 1).

cellpack.autopack.ingredient.agent module

class cellpack.autopack.ingredient.agent.Agent(name, concentration, distance_expression=None, distance_function=None, force_random=False, gradient=None, gradient_weights=None, is_attractor=False, overwrite_distance_function=True, packing_mode='random', partners=None, place_method='jitter', weight=0.2)[source]

Bases: object

getSubWeighted(weights)[source]

From http://eli.thegreenplace.net/2010/01/22/weighted-random-generation-in-python/ This method is about twice as fast as the binary-search technique, although it has the same complexity overall. Building the temporary list of totals turns out to be a major part of the functions runtime. This approach has another interesting property. If we manage to sort the weights in descending order before passing them to weighted_choice_sub, it will run even faster since the random call returns a uniformly distributed value and larger chunks of the total weight will be skipped in the beginning.

get_weights_by_distance(placed_partners)[source]
pick_partner_grid_index(near_by_ingredients, placed_partners, current_packing_position=[0, 0, 0])[source]
cellpack.autopack.ingredient.agent.random() x in the interval [0, 1).

cellpack.autopack.ingredient.grow module

class cellpack.autopack.ingredient.grow.ActinIngredient(molarity, radii=[[50.0]], positions=None, positions2=None, priority=0, name=None, pdb=None, color=None, jitter_attempts=5, max_jitter=(1, 1, 1), perturb_axis_amplitude=0.1, length=10.0, closed=False, modelType='Cylinders', biased=1.0, type='Actine', principal_vector=(1, 0, 0), meshFile=None, packing=None, place_method='jitter', marge=35.0, influenceRad=100.0, meshObject=None, orientation=(1, 0, 0), count=0, **kw)[source]

Bases: GrowIngredient

updateFromBB(grid)[source]
class cellpack.autopack.ingredient.grow.GrowIngredient(available_regions=None, type='Grow', biased=1.0, closed=False, color=None, compMask=None, constraintMarge=False, cutoff_boundary=1.0, cutoff_surface=0.5, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), length=10.0, marge=20.0, meshFile=None, meshObject=None, model_type='Cylinders', molarity=0.0, name=None, jitter_attempts=5, count=0, count_options=None, orientation=(1, 0, 0), orient_bias_range=[-3.141592653589793, 3.141592653589793], priority=0, packing_mode='random', partners=None, perturb_axis_amplitude=0.1, place_method='jitter', positions=None, positions2=None, principal_vector=(1, 0, 0), radii=None, representations=None, rejection_threshold=30, rotation_axis=[0.0, 0.0, 0.0], rotation_range=6.2831, source=None, uLength=0, use_rbsphere=False, useHalton=True, useLength=False, use_orient_bias=False, use_rotation_axis=True, walkingMode='sphere', weight=0.2)[source]

Bases: MultiCylindersIngr

ARGUMENTS = ['color', 'count', 'count_options', 'cutoff_boundary', 'cutoff_surface', 'distance_expression', 'distance_function', 'force_random', 'gradient', 'gradient_weights', 'is_attractor', 'max_jitter', 'molarity', 'name', 'jitter_attempts', 'offset', 'orient_bias_range', 'overwrite_distance_function', 'packing_mode', 'priority', 'partners', 'perturb_axis_amplitude', 'place_method', 'principal_vector', 'rejection_threshold', 'representations', 'resolution_dictionary', 'rotation_axis', 'rotation_range', 'size_options', 'type', 'use_orient_bias', 'use_rotation_axis', 'weight', 'length', 'closed', 'uLength', 'biased', 'marge', 'orientation', 'walkignMode', 'constraintMarge', 'useHalton', 'compMask', 'use_rbsphere']
getFirstPoint(ptInd, seed=0)[source]
getInterpolatedSphere(pt1, pt2)[source]
getJtransRot(pt1, pt2)[source]
getJtransRot_r(pt1, pt2, length=None)[source]
getNextPoint()[source]
getNextPtIndCyl(jtrans, rotMatj, free_points, histoVol)[source]
getV3(pt1, pt2, alternate)[source]
get_alternate_position(alternate, alti, v, pt1, pt2)[source]
get_alternate_position_p(alternate, alti, v, pt1, pt2)[source]
get_new_distance_values(jtrans, rotMatj, gridPointsCoords, distance, dpad, level=0)[source]
get_signed_distance(packing_location, grid_point_location, rotation_matrix)[source]
grow(previousPoint, startingPoint, secondPoint, listePtCurve, listePtLinear, histoVol, ptInd, free_points, nbFreePoints, distance, dpad, stepByStep=False, r=False, usePP=False)[source]
grow_place(env, ptInd, free_points, nbFreePoints, distance, dpad, usePP=False)[source]
mask_sphere_points(v, pt, marge, listeclosest, cutoff, alternate=None, pv=None, marge_diedral=None, v3=[])[source]
mask_sphere_points_angle(v, marge_in)[source]
mask_sphere_points_boundary(pt, boundingBox=None)[source]
mask_sphere_points_dihedral(v1, v2, marge_out, marge_diedral, v3=[])[source]
mask_sphere_points_ingredients(pt, listeclosest)[source]
mask_sphere_points_vector(v, pt, alternate)[source]
pickAlternateHalton(pt1, pt2, length)[source]
pickHalton(pt1, pt2)[source]
pickRandomSphere(pt1, pt2, marge, v)[source]
pick_alternate()[source]
pick_random_alternate()[source]
place_alternate(alternate, alti, v, pt1, pt2)[source]
place_alternate_p(alternate, alti, v, pt1, pt2)[source]
prepare_alternates()[source]
prepare_alternates_proba()[source]
reset()[source]

reset the states of an ingredient

resetLastPoint(listePtCurve)[source]
resetSphereDistribution()[source]
updateGrid(rg, histoVol, dpad, free_points, nbFreePoints, distance, gridPointsCoords)[source]
walkLattice(pts, distance, histoVol, size, marge=999.0, checkcollision=True, saw=True)[source]
walkLatticeSurface(pts, distance, histoVol, size, mask, marge=999.0, checkcollision=True, saw=True)[source]
walkSphere(pt1, pt2, distance, histoVol, dpad, marge=90.0, checkcollision=True)[source]

use a random point on a sphere of radius uLength, and useCylinder collision on the grid

cellpack.autopack.ingredient.grow.random() x in the interval [0, 1).

cellpack.autopack.ingredient.multi_cylinder module

class cellpack.autopack.ingredient.multi_cylinder.MultiCylindersIngr(multi_bounds, radii, type='multi_cylinder', color=None, count=0, count_options=None, cutoff_boundary=None, cutoff_surface=0.0, distance_expression=None, distance_function=None, force_random=False, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), molarity=0.0, name=None, jitter_attempts=5, orient_bias_range=[-3.141592653589793, 3.141592653589793], packing_mode='random', priority=0, partners=None, perturb_axis_amplitude=0.1, place_method='jitter', principal_vector=(1, 0, 0), representations=None, rotation_axis=[0.0, 0.0, 0.0], rotation_range=6.2831, rejection_threshold=30, unit_length=None, use_orient_bias=False, use_rotation_axis=True, weight=0.2)[source]

Bases: Ingredient

This Ingredient is represented by a collection of cylinder specified by multi_bounds and radii. Each cylinder in the group is has two bounds, representing the center of the bottom and the center of the top, and a radius. The array of multi_bounds and radii must be the same length. The principal Vector will be used to align the ingredient

checkCylCollisions(centers1, centers2, radii, jtrans, rotMat, gridPointsCoords, distance, env, dpad)[source]

Check cylinders for collision

collides_with_compartment(env, jtrans, rotation_matrix)[source]

Check cylinders for collision

collision_jitter(jtrans, rotMat, level, gridPointsCoords, distance, histoVol, dpad)[source]

Check cylinders for collision

getBigBB()[source]
get_cuttoff_value(spacing)[source]

Returns the min value a grid point needs to be away from a surfance in order for this ingredient to pack. Only needs to be calculated once per ingredient once the jitter is set.

initialize_mesh(mesh_store)[source]

cellpack.autopack.ingredient.multi_sphere module

class cellpack.autopack.ingredient.multi_sphere.MultiSphereIngr(representations, available_regions=None, color=None, count=0, count_options=None, cutoff_boundary=None, cutoff_surface=None, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), molarity=0.0, name=None, jitter_attempts=5, offset=[0, 0, 0], orient_bias_range=[-3.141592653589793, 3.141592653589793], overwrite_distance_function=True, object_name=None, packing_mode='random', packing=0, partners=None, perturb_axis_amplitude=0.1, place_method='jitter', principal_vector=(1, 0, 0), priority=0, rejection_threshold=30, rotation_axis=[0.0, 0.0, 0.0], rotation_range=0, type='MultiSphere', use_orient_bias=False, use_rotation_axis=True, weight=0.2)[source]

Bases: Ingredient

This Ingredient is represented by a collection of spheres specified by radii and positions. The principal Vector will be used to align the ingredient

collides_with_compartment(env, jtrans, rotation_matrix)[source]

Check spheres for collision TODO improve the test when grid stepSize is larger that size of the ingredient

collision_jitter(jtrans, rotMat, level, gridPointsCoords, current_grid_distances, env, dpad)[source]

Check spheres for collision

get_new_distance_values(packed_position, packed_rotation, gridPointsCoords, distance, dpad, level)[source]
get_radius()[source]
get_signed_distance(packing_location, grid_point_location, rotation_matrix=None)[source]
pack_at_grid_pt_location(env, jtrans, rotation_matrix, dpad, grid_point_distances, inside_points, new_dist_points, pt_index)[source]

cellpack.autopack.ingredient.single_cube module

class cellpack.autopack.ingredient.single_cube.SingleCubeIngr(bounds, available_regions=None, type='single_cube', color=None, count=0, count_options=None, cutoff_boundary=None, cutoff_surface=0.0, distance_expression=None, distance_function=None, force_random=False, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), molarity=0.0, name=None, jitter_attempts=5, offset=None, orient_bias_range=[-3.141592653589793, 3.141592653589793], overwrite_distance_function=True, priority=0, partners=None, perturb_axis_amplitude=0.1, place_method='jitter', principal_vector=(1, 0, 0), representations=None, rejection_threshold=30, resolution_dictionary=None, rotation_axis=[0.0, 0.0, 0.0], rotation_range=0, use_orient_bias=False, use_rotation_axis=True, weight=0.2)[source]

Bases: Ingredient

This Ingredient is represented by a single cube. Required attribute: bounds, in the form of [lower bounds, upper bounds]. Each an x, y, z point.

collides_with_compartment(env, jtrans, rotation_matrix)[source]

Check cube for collision centers1 and centers2 should be the cornerPoints ? can also use the center plus size (edges), or the position/position2

collision_jitter(jtrans, rotMat, level, gridPointsCoords, current_grid_distances, histoVol, dpad)[source]

Check cube for collision centers1 and centers2 should be the cornerPoints, so we can do parrallelpiped can also use the center plus size (edges), or the position/position2

cube_surface_distance(point)[source]
get_new_distance_values(jtrans, rotMat, gridPointsCoords, distance, dpad, level=0)[source]
get_signed_distance(packing_location, grid_point_location, rotation_matrix)[source]

cellpack.autopack.ingredient.single_cylinder module

class cellpack.autopack.ingredient.single_cylinder.SingleCylinderIngr(bounds, radius, available_regions=None, type='single_cylinder', color=None, count=0, count_options=None, cutoff_boundary=None, cutoff_surface=0.0, distance_expression=None, distance_function=None, force_random=False, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), molarity=0.0, name=None, jitter_attempts=5, orient_bias_range=[-3.141592653589793, 3.141592653589793], packing_mode='random', priority=0, partners=None, perturb_axis_amplitude=0.1, place_method='jitter', principal_vector=(1, 0, 0), rotation_axis=[0.0, 0.0, 0.0], rotation_range=6.2831, rejection_threshold=30, u_length=None, use_orient_bias=False, use_rotation_axis=True, weight=0.2)[source]

Bases: Ingredient

This Ingredient is represented by a single cylinder specified by radii, positions and positions2. The principal Vector will be used to align the ingredient

checkCylCollisions(centers1, centers2, radii, jtrans, rotMat, gridPointsCoords, distance, env, dpad)[source]

Check cylinders for collision

collides_with_compartment(env, jtrans, rotation_matrix=None)[source]

Check cylinders for collision

collision_jitter(jtrans, rotMat, level, gridPointsCoords, distance, histoVol, dpad)[source]

Check cylinders for collision

getBigBB()[source]
get_cuttoff_value(spacing)[source]

Returns the min value a grid point needs to be away from a surfance in order for this ingredient to pack. Only needs to be calculated once per ingredient once the jitter is set.

get_signed_distance(packing_location, grid_point_location, rotation_matrix)[source]
initialize_mesh(mesh_store)[source]

cellpack.autopack.ingredient.single_sphere module

class cellpack.autopack.ingredient.single_sphere.SingleSphereIngr(radius, available_regions=None, type='single_sphere', color=None, count=0, count_options=None, cutoff_boundary=None, cutoff_surface=0.0, distance_expression=None, distance_function=None, force_random=False, gradient=None, gradient_weights=None, is_attractor=False, max_jitter=(1, 1, 1), molarity=0.0, name=None, jitter_attempts=5, object_name=None, offset=None, orient_bias_range=[-3.141592653589793, 3.141592653589793], overwrite_distance_function=True, packing_mode='random', priority=0, partners=None, perturb_axis_amplitude=0.1, place_method='jitter', principal_vector=(1, 0, 0), representations=None, rejection_threshold=30, resolution_dictionary=None, rotation_axis=[0.0, 0.0, 0.0], rotation_range=0, size_options=None, use_orient_bias=False, use_rotation_axis=True, weight=0.2)[source]

Bases: Ingredient

This Ingredient is represented by a single sphere and either a single radius, or a list of radii and offset vectors for each sphere representing the ingredient

collides_with_compartment(env, jtrans, rotation_matrix=None)[source]

Check spheres for collision TODO improve the testwhen grid stepSize is larger that size of the ingredient

collision_jitter(jtrans, rotMat, level, gridPointsCoords, current_grid_distances, env, dpad)[source]

Check spheres for collision

static create_circular_mask(x_width, y_width, z_width, center=None, radius=None, voxel_size=None)[source]

Creates a circular mask of the given shape with the specified center and radius

create_voxelization(image_data, bounding_box, voxel_size, image_size, position, **kwargs)[source]

Creates a voxelization for the sphere

get_new_distance_values(jtrans, rotMatj, gridPointsCoords, distance, dpad, level=0)[source]
get_radius()[source]
get_signed_distance(packing_location, grid_point_location, rotation_matrix=None)[source]
initialize_mesh(mesh_store)[source]

cellpack.autopack.ingredient.utils module

cellpack.autopack.ingredient.utils.ApplyMatrix(coords, mat)[source]

Apply the 4x4 transformation matrix to the given list of 3d points.

@type coords: array @param coords: the list of point to transform. @type mat: 4x4array @param mat: the matrix to apply to the 3d points

@rtype: array @return: the transformed list of 3d points

cellpack.autopack.ingredient.utils.bullet_checkCollision_mp(world, node1, node2)[source]
cellpack.autopack.ingredient.utils.getDihedral(a, b, c, d)[source]
cellpack.autopack.ingredient.utils.getNormedVector(a, b)[source]
cellpack.autopack.ingredient.utils.getNormedVectorOnes(a)[source]
cellpack.autopack.ingredient.utils.getNormedVectorU(a)[source]
cellpack.autopack.ingredient.utils.get_reflected_point(self, new_position, boundingBox=None)[source]
cellpack.autopack.ingredient.utils.rotVectToVect(vect1, vect2, i=None)[source]

returns a 4x4 transformation that will align vect1 with vect2 vect1 and vect2 can be any vector (non-normalized)

cellpack.autopack.ingredient.utils.rotax(a, b, tau, transpose=1)[source]

Build 4x4 matrix of clockwise rotation about axis a–>b by angle tau (radians). a and b are sequences of 3 floats each Result is a homogenous 4x4 transformation matrix. NOTE: This has been changed by Brian, 8/30/01: rotax now returns the rotation matrix, _not_ the transpose. This is to get consistency across rotax, mat_to_quat and the classes in transformation.py when transpose is 1 (default) a C-style rotation matrix is returned i.e. to be used is the following way Mx (opposite of OpenGL style which is using the FORTRAN style)

Module contents