From 5609e4c460a97762338dae14c2f1dbd0b56e057c Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 10 Apr 2020 23:32:52 -0400 Subject: [PATCH 01/11] Rough cut of making largestDimension work as expected --- cadquery/cq.py | 48 +++++++++++++++++++++++++++++++++++++----- tests/test_cadquery.py | 7 +++++- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index d788d678..5f0992de 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -2279,13 +2279,51 @@ class Workplane(CQ): how long or wide a feature must be to make sure to cut through all of the material :return: A value representing the largest dimension of the first solid on the stack """ + xmin = ymin = zmin = 999999 + xmax = ymax = zmax = -999999 + + # Get all the solids contained within this CQ object + solids = self.solids().vals() + + # Protect against this being called on something like a blank workplane + if len(solids) == 0: return -1 + + # Find the combined outer bounds of all the solids + for solid in solids: + # Mins + if solid.BoundingBox().xmin < xmin: + xmin = solid.BoundingBox().xmin + if solid.BoundingBox().ymin < ymin: + ymin = solid.BoundingBox().ymin + if solid.BoundingBox().zmin < zmin: + zmin = solid.BoundingBox().zmin + + # Maxes + if solid.BoundingBox().xmax > xmax: + xmax = solid.BoundingBox().xmax + if solid.BoundingBox().ymax > ymax: + ymax = solid.BoundingBox().ymax + if solid.BoundingBox().zmax > zmax: + zmax = solid.BoundingBox().zmax + + xLength = (xmax - xmin) + yLength = (ymax - ymin) + zLength = (zmax - zmin) + + centroid = Vector(xLength, yLength, zLength) + + # Calculate the sphere size of the outer bounds of all solids + sphereSize = centroid.Length + + return sphereSize + # TODO: this implementation is naive and returns the dims of the first solid... most of # TODO: the time this works. but a stronger implementation would be to search all solids. - s = self.findSolid() - if s: - return s.BoundingBox().DiagonalLength * 5.0 - else: - return -1 + # s = self.findSolid() + # if s: + # return s.BoundingBox().DiagonalLength * 5.0 + # else: + # return -1 def cutEach(self, fcn, useLocalCoords=False, clean=True): """ diff --git a/tests/test_cadquery.py b/tests/test_cadquery.py index b3ee1f88..751c6abb 100644 --- a/tests/test_cadquery.py +++ b/tests/test_cadquery.py @@ -1503,7 +1503,12 @@ class TestCadQuery(BaseTest): r = Workplane("XY").box(1, 1, 1) dim = r.largestDimension() - self.assertAlmostEqual(8.7, dim, 1) + self.assertAlmostEqual(1.76, dim, 1) + + r = Workplane("XY").rect(1, 1).extrude(1) + dim = r.largestDimension() + + self.assertAlmostEqual(1.76, dim, 1) r = Workplane("XY") dim = r.largestDimension() From ccf4ee20c661dc5311e86e3a1891a7aec172e035 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 14 Apr 2020 21:01:13 -0400 Subject: [PATCH 02/11] Reworked the largestDimension logic based on bounding box extents. The value returned now errs on the side of being very slightly larger, which is probably good considering this method's main use it to find the distance for thru cuts. --- cadquery/cq.py | 43 ++++++++++--------------------------- cadquery/occ_impl/shapes.py | 2 +- tests/test_cadquery.py | 1 - 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 5f0992de..3be8cd1e 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -2279,52 +2279,31 @@ class Workplane(CQ): how long or wide a feature must be to make sure to cut through all of the material :return: A value representing the largest dimension of the first solid on the stack """ - xmin = ymin = zmin = 999999 - xmax = ymax = zmax = -999999 - # Get all the solids contained within this CQ object - solids = self.solids().vals() + compound = self.findSolid() # Protect against this being called on something like a blank workplane - if len(solids) == 0: return -1 + if not compound: return -1 - # Find the combined outer bounds of all the solids - for solid in solids: - # Mins - if solid.BoundingBox().xmin < xmin: - xmin = solid.BoundingBox().xmin - if solid.BoundingBox().ymin < ymin: - ymin = solid.BoundingBox().ymin - if solid.BoundingBox().zmin < zmin: - zmin = solid.BoundingBox().zmin - - # Maxes - if solid.BoundingBox().xmax > xmax: - xmax = solid.BoundingBox().xmax - if solid.BoundingBox().ymax > ymax: - ymax = solid.BoundingBox().ymax - if solid.BoundingBox().zmax > zmax: - zmax = solid.BoundingBox().zmax + # Get the extents of the bounding box of the solids + xmin = compound.BoundingBox().xmin + ymin = compound.BoundingBox().ymin + zmin = compound.BoundingBox().zmin + xmax = compound.BoundingBox().xmax + ymax = compound.BoundingBox().ymax + zmax = compound.BoundingBox().zmax + # Find the length of each axis xLength = (xmax - xmin) yLength = (ymax - ymin) zLength = (zmax - zmin) + # Calculate the sphere size of the outer bounds of all solids from the lengths along each axis centroid = Vector(xLength, yLength, zLength) - - # Calculate the sphere size of the outer bounds of all solids sphereSize = centroid.Length return sphereSize - # TODO: this implementation is naive and returns the dims of the first solid... most of - # TODO: the time this works. but a stronger implementation would be to search all solids. - # s = self.findSolid() - # if s: - # return s.BoundingBox().DiagonalLength * 5.0 - # else: - # return -1 - def cutEach(self, fcn, useLocalCoords=False, clean=True): """ Evaluates the provided function at each point on the stack (ie, eachpoint) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 5484263f..67c8f3a9 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -254,7 +254,7 @@ class Shape(object): @classmethod def cast(cls, obj, forConstruction=False): - "Returns the right type of wrapper, given a FreeCAD object" + "Returns the right type of wrapper, given a OCCT object" tr = None diff --git a/tests/test_cadquery.py b/tests/test_cadquery.py index 751c6abb..5c117172 100644 --- a/tests/test_cadquery.py +++ b/tests/test_cadquery.py @@ -1733,7 +1733,6 @@ class TestCadQuery(BaseTest): # Tests the case where the depth of the cboreHole is not specified c2 = CQ(makeCube(3.0)) - pnts = [(-1.0, -1.0), (0.0, 0.0), (1.0, 1.0)] c2 = c2.faces(">Z").workplane().pushPoints(pnts).cboreHole(0.1, 0.25, 0.25) self.assertEqual(15, c2.faces().size()) From 974e4fb7b27e1ba95e66a8877fa5f7700f98e324 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Tue, 14 Apr 2020 21:13:48 -0400 Subject: [PATCH 03/11] Trying to get black format checker to pass --- cadquery/cq.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 3be8cd1e..7f518df6 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -2283,7 +2283,8 @@ class Workplane(CQ): compound = self.findSolid() # Protect against this being called on something like a blank workplane - if not compound: return -1 + if not compound: + return -1 # Get the extents of the bounding box of the solids xmin = compound.BoundingBox().xmin @@ -2294,9 +2295,9 @@ class Workplane(CQ): zmax = compound.BoundingBox().zmax # Find the length of each axis - xLength = (xmax - xmin) - yLength = (ymax - ymin) - zLength = (zmax - zmin) + xLength = xmax - xmin + yLength = ymax - ymin + zLength = zmax - zmin # Calculate the sphere size of the outer bounds of all solids from the lengths along each axis centroid = Vector(xLength, yLength, zLength) From 7876fd0cc7ec9fc4e9e9e3743699f17523c3f8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Urba=C5=84czyk?= Date: Thu, 16 Apr 2020 18:14:57 +0200 Subject: [PATCH 04/11] Extrude with both=True fix (#321) Extrude with both=True will result in a single solid. * combineWithBase fix * Allow to self-fuse a compound * Formatting fix * Test if extrude with both=True fuses the solids --- cadquery/cq.py | 2 ++ cadquery/occ_impl/shapes.py | 7 ++++++- tests/test_cadquery.py | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index d788d678..799f8c2f 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -2675,6 +2675,8 @@ class Workplane(CQ): r = obj if baseSolid is not None: r = baseSolid.fuse(obj) + elif isinstance(obj, Compound): + r = obj.fuse() return self.newObject([r]) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 5484263f..a1e48690 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -1997,7 +1997,12 @@ class Compound(Shape, Mixin3D): fuse_op = BRepAlgoAPI_Fuse() # fuse_op.SetFuzzyValue(TOLERANCE) - rv = self._bool_op(self, toFuse, fuse_op) + args = tuple(self) + toFuse + + if len(args) <= 1: + rv = self + else: + rv = self._bool_op(args[:1], args[1:], fuse_op) # fuse_op.RefineEdges() # fuse_op.FuseEdges() diff --git a/tests/test_cadquery.py b/tests/test_cadquery.py index b3ee1f88..c031df36 100644 --- a/tests/test_cadquery.py +++ b/tests/test_cadquery.py @@ -2548,6 +2548,8 @@ class TestCadQuery(BaseTest): # extrude symmetrically s = Workplane("XY").circle(r).extrude(h, both=True) + self.assertTrue(len(s.val().Solids()) == 1) + top_face = s.faces(">Z") bottom_face = s.faces(" Date: Thu, 16 Apr 2020 17:55:33 -0400 Subject: [PATCH 05/11] Fixed version number that was missed during RC2 release. --- cadquery/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadquery/__init__.py b/cadquery/__init__.py index c789890a..62ac5df4 100644 --- a/cadquery/__init__.py +++ b/cadquery/__init__.py @@ -62,4 +62,4 @@ __all__ = [ "plugins", ] -__version__ = "2.0RC1" +__version__ = "2.0RC2" From d1ed30ba8f0a1b14a18dd92360eeddf8443713e3 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 17 Apr 2020 22:53:50 -0400 Subject: [PATCH 06/11] Prepare for the 2.0 release --- cadquery/__init__.py | 2 +- changes.md | 131 ++++++++++++++----------------------------- setup.py | 2 +- 3 files changed, 44 insertions(+), 91 deletions(-) diff --git a/cadquery/__init__.py b/cadquery/__init__.py index 62ac5df4..6ac5ef35 100644 --- a/cadquery/__init__.py +++ b/cadquery/__init__.py @@ -62,4 +62,4 @@ __all__ = [ "plugins", ] -__version__ = "2.0RC2" +__version__ = "2.0" diff --git a/changes.md b/changes.md index 24d08ab6..958d4e7b 100644 --- a/changes.md +++ b/changes.md @@ -1,100 +1,53 @@ Changes ======= - -v0.1 ------ - * Initial Version - -v0.1.6 ------ - * Added STEP import and supporting tests - -v0.1.7 ------ - * Added revolve operation and supporting tests - * Fixed minor documentation errors - -v0.1.8 ------ - * Added toFreecad() function as a convenience for val().wrapped - * Converted all examples to use toFreecad() - * Updated all version numbers that were missed before - * Fixed import issues in Windows caused by fc_import - * Added/fixed Mac OS support - * Improved STEP import - * Fixed bug in rotateAboutCenter that negated its effect on solids - * Added Travis config (thanks @krasin) - * Removed redundant workplane.py file left over from the PParts.com migration - * Fixed toWorldCoordinates bug in moveTo (thanks @xix-xeaon) - * Added new tests for 2D drawing functions - * Integrated Coveralls.io, with a badge in README.md - * Integrated version badge in README.md - -v0.2.0 ------ - * Fixed versioning to match the semantic versioning scheme - * Added license badge in changes.md - * Fixed Solid.makeSphere implementation - * Added CQ.sphere operation that mirrors CQ.box - * Updated copyright dates - * Cleaned up spelling and misc errors in docstrings - * Fixed FreeCAD import error on Arch Linux (thanks @moeb) - * Made FreeCAD import report import error instead of silently failing (thanks @moeb) - * Added ruled option for the loft operation (thanks @hyOzd) - * Fixed close() not working in planes other than XY (thanks @hyOzd) - * Added box selector with bounding box option (thanks @hyOzd) - * CQ.translate and CQ.rotate documentation fixes (thanks @hyOzd) - * Fixed centering of a sphere - * Increased test coverage - * Added a clean function to keep some operations from failing on solids that need simplified (thanks @hyOzd) - * Added a mention of the new Google Group to the readme - -v0.3.0 ------ - * Fixed a bug where clean() could not be called on appropriate objects other than solids (thanks @hyOzd) #108 - * Implemented new selectors that allow existing selectors to be combined with arithmetic/boolean operations (thanks @hyOzd) #110 - * Fixed a bug where only 1 random edge was returned with multiple min/max selector matches (thanks @hyOzd) #111 - * Implemented the creation of a workplane from multiple co-planar faces (thanks @hyOzd) #113 - * Fixed the operation of Center() when called on a compound with multiple solids - * Add the named planes ZX YX ZY to define different normals (thanks @galou) #115 - * Code cleanup in accordance with PEP 8 (thanks @galou) - * Fixed a bug with the close function not resetting the first point of the context correctly (thanks @huskier) - * Fixed the findSolid function so that it handles compounds #107 - * Changed the polyline function so that it adds edges to the stack instead of a wire #102 - * Add the ability to find the center of the bounding box, rather than the center of mass (thanks @huskier) #122 - * Changed normalize function to normalized to match OCC/PythonOCC nomenclature #124 - * Added a label attribute to all freecad_impl.shapes so that they can have IDs attached to them #124 - -v0.4.0 +2.0 (stable release) ------ - * Added Documentation, which is available on dcowden.github.io/cadquery - * Added CQGI, an adapter API that standardizes use of cadquery from within structured execution environments - * Added ability to import STEP files from a web URL (thanks @huskier ) #128 + * Numerous commits to move from FreeCAD as the underlying API to PythonOCC - thanks @adam-urbanczyk for all the effort that required + * Updated for Python 3.6 and 3.7 + * Made sure solids were fused when extrude both=True #321 - thanks @adam-urbanczyk + * Improved boolean operations #312 - thanks @adam-urbanczyk + * Fixed a bug in helix creation #311 - thanks @adam-urbanczyk + * Improved MacOS support + * Updated CQGI counters for Python 3.8 compatibility #305 - thanks @jwhevans + * Added tangent arc operation #284 - thanks @marcus7070 + * Added ellipse creation #265 - thanks @bernhard-42 + * Added ability to produce a plate surface with a thickness (optional), enclosed by edge points, polylines or splines, and going through interpolation points (optional) #253 - thanks @bragostin + * Fix plane rotation method #243 - thanks @Peque + * Added ability to tag a particular object in the chain to be referred to later #252 - thanks @marcus7070 + * Added Black formatting check to CI #255 - thanks @Peque + * Added ability to accept unordered edges when constructing a wire #237 - thanks @bragostin + * Updated to using pytest #236 - thanks @Peque + * Fixed wedge primitive and made wedge act consistent with other primitives #228 + * Fix to correctly support anisotropic scaling #225 - thanks @adam-urbanczyk + * Documentation fixes #215 - thanks @Renha + * Fixed a spline example in the docs #200 - thanks @adam-urbanczyk + * Added 2D slot feature #186 - thanks @bweissinger + * Fixed a segmentation fault when trying to loft with one wire #161 - thanks @HLevering + * Fixed a bug where the tolerance parameter of BoundingBox had no effect #167 - thanks @mgreminger + * Fixed a bug when calling findSolid with multiple solids on stack #163 - thanks @adam-urbanczyk + * Documentation fixes #144 and #162 - thanks @westurner + * Fixed a feature/bug that prevented a polyline or spline from closing properly in some instances #156 - thanks @adam-urbanczyk + * Added ability to determine if an arbitrary point is inside a solid #138 - thanks @mgreminger + * Fixed bug where combine=True kept union from working properly #143 - thanks @adam-urbanczyk + * Fixed bug where string selectors "-X" and "+X" returned the same thing #141 - thanks @gebner + * Removed unused 'positive' argument from 'cutThruAll' #135 - thanks @mgreminger + * Increased the HASH_CODE_MAX to prevent hash collisions during face selection #140 - - thanks @mgreminger + * Added option to center workplane on projected origin #132 - thanks @mgreminger + * Improved sweep along multisection wires #128 - thanks @adam-urbanczyk + * Fixed version number that was missed during update to 2.x #129 - thanks @asukiaaa + * Numerous CI and documentation improvements -v0.4.1 +2.0RC2 (release candidate) ------ - * Minor CQGI updates + * Changes included in v2.0 release -v0.5.0-stable +2.0RC1 (release candidate) ------ - * Configuring Travis to push to PyPI on version releases. + * Changes included in v2.0 release -v0.5.1 +2.0RC0 (release candidate) ------ - * Mirroring fixes (thanks @huskier) - * Added a mirroring example (thanks @huskier) + * Changes included in v2.0 release -v0.5.2 ------- - * Added the sweep operation #33 - -v1.0.0 ------- - * Added an option to do symmetric extrusion about the workplane (thanks @adam-urbanczyk) - * Extended selector syntax to include Nth selector and re-implemented selectors using pyparsing (thanks @adam-urbanczyk) - * Added logical operations to string selectors (thanks @adam-urbanczyk) - * Cleanup of README.md and changes.md (thanks @baoboa) - * Fixed bugs with toVector and Face 'Not Defined' errors (thanks @huskier) - * Refactor of the initialization code for PEP8 compliance and Python 3 compatibility (thanks @Peque) - * Making sure that the new pyparsing library dependency is handled properly (thanks @Peque) +The changelog for older CadQuery 1.x releases can be found [here](https://github.com/dcowden/cadquery/blob/master/changes.md). \ No newline at end of file diff --git a/setup.py b/setup.py index 48f712e4..09a5b77d 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ from setuptools import setup # if we are building in travis, use the build number as the sub-minor version -version = "0.5-SNAPSHOT" +version = "2.0" if "TRAVIS_TAG" in os.environ.keys(): version = os.environ["TRAVIS_TAG"] From ded2bdce96536bdef939bacbc201e51ffd7214ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Urba=C5=84czyk?= Date: Thu, 23 Apr 2020 08:52:07 +0200 Subject: [PATCH 07/11] Add reference to #106 --- changes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changes.md b/changes.md index 958d4e7b..0e59c901 100644 --- a/changes.md +++ b/changes.md @@ -37,6 +37,7 @@ Changes * Improved sweep along multisection wires #128 - thanks @adam-urbanczyk * Fixed version number that was missed during update to 2.x #129 - thanks @asukiaaa * Numerous CI and documentation improvements + * Support for text rendering #106 2.0RC2 (release candidate) ------ @@ -50,4 +51,4 @@ Changes ------ * Changes included in v2.0 release -The changelog for older CadQuery 1.x releases can be found [here](https://github.com/dcowden/cadquery/blob/master/changes.md). \ No newline at end of file +The changelog for older CadQuery 1.x releases can be found [here](https://github.com/dcowden/cadquery/blob/master/changes.md). From 8d5dd8b456413218bf7b9dab7119166c0fbdcac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Urba=C5=84czyk?= Date: Thu, 23 Apr 2020 08:53:41 +0200 Subject: [PATCH 08/11] Typo fix --- changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes.md b/changes.md index 0e59c901..27ae97d0 100644 --- a/changes.md +++ b/changes.md @@ -32,7 +32,7 @@ Changes * Fixed bug where combine=True kept union from working properly #143 - thanks @adam-urbanczyk * Fixed bug where string selectors "-X" and "+X" returned the same thing #141 - thanks @gebner * Removed unused 'positive' argument from 'cutThruAll' #135 - thanks @mgreminger - * Increased the HASH_CODE_MAX to prevent hash collisions during face selection #140 - - thanks @mgreminger + * Increased the HASH_CODE_MAX to prevent hash collisions during face selection #140 - thanks @mgreminger * Added option to center workplane on projected origin #132 - thanks @mgreminger * Improved sweep along multisection wires #128 - thanks @adam-urbanczyk * Fixed version number that was missed during update to 2.x #129 - thanks @asukiaaa From aa1abf8a95c13b1489fa9e7c2f3c7c4eaef5d3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Urba=C5=84czyk?= Date: Thu, 23 Apr 2020 09:00:34 +0200 Subject: [PATCH 09/11] Added info about breaking changes --- changes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changes.md b/changes.md index 27ae97d0..396d1273 100644 --- a/changes.md +++ b/changes.md @@ -3,6 +3,12 @@ Changes 2.0 (stable release) ------ + +### Deprecations and breaking changes + * `centerOption` default value will change from `CenterOfMass` to `ProjectedOirigin` in the 2.1 release #313 + +### Non-breaking changes + * Numerous commits to move from FreeCAD as the underlying API to PythonOCC - thanks @adam-urbanczyk for all the effort that required * Updated for Python 3.6 and 3.7 * Made sure solids were fused when extrude both=True #321 - thanks @adam-urbanczyk From 6a5dd93db81d905b60491079bc831ec75378301d Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 23 Apr 2020 17:20:22 -0400 Subject: [PATCH 10/11] Fixed a typo --- changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes.md b/changes.md index 396d1273..39c9d5b6 100644 --- a/changes.md +++ b/changes.md @@ -5,7 +5,7 @@ Changes ------ ### Deprecations and breaking changes - * `centerOption` default value will change from `CenterOfMass` to `ProjectedOirigin` in the 2.1 release #313 + * `centerOption` default value will change from `CenterOfMass` to `ProjectedOrigin` in the 2.1 release #313 ### Non-breaking changes From 71196ba4cd4b4515df12292895ca0e7410558df4 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 27 Apr 2020 16:47:55 -0400 Subject: [PATCH 11/11] Reduced the code to checking the diagonal length of the BBox --- cadquery/cq.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 7f518df6..07f2ac05 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -2286,24 +2286,7 @@ class Workplane(CQ): if not compound: return -1 - # Get the extents of the bounding box of the solids - xmin = compound.BoundingBox().xmin - ymin = compound.BoundingBox().ymin - zmin = compound.BoundingBox().zmin - xmax = compound.BoundingBox().xmax - ymax = compound.BoundingBox().ymax - zmax = compound.BoundingBox().zmax - - # Find the length of each axis - xLength = xmax - xmin - yLength = ymax - ymin - zLength = zmax - zmin - - # Calculate the sphere size of the outer bounds of all solids from the lengths along each axis - centroid = Vector(xLength, yLength, zLength) - sphereSize = centroid.Length - - return sphereSize + return compound.BoundingBox().DiagonalLength def cutEach(self, fcn, useLocalCoords=False, clean=True): """