openalea.phenomenal.calibration.frame.triangle_frame

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

Compute the local frame of a triangle

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 such as : Ox . Oy = 0

  • The third axis Oz will be perpendicular to the plane such as : Oz = Ox ^ Oy

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

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

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

Returns Type:

Frame

Examples:

>>> # from numpy import array
>>> a = (1,1,1)
>>> b = (2,1,1)
>>> c = (1,2,1)
>>> fr = triangle_frame(a,b,c)
>>>
>>> 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])