Create a child workplane on a vertex (#480)
* add parent face detection to workplane() * Update cq.py * add nonetype check and tests * fixed test formatting * mypy fix attempt Co-authored-by: Adam Urbańczyk <adam-urbanczyk@users.noreply.github.com>
This commit is contained in:
@ -543,8 +543,14 @@ class Workplane(object):
|
||||
if isinstance(obj, Shape)
|
||||
else obj.Center()
|
||||
)
|
||||
normal = self.plane.zDir
|
||||
xDir = self.plane.xDir
|
||||
|
||||
val = self.parent.val() if self.parent else None
|
||||
if isinstance(val, Face):
|
||||
normal = val.normalAt(center)
|
||||
xDir = _computeXdir(normal)
|
||||
else:
|
||||
normal = self.plane.zDir
|
||||
xDir = self.plane.xDir
|
||||
else:
|
||||
raise ValueError("Needs a face or a vertex or point on a work plane")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user