openalea.phenomenal.calibration.frame.tetrahedron_frame

openalea.phenomenal.calibration.frame.tetrahedron_frame(pt1, pt2, pt3, pt4)[source]

Compute the local frame of a tetrahedron

The returned frame is such as :
  • The origin of the frame will be in pt1.

  • The first axis Ox will be directed along pt2 - pt1

  • The second axis OY will be in the plane of the triangle pt1,pt2,pt3 such as : Ox . Oy = 0

  • The third axis Oz will be perpendicular to the plane pt1,pt2,pt3 and oriented toward pt4 such as : Oz = Ox ^ Oy

Parameters:
  • pt1 (float,float,float) - first corner of the tetrahedron

  • pt2 (float,float,float) - second corner of the tetrahedron

  • pt3 (float,float,float) - third corner of the tetrahedron

  • pt4 (float,float,float) - fourth corner of the tetrahedron

Returns Type:

Frame

Examples:

>>> # from numpy import array
>>> a = (1,1,1)
>>> b = (2,1,1)
>>> c = (1,2,1)
>>> d = (1,1,2)
>>> fr = tetrahedron_frame(a,b,c,d)
>>>
>>> fr.global_point( (0,0,0) )
array([1,1,1])
>>> fr.global_point( (1,0,0) )
array([2,1,1])
>>> fr.local_point( (2,2,2) )
array([1,1,1])