Skip to content

Commit

Permalink
Merge pull request #737 from RubenRubens/fix_boolean_docs
Browse files Browse the repository at this point in the history
Improve docs of boolean operations
  • Loading branch information
jmwright authored Apr 21, 2021
2 parents 25c3009 + db998e4 commit c6c1956
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit c6c1956

Please sign in to comment.