From 74b4f0057d38ef6ec09d55054e0083c86e11f2b0 Mon Sep 17 00:00:00 2001 From: Jeremy Mack Wright Date: Mon, 12 Oct 2015 14:04:03 -0400 Subject: [PATCH] Fixed findSolid() so that it handles compounds properly. --- cadquery/CQ.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cadquery/CQ.py b/cadquery/CQ.py index 793d507..98b6529 100644 --- a/cadquery/CQ.py +++ b/cadquery/CQ.py @@ -441,8 +441,10 @@ def findSolid(self, searchStack=True, searchParents=True): if searchStack: for s in self.objects: - if type(s) == Solid: + if isinstance(s, Solid): return s + elif isinstance(s, Compound): + return s.Solids() if searchParents and self.parent is not None: return self.parent.findSolid(searchStack=True, searchParents=searchParents)