From 344c5afa56ec3e93d53121c9d9944d13923a5e2e Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 15 Oct 2024 12:58:51 -0500 Subject: [PATCH 1/8] tea_cup.py -> find_intersection to find_intersection_points --- examples/tea_cup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tea_cup.py b/examples/tea_cup.py index 1a6a08fc..833ec5df 100644 --- a/examples/tea_cup.py +++ b/examples/tea_cup.py @@ -69,7 +69,7 @@ # Determine where the handle contacts the bowl handle_intersections = [ - tea_cup.part.find_intersection( + tea_cup.part.find_intersection_points( Axis(origin=(0, 0, vertical_offset), direction=(1, 0, 0)) )[-1][0] for vertical_offset in [35 * MM, 80 * MM] From dd84840e8db3913b553d16e4598483470a8cdf2f Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 15 Oct 2024 12:59:23 -0500 Subject: [PATCH 2/8] tea_cup_algebra.py -> find_intersection to find_intersection_points --- examples/tea_cup_algebra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tea_cup_algebra.py b/examples/tea_cup_algebra.py index 5a085cea..87e1c823 100644 --- a/examples/tea_cup_algebra.py +++ b/examples/tea_cup_algebra.py @@ -33,7 +33,7 @@ # Determine where the handle contacts the bowl handle_intersections = [ - tea_cup.find_intersection( + tea_cup.find_intersection_points( Axis(origin=(0, 0, vertical_offset), direction=(1, 0, 0)) )[-1][0] for vertical_offset in [35 * MM, 80 * MM] From c82c0f4a2cff3b48ed7439304a40c66ccae9c41b Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Wed, 16 Oct 2024 08:52:04 -0500 Subject: [PATCH 3/8] introductory_examples.rst -> fix code escape for show_all --- docs/introductory_examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/introductory_examples.rst b/docs/introductory_examples.rst index 6632a9f0..1399a800 100644 --- a/docs/introductory_examples.rst +++ b/docs/introductory_examples.rst @@ -13,7 +13,7 @@ They are organized from simple to complex, so working through them in order is t 1. ``from build123d import *`` 2. If you are using build123d *builder mode* or *algebra mode*, - - in *ocp_vscode* simply use e.g. ``show(ex15)`` to the end of your design to view parts, sketches and curves. `show_all()` can be used to automatically show all objects with their variable names as labels. + - in *ocp_vscode* simply use e.g. ``show(ex15)`` to the end of your design to view parts, sketches and curves. ``show_all()`` can be used to automatically show all objects with their variable names as labels. - in *CQ-editor* add e.g. ``show_object(ex15.part)``, ``show_object(ex15.sketch)`` or ``show_object(ex15.line)`` to the end of your design to view parts, sketches or lines. 3. If you want to save your resulting object as an STL from *builder mode*, you can use e.g. ``export_stl(ex15.part, "file.stl")``. From 8064bf73425d417b34f81557b7d19f1abbc2de0a Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 22 Oct 2024 15:27:38 -0500 Subject: [PATCH 4/8] handle.py -> use `location_at` (`^`) instead of manual Plane construction with position/tangent --- examples/handle.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/examples/handle.py b/examples/handle.py index c46833b6..1c37d499 100644 --- a/examples/handle.py +++ b/examples/handle.py @@ -42,17 +42,10 @@ tangents=((0, 0, 1), (0, 0, -1)), tangent_scalars=(1.5, 1.5), ) - # Record the center line for display and workplane creation - handle_path: Wire = handle_center_line.wires()[0] # Create the cross sections - added to pending_faces for i in range(segment_count + 1): - with BuildSketch( - Plane( - origin=handle_path @ (i / segment_count), - z_dir=handle_path % (i / segment_count), - ) - ) as section: + with BuildSketch(handle_center_line.line ^ (i / segment_count)) as section: if i % segment_count == 0: Circle(1) else: @@ -66,8 +59,8 @@ assert abs(handle.part.volume - 94.77361455046953) < 1e-3 -show_object(handle_path.wrapped, name="handle_path") +show_object(handle_center_line.line, name="handle_center_line") for i, section in enumerate(sections): - show_object(section.wrapped, name="section" + str(i)) -show_object(handle.part.wrapped, name="handle", options=dict(alpha=0.6)) + show_object(section, name="section" + str(i)) +show_object(handle.part, name="handle", options=dict(alpha=0.6)) # [End] From 214c0d8af03aca0934a9c9ee48ad8870a4dcd1ad Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 22 Oct 2024 15:31:36 -0500 Subject: [PATCH 5/8] handle_algebra.py -> update to use `location_at` (`^`) too --- examples/handle_algebra.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/examples/handle_algebra.py b/examples/handle_algebra.py index ad9ec7c4..20e8c09d 100644 --- a/examples/handle_algebra.py +++ b/examples/handle_algebra.py @@ -13,30 +13,23 @@ tangents=((0, 0, 1), (0, 0, -1)), tangent_scalars=(1.5, 1.5), ) -# Record the center line for display and workplane creation -handle_path = handle_center_line.edges()[0] - # Create the cross sections - added to pending_faces - sections = Sketch() for i in range(segment_count + 1): - plane = Plane( - origin=handle_path @ (i / segment_count), - z_dir=handle_path % (i / segment_count), - ) + location = handle_center_line ^ (i / segment_count) if i % segment_count == 0: - circle = plane * Circle(1) + circle = location * Circle(1) else: - circle = plane * Rectangle(1.25, 3) + circle = location * Rectangle(1.25, 3) circle = fillet(circle.vertices(), radius=0.2) sections += circle # Create the handle by sweeping along the path -handle = sweep(sections, path=handle_path, multisection=True) +handle = sweep(sections, path=handle_center_line, multisection=True) -show_object(handle_path.wrapped, name="handle_path") +show_object(handle_center_line, name="handle_path") for i, circle in enumerate(sections): - show_object(circle.wrapped, name="section" + str(i)) + show_object(circle, name="section" + str(i)) show_object(handle, name="handle", options=dict(alpha=0.6)) # [End] From 7d197232a75db8875b726ce0cb0740b0d6b94f23 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 22 Oct 2024 16:14:35 -0500 Subject: [PATCH 6/8] tea_cup.py -> update to use `location_at` (`^`) --- examples/tea_cup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/tea_cup.py b/examples/tea_cup.py index 833ec5df..866ee1fa 100644 --- a/examples/tea_cup.py +++ b/examples/tea_cup.py @@ -76,7 +76,7 @@ ] # Create a path for handle creation with BuildLine(Plane.XZ) as handle_path: - path_spline = Spline( + Spline( handle_intersections[0] - (wall_thickness / 2, 0), handle_intersections[0] + (35 * MM, 30 * MM), handle_intersections[0] + (40 * MM, 60 * MM), @@ -84,9 +84,7 @@ tangents=((1, 1.25), (-0.2, -1)), ) # Align the cross section to the beginning of the path - with BuildSketch( - Plane(origin=path_spline @ 0, z_dir=path_spline % 0) - ) as handle_cross_section: + with BuildSketch(handle_path.line ^ 0) as handle_cross_section: RectangleRounded(wall_thickness, 8 * MM, fillet_radius) sweep() # Sweep handle cross section along path From 73b111132048558e513bde60d689fa38e64f949a Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 22 Oct 2024 16:16:34 -0500 Subject: [PATCH 7/8] tea_cup_algebra.py -> update to use `location_at` (`^`) too --- examples/tea_cup_algebra.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tea_cup_algebra.py b/examples/tea_cup_algebra.py index 87e1c823..c622adfe 100644 --- a/examples/tea_cup_algebra.py +++ b/examples/tea_cup_algebra.py @@ -49,8 +49,8 @@ ) # Align the cross section to the beginning of the path -plane = Plane(origin=path_spline @ 0, z_dir=path_spline % 0) -handle_cross_section = plane * RectangleRounded(wall_thickness, 8 * MM, fillet_radius) +location = path_spline ^ 0 +handle_cross_section = location * RectangleRounded(wall_thickness, 8 * MM, fillet_radius) # Sweep handle cross section along path tea_cup += sweep(handle_cross_section, path=path_spline) From fdd4dc610b3bb121f656b79fce438db322291aa1 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Tue, 22 Oct 2024 23:02:07 -0500 Subject: [PATCH 8/8] external.rst -> add missing space to video link --- docs/external.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/external.rst b/docs/external.rst index dd5e851b..94fd4d9c 100644 --- a/docs/external.rst +++ b/docs/external.rst @@ -22,7 +22,7 @@ See: `ocp-vscode `_ Watch Jern create three build123d designs in realtime with Visual Studio Code and the ocp-vscode viewer extension in a timed event from the TooTallToby 2024 Spring Open Tournament: -`build123d entry video`_ +`build123d entry video `_ cq-editor fork =========