the geometry module¶
- pNbody.geometry.align(x, axis1=[1, 0, 0], axis2=[0, 0, 1], point=[0, 0, 0])¶
Rotate the object around point in order to align the axis ‘axis1’ with the axis ‘axis2’.
axis1 : [x,y,z] axis2 : [x,y,z]
- pNbody.geometry.boxcut(pos, args)¶
Return only particles that are inside box 1:1:1
- pNbody.geometry.boxcut_segments(pos, args)¶
Return only particles that are inside box 1:1:1
- pNbody.geometry.expose(obj, obs, eye=None, dist_eye=None, foc=None)¶
Rotate and translate the object in order to be seen as if the observer was in x0, looking at a point in xp.
obj : object array to expose obs : representation of the observer eye : ‘right’ or ‘left’ dist_eye : distance between eyes (separation = angle)) foc : focal
- pNbody.geometry.frustum(pos, clip, size)¶
Project using a frustrum matrix
clip = near and far planes size = size of the box
- pNbody.geometry.get_obs(x0=[0.0, - 50.0, 0.0], xp=[0.0, 0.0, 0.0], alpha=0, view='xz', r_obs=50)¶
From some parameters, return an obs matrix
{x0,xp,alpha} or {xz}
- pNbody.geometry.inv_viewport(xw, yw, zw, shape)¶
viewport transformation
xn = position (output from frustum or ortho) shape = shape of the image
- pNbody.geometry.norm(x)¶
return the norm of vector x
- pNbody.geometry.ortho(pos, clip, size)¶
Project using an ortho matrix
clip = near and far planes size = size of the box
- pNbody.geometry.rotate(x, angle=0, axis=[1, 0, 0], point=[0, 0, 0])¶
Rotate the positions and/or the velocities of the object around a specific axis with respect to a specific point
angle : rotation angle in radian axis : [x,y,z] : around this axis point : [x,y,z] : rotation origin
use the euler rotation matrix
- pNbody.geometry.viewport(xn, shape=None)¶
viewport transformation
xn = position (output from frustum or ortho) shape = shape of the image