Skip to content

Commit

Permalink
Merge pull request #12 from mcneel/will/0.12.2
Browse files Browse the repository at this point in the history
Update to 0.12.2
  • Loading branch information
pearswj committed Nov 27, 2020
2 parents 4a0643e + 646989a commit 0cf4d7b
Show file tree
Hide file tree
Showing 16 changed files with 511 additions and 445 deletions.
14 changes: 9 additions & 5 deletions compute_rhino3d/AreaMassProperties.py
@@ -1,4 +1,8 @@
from . import Util
try:
from itertools import izip as zip # python 2
except ImportError:
pass # python 3


def Compute(closedPlanarCurve, multiple=False):
Expand Down Expand Up @@ -33,7 +37,7 @@ def Compute1(closedPlanarCurve, planarTolerance, multiple=False):
url = "rhino/geometry/areamassproperties/compute-curve_double"
if multiple: url += "?multiple=true"
args = [closedPlanarCurve, planarTolerance]
if multiple: args = zip(closedPlanarCurve, planarTolerance)
if multiple: args = list(zip(closedPlanarCurve, planarTolerance))
response = Util.ComputeFetch(url, args)
return response

Expand Down Expand Up @@ -91,7 +95,7 @@ def Compute4(mesh, area, firstMoments, secondMoments, productMoments, multiple=F
url = "rhino/geometry/areamassproperties/compute-mesh_bool_bool_bool_bool"
if multiple: url += "?multiple=true"
args = [mesh, area, firstMoments, secondMoments, productMoments]
if multiple: args = zip(mesh, area, firstMoments, secondMoments, productMoments)
if multiple: args = list(zip(mesh, area, firstMoments, secondMoments, productMoments))
response = Util.ComputeFetch(url, args)
return response

Expand Down Expand Up @@ -131,7 +135,7 @@ def Compute6(brep, area, firstMoments, secondMoments, productMoments, multiple=F
url = "rhino/geometry/areamassproperties/compute-brep_bool_bool_bool_bool"
if multiple: url += "?multiple=true"
args = [brep, area, firstMoments, secondMoments, productMoments]
if multiple: args = zip(brep, area, firstMoments, secondMoments, productMoments)
if multiple: args = list(zip(brep, area, firstMoments, secondMoments, productMoments))
response = Util.ComputeFetch(url, args)
return response

Expand Down Expand Up @@ -171,7 +175,7 @@ def Compute8(surface, area, firstMoments, secondMoments, productMoments, multipl
url = "rhino/geometry/areamassproperties/compute-surface_bool_bool_bool_bool"
if multiple: url += "?multiple=true"
args = [surface, area, firstMoments, secondMoments, productMoments]
if multiple: args = zip(surface, area, firstMoments, secondMoments, productMoments)
if multiple: args = list(zip(surface, area, firstMoments, secondMoments, productMoments))
response = Util.ComputeFetch(url, args)
return response

Expand Down Expand Up @@ -213,7 +217,7 @@ def Compute10(geometry, area, firstMoments, secondMoments, productMoments, multi
url = "rhino/geometry/areamassproperties/compute-geometrybasearray_bool_bool_bool_bool"
if multiple: url += "?multiple=true"
args = [geometry, area, firstMoments, secondMoments, productMoments]
if multiple: args = zip(geometry, area, firstMoments, secondMoments, productMoments)
if multiple: args = list(zip(geometry, area, firstMoments, secondMoments, productMoments))
response = Util.ComputeFetch(url, args)
return response

Expand Down
6 changes: 5 additions & 1 deletion compute_rhino3d/BezierCurve.py
@@ -1,4 +1,8 @@
from . import Util
try:
from itertools import izip as zip # python 2
except ImportError:
pass # python 3


def CreateCubicBeziers(sourceCurve, distanceTolerance, kinkTolerance, multiple=False):
Expand All @@ -18,7 +22,7 @@ def CreateCubicBeziers(sourceCurve, distanceTolerance, kinkTolerance, multiple=F
url = "rhino/geometry/beziercurve/createcubicbeziers-curve_double_double"
if multiple: url += "?multiple=true"
args = [sourceCurve, distanceTolerance, kinkTolerance]
if multiple: args = zip(sourceCurve, distanceTolerance, kinkTolerance)
if multiple: args = list(zip(sourceCurve, distanceTolerance, kinkTolerance))
response = Util.ComputeFetch(url, args)
return response

Expand Down
198 changes: 101 additions & 97 deletions compute_rhino3d/Brep.py

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions compute_rhino3d/BrepFace.py
@@ -1,4 +1,8 @@
from . import Util
try:
from itertools import izip as zip # python 2
except ImportError:
pass # python 3


def PullPointsToFace(thisBrepFace, points, tolerance, multiple=False):
Expand All @@ -15,7 +19,7 @@ def PullPointsToFace(thisBrepFace, points, tolerance, multiple=False):
url = "rhino/geometry/brepface/pullpointstoface-brepface_point3darray_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, points, tolerance]
if multiple: args = zip(thisBrepFace, points, tolerance)
if multiple: args = list(zip(thisBrepFace, points, tolerance))
response = Util.ComputeFetch(url, args)
response = Util.DecodeToPoint3d(response)
return response
Expand All @@ -39,7 +43,7 @@ def DraftAnglePoint(thisBrepFace, testPoint, testAngle, pullDirection, edge, mul
url = "rhino/geometry/brepface/draftanglepoint-brepface_point2d_double_vector3d_bool_point3d_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, testPoint, testAngle, pullDirection, edge]
if multiple: args = zip(thisBrepFace, testPoint, testAngle, pullDirection, edge)
if multiple: args = list(zip(thisBrepFace, testPoint, testAngle, pullDirection, edge))
response = Util.ComputeFetch(url, args)
return response

Expand All @@ -51,7 +55,7 @@ def RemoveHoles(thisBrepFace, tolerance, multiple=False):
url = "rhino/geometry/brepface/removeholes-brepface_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, tolerance]
if multiple: args = zip(thisBrepFace, tolerance)
if multiple: args = list(zip(thisBrepFace, tolerance))
response = Util.ComputeFetch(url, args)
response = Util.DecodeToCommonObject(response)
return response
Expand Down Expand Up @@ -89,7 +93,7 @@ def Split(thisBrepFace, curves, tolerance, multiple=False):
url = "rhino/geometry/brepface/split-brepface_curvearray_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, curves, tolerance]
if multiple: args = zip(thisBrepFace, curves, tolerance)
if multiple: args = list(zip(thisBrepFace, curves, tolerance))
response = Util.ComputeFetch(url, args)
response = Util.DecodeToCommonObject(response)
return response
Expand All @@ -109,7 +113,7 @@ def IsPointOnFace(thisBrepFace, u, v, multiple=False):
url = "rhino/geometry/brepface/ispointonface-brepface_double_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, u, v]
if multiple: args = zip(thisBrepFace, u, v)
if multiple: args = list(zip(thisBrepFace, u, v))
response = Util.ComputeFetch(url, args)
return response

Expand All @@ -129,7 +133,7 @@ def IsPointOnFace1(thisBrepFace, u, v, tolerance, multiple=False):
url = "rhino/geometry/brepface/ispointonface-brepface_double_double_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, u, v, tolerance]
if multiple: args = zip(thisBrepFace, u, v, tolerance)
if multiple: args = list(zip(thisBrepFace, u, v, tolerance))
response = Util.ComputeFetch(url, args)
return response

Expand All @@ -152,7 +156,7 @@ def TrimAwareIsoIntervals(thisBrepFace, direction, constantParameter, multiple=F
url = "rhino/geometry/brepface/trimawareisointervals-brepface_int_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, direction, constantParameter]
if multiple: args = zip(thisBrepFace, direction, constantParameter)
if multiple: args = list(zip(thisBrepFace, direction, constantParameter))
response = Util.ComputeFetch(url, args)
return response

Expand All @@ -173,7 +177,7 @@ def TrimAwareIsoCurve(thisBrepFace, direction, constantParameter, multiple=False
url = "rhino/geometry/brepface/trimawareisocurve-brepface_int_double"
if multiple: url += "?multiple=true"
args = [thisBrepFace, direction, constantParameter]
if multiple: args = zip(thisBrepFace, direction, constantParameter)
if multiple: args = list(zip(thisBrepFace, direction, constantParameter))
response = Util.ComputeFetch(url, args)
response = Util.DecodeToCommonObject(response)
return response
Expand All @@ -192,7 +196,7 @@ def ChangeSurface(thisBrepFace, surfaceIndex, multiple=False):
url = "rhino/geometry/brepface/changesurface-brepface_int"
if multiple: url += "?multiple=true"
args = [thisBrepFace, surfaceIndex]
if multiple: args = zip(thisBrepFace, surfaceIndex)
if multiple: args = list(zip(thisBrepFace, surfaceIndex))
response = Util.ComputeFetch(url, args)
return response

Expand All @@ -213,7 +217,7 @@ def RebuildEdges(thisBrepFace, tolerance, rebuildSharedEdges, rebuildVertices, m
url = "rhino/geometry/brepface/rebuildedges-brepface_double_bool_bool"
if multiple: url += "?multiple=true"
args = [thisBrepFace, tolerance, rebuildSharedEdges, rebuildVertices]
if multiple: args = zip(thisBrepFace, tolerance, rebuildSharedEdges, rebuildVertices)
if multiple: args = list(zip(thisBrepFace, tolerance, rebuildSharedEdges, rebuildVertices))
response = Util.ComputeFetch(url, args)
return response

0 comments on commit 0cf4d7b

Please sign in to comment.