Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #286 from jduquennoy/master
Browse files Browse the repository at this point in the history
Added exemples of using fillet to reinforce junctions
  • Loading branch information
jmwright committed Jul 19, 2018
2 parents a6708f0 + fd27175 commit 6251ec0
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
30 changes: 29 additions & 1 deletion doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,35 @@ Here we fillet all of the edges of a simple plate.
* :py:meth:`Workplane.edges`
* :py:meth:`Workplane`

A reinforced junction between two pieces with Fillet
-----------------------------------------

The fillet can also be used to reinfoce a junction between two pieces.

.. cq_plot::

s = cq.Workplane("XY")

horizontalPart = s.box(10, 5, 1)
verticalPart = s.box(10, 1, 5).translate((0, 0, 1 + 5/2))

result = horizontalPart.union(verticalPart) \
.faces(">Z[1]").edges("not(<X or >X or <Y or >Y)").fillet(1)

show_object(result)

.. topic:: Api References

.. hlist::
:columns: 2

* :py:meth:`Workplane`
* :py:meth:`Workplane.box`
* :py:meth:`Workplane.faces`
* :py:meth:`Workplane.edges`
* :ref:`selector_reference`
* :py:meth:`Workplane.fillet`

A Parametric Bearing Pillow Block
------------------------------------

Expand All @@ -621,7 +650,6 @@ with just a few lines of code.

show_object(result)


Splitting an Object
---------------------

Expand Down
29 changes: 29 additions & 0 deletions examples/FreeCAD/Ex035_Reinforce_Junction_UsingFillet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import cadquery as cq
from cadquery import selectors

# This exemple demonstrates the use of a fillet to reinforce a junction between two parts.
# It relies on the selection of an edge of the weak junction, and the use of fillet.

# 1 - The construction of the model : a pipe connector
# In that model, the junction surface between the box and the cylinder is small.
# This makes the junction between the two too weak.
model = cq.Workplane("XY").box(15.0, 15.0, 2.0)\
.faces(">Z").rect(10.0, 10.0, forConstruction=True)\
.vertices().cskHole(2.0, 4.0, 82)\
.faces(">Z").circle(4.0).extrude(10.0)\
.faces(">Z").hole(6)

# 2 - Reinforcement of the junction
# Two steps here :
# - select the edge to reinforce. Here we search the closest edge from the center on the top face of the box.
# - apply a fillet or a chamfer to that edge
result = model.faces('<Z[1]').edges(selectors.NearestToPointSelector((0.0, 0.0))).fillet(1)

# Additional note :
# Using a type selector to select circles on the face would have returned all the circles, including the one to reinforce,
# but also the ones for the countersunk holes.
# The order of the edges returned by the selector is not guaranteed, so selecting the circle in the stack would not be reliable.
# If there was only one circle on the face, then this would have worked perfectly :
# result = model.faces('<Z[1]').edges('%Circle').fillet(1)

show_object(result)

0 comments on commit 6251ec0

Please sign in to comment.