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

Improve docs of boolean operations #737

Merged
merged 1 commit into from
Apr 21, 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
9 changes: 5 additions & 4 deletions cadquery/cq.py
Original file line number Diff line number Diff line change
Expand Up @@ -3245,9 +3245,10 @@ def union(
def __or__(self: T, toUnion: Union["Workplane", Solid, Compound]) -> T:
"""
Syntactic sugar for union.
Notice that `r = a | b` is equivalent to `r = a.union(b)` and `r = a + b`.
Notice that :code:`r = a | b` is equivalent to :code:`r = a.union(b)` and :code:`r = a + b`.

Example::

Box = Workplane("XY").box(1, 1, 1, centered=(False, False, False))
Sphere = Workplane("XY").sphere(1)
result = Box | Sphere
Expand All @@ -3257,7 +3258,7 @@ def __or__(self: T, toUnion: Union["Workplane", Solid, Compound]) -> T:
def __add__(self: T, toUnion: Union["Workplane", Solid, Compound]) -> T:
"""
Syntactic sugar for union.
Notice that `r = a + b` is equivalent to `r = a.union(b)` and `r = a | b`.
Notice that :code:`r = a + b` is equivalent to :code:`r = a.union(b)` and :code:`r = a | b`.
"""
return self.union(toUnion)

Expand Down Expand Up @@ -3296,7 +3297,7 @@ def cut(
def __sub__(self: T, toUnion: Union["Workplane", Solid, Compound]) -> T:
"""
Syntactic sugar for cut.
Notice that `r = a - b` is equivalent to `r = a.cut(b)`.
Notice that :code:`r = a - b` is equivalent to :code:`r = a.cut(b)`.

Example::

Expand Down Expand Up @@ -3341,7 +3342,7 @@ def intersect(
def __and__(self: T, toUnion: Union["Workplane", Solid, Compound]) -> T:
"""
Syntactic sugar for intersect.
Notice that `r = a & b` is equivalent to `r = a.intersect(b)`.
Notice that :code:`r = a & b` is equivalent to :code:`r = a.intersect(b)`.

Example::

Expand Down