Skip to content
Snippets Groups Projects
Commit 4bf2e0a3 authored by Niklaus Johner's avatar Niklaus Johner
Browse files

Added functions to get th best fit line and best fit plane to an EntityView

in the structure_analysis.py python module
parent f9499b92
No related branches found
No related tags found
No related merge requests found
......@@ -84,3 +84,32 @@ def GetAlphaHelixContent(sele1):
f=GetFrameFromEntity(eh)
return f.GetAlphaHelixContent(sele1)
def CalculateBestFitLine(sele1):
"""
This function calculates the best fit line to the atoms in sele1.
Input:
sele1 : EntityView
It returns a geom::Line3
"""
if not sele1.IsValid():
print 'invalid view'
return
eh=sele1.GetHandle()
f=GetFrameFromEntity(eh)
return f.GetODRLine(sele1)
def CalculateBestFitPlane(sele1):
"""
This function calculates the best fit plane to the atoms in sele1.
Input:
sele1 : EntityView
It returns a geom::Plane
"""
if not sele1.IsValid():
print 'invalid view'
return
eh=sele1.GetHandle()
f=GetFrameFromEntity(eh)
return f.GetODRPlane(sele1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment