Skip to content

Commit

Permalink
Merge branch 'AreaMassProperties' of https://github.com/hstehling/rhi…
Browse files Browse the repository at this point in the history
  • Loading branch information
hstehling committed Jul 8, 2015
2 parents b5c88c3 + 24c81a5 commit ce2c2e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Scripts/rhinoscript/curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ def CurveArea(curve_id):
curve = rhutil.coercecurve(curve_id, -1, True)
tol = scriptcontext.doc.ModelAbsoluteTolerance
mp = Rhino.Geometry.AreaMassProperties.Compute(curve, tol)
if mp == None: return None
return mp.Area, mp.AreaError


Expand All @@ -673,6 +674,7 @@ def CurveAreaCentroid(curve_id):
curve = rhutil.coercecurve(curve_id, -1, True)
tol = scriptcontext.doc.ModelAbsoluteTolerance
mp = Rhino.Geometry.AreaMassProperties.Compute(curve, tol)
if mp == None: return None
return mp.Centroid, mp.CentroidError


Expand Down

0 comments on commit ce2c2e1

Please sign in to comment.