Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix split docs #574

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions cadquery/cq.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,22 @@ def _collectProperty(self, propName: str) -> List[CQObject]:

def split(self, keepTop: bool = False, keepBottom: bool = False) -> "Workplane":
"""
Splits a solid on the stack into two parts, optionally keeping the separate parts.

:param boolean keepTop: True to keep the top, False or None to discard it
:param boolean keepBottom: True to keep the bottom, False or None to discard it
:raises: ValueError if keepTop and keepBottom are both false.
:raises: ValueError if there is not a solid in the current stack or the parent chain
:returns: CQ object with the desired objects on the stack.

The most common operation splits a solid and keeps one half. This sample creates
split bushing::

#drill a hole in the side
c = Workplane().box(1,1,1).faces(">Z").workplane().circle(0.25).cutThruAll()F
#now cut it in half sideways
c.faces(">Y").workplane(-0.5).split(keepTop=True)
Splits a solid on the stack into two parts, optionally keeping the separate parts.

:param boolean keepTop: True to keep the top, False or None to discard it
:param boolean keepBottom: True to keep the bottom, False or None to discard it
:raises: ValueError if keepTop and keepBottom are both false.
:raises: ValueError if there is not a solid in the current stack or the parent chain
:returns: CQ object with the desired objects on the stack.

The most common operation splits a solid and keeps one half. This sample creates
split bushing::

# drill a hole in the side
c = Workplane().box(1,1,1).faces(">Z").workplane().circle(0.25).cutThruAll()

# now cut it in half sideways
c = c.faces(">Y").workplane(-0.5).split(keepTop=True)
"""

solid = self.findSolid()
Expand Down