From 2c652ff978adf8c4309f819741825c70896aaccc Mon Sep 17 00:00:00 2001 From: Bernhard Date: Tue, 21 Mar 2023 20:36:39 +0100 Subject: [PATCH] removed alg123d --- examples/boxes_on_faces_algebra.py | 3 ++- examples/build123d_customizable_logo_algebra.py | 1 - examples/circuit_board_algebra.py | 1 - examples/din_rail_algebra.py | 1 - examples/handle_algebra.py | 1 - examples/intersecting_pipes_algebra.py | 4 +--- examples/lego_algebra.py | 5 ++--- examples/loft_algebra.py | 5 ++--- examples/pillow_block_algebra.py | 9 ++++----- examples/roller_coaster_algebra.py | 3 +-- examples/vase_algebra.py | 15 +++++++-------- 11 files changed, 19 insertions(+), 29 deletions(-) diff --git a/examples/boxes_on_faces_algebra.py b/examples/boxes_on_faces_algebra.py index ada9010..8cab0aa 100644 --- a/examples/boxes_on_faces_algebra.py +++ b/examples/boxes_on_faces_algebra.py @@ -1,5 +1,6 @@ from build123d import * -from build123d.part_operations import * + +# from build123d.part_operations import * b = Box(3, 3, 3) b2 = Rot(0, 0, 45) * extrude(Rectangle(1, 2), 0.2) diff --git a/examples/build123d_customizable_logo_algebra.py b/examples/build123d_customizable_logo_algebra.py index 17fd823..4df8e60 100644 --- a/examples/build123d_customizable_logo_algebra.py +++ b/examples/build123d_customizable_logo_algebra.py @@ -1,5 +1,4 @@ from build123d import * -from build123d.part_operations import * import build123d.alg_compat as COMPAT logo_text = Text("123d", font_size=10, align=(Align.MIN, Align.MIN)) diff --git a/examples/circuit_board_algebra.py b/examples/circuit_board_algebra.py index b1ff49c..994f72b 100644 --- a/examples/circuit_board_algebra.py +++ b/examples/circuit_board_algebra.py @@ -1,6 +1,5 @@ from itertools import product from build123d import * -from build123d.part_operations import * x_coords = product(range(65 // 5), (-15, -10, 10, 15)) y_coords = product((30, 35), range(30 // 5 - 1)) diff --git a/examples/din_rail_algebra.py b/examples/din_rail_algebra.py index 3a309f8..989ab57 100644 --- a/examples/din_rail_algebra.py +++ b/examples/din_rail_algebra.py @@ -1,5 +1,4 @@ from build123d import * -from build123d.part_operations import * import build123d.alg_compat as COMPAT # 35x7.5mm DIN Rail Dimensions diff --git a/examples/handle_algebra.py b/examples/handle_algebra.py index e2e9868..4333c5c 100644 --- a/examples/handle_algebra.py +++ b/examples/handle_algebra.py @@ -1,5 +1,4 @@ from build123d import * -from build123d.part_operations import * import build123d.alg_compat as COMPAT segment_count = 6 diff --git a/examples/intersecting_pipes_algebra.py b/examples/intersecting_pipes_algebra.py index 6a8d984..1c1ea53 100644 --- a/examples/intersecting_pipes_algebra.py +++ b/examples/intersecting_pipes_algebra.py @@ -1,6 +1,4 @@ from build123d import * -from build123d.part_operations import * -import alg123d as ad pipes = Rot(10, 20, 30) * Box(10, 10, 10) @@ -12,7 +10,7 @@ for plane in [Plane(f) for f in pipes.faces()]: last = pipes.edges() pipes += extrude(pipe, amount=10) - pipes = ad.fillet(pipes, pipes.edges() - last, radius=0.2) + pipes = fillet(pipes, pipes.edges() - last, radius=0.2) if "show_object" in locals(): show_object(pipes, name="intersecting pipes") diff --git a/examples/lego_algebra.py b/examples/lego_algebra.py index c921627..d987deb 100644 --- a/examples/lego_algebra.py +++ b/examples/lego_algebra.py @@ -1,6 +1,5 @@ from build123d import * -from build123d.part_operations import * -import alg123d as ad +import build123d.alg_compat as COMPAT pip_count = 6 @@ -24,7 +23,7 @@ wall_thickness = 1.2 plan = Rectangle(width=block_length, height=block_width) # Subtract an offset to create the block walls -plan -= ad.offset( +plan -= COMPAT.offset( plan, amount=-wall_thickness, kind=Kind.INTERSECTION, diff --git a/examples/loft_algebra.py b/examples/loft_algebra.py index 1e24dee..b0cd336 100644 --- a/examples/loft_algebra.py +++ b/examples/loft_algebra.py @@ -1,7 +1,6 @@ from math import pi, sin from build123d import * -from build123d.part_operations import * -import alg123d as ad +import build123d.alg_compat as COMPAT slice_count = 10 @@ -12,7 +11,7 @@ for i in range(slice_count + 1): art = loft(art) top_bottom = art.faces(GeomType.PLANE) -art = ad.shell(art, openings=top_bottom, amount=0.5) +art = COMPAT.shell(art, openings=top_bottom, amount=0.5) if "show_object" in locals(): show_object(art, name="art") diff --git a/examples/pillow_block_algebra.py b/examples/pillow_block_algebra.py index 0635501..287610b 100644 --- a/examples/pillow_block_algebra.py +++ b/examples/pillow_block_algebra.py @@ -1,6 +1,5 @@ from build123d import * -from build123d.part_operations import * -import alg123d as ad +import build123d.alg_compat as COMPAT height, width, thickness, padding = 60, 80, 10, 12 screw_shaft_radius, screw_head_radius, screw_head_height = 1.5, 3, 3 @@ -8,19 +7,19 @@ bearing_axle_radius, bearing_radius, bearing_thickness = 4, 11, 7 # Build pillow block as an extruded sketch with counter bore holes plan = Rectangle(width, height) -plan = ad.fillet(plan, plan.vertices(), 5) +plan = COMPAT.fillet(plan, plan.vertices(), 5) pillow_block = extrude(plan, thickness) plane = Plane(pillow_block.faces().max()) -pillow_block -= plane * ad.CounterBore( +pillow_block -= plane * COMPAT.CounterBore( pillow_block, bearing_axle_radius, bearing_radius, bearing_thickness ) for loc in GridLocations(width - 2 * padding, height - 2 * padding, 2, 2): pillow_block -= ( plane * loc - * ad.CounterBore( + * COMPAT.CounterBore( pillow_block, screw_shaft_radius, screw_head_radius, screw_head_height ) ) diff --git a/examples/roller_coaster_algebra.py b/examples/roller_coaster_algebra.py index 957c3f1..ae0d2b0 100644 --- a/examples/roller_coaster_algebra.py +++ b/examples/roller_coaster_algebra.py @@ -1,5 +1,4 @@ from build123d import * -import alg123d as ad powerup = Spline( (0, 0, 0), @@ -8,7 +7,7 @@ powerup = Spline( tangents=((1, 0, 0), (1, 0, 0)), tangent_scalars=(0.5, 2), ) -corner = ad.RadiusArc(powerup @ 1, (100, 60, 0), -30) +corner = RadiusArc(powerup @ 1, (100, 60, 0), -30) screw = Pos(75, 40, 15) * Helix(75, 150, 15, direction=(-1, 0, 0)) roller_coaster = powerup + corner + screw diff --git a/examples/vase_algebra.py b/examples/vase_algebra.py index e60e34c..02e033e 100644 --- a/examples/vase_algebra.py +++ b/examples/vase_algebra.py @@ -1,11 +1,10 @@ from build123d import * -from build123d.part_operations import * -import alg123d as ad +import build123d.alg_compat as COMPAT l1 = Line((0, 0), (12, 0)) -l2 = ad.RadiusArc(l1 @ 1, (15, 20), 50) +l2 = RadiusArc(l1 @ 1, (15, 20), 50) l3 = Spline(l2 @ 1, (22, 40), (20, 50), tangents=(l2 % 1, (-0.75, 1))) -l4 = ad.RadiusArc(l3 @ 1, l3 @ 1 + Vector(0, 5), 5) +l4 = RadiusArc(l3 @ 1, l3 @ 1 + Vector(0, 5), 5) l5 = Spline( l4 @ 1, l4 @ 1 + Vector(2.5, 2.5), @@ -19,14 +18,14 @@ outline += Polyline( (0, (l5 @ 1).Y + 1), l1 @ 0, ) -profile = ad.make_face(outline) +profile = COMPAT.make_face(outline) vase = revolve(profile, axis=Axis.Y) -vase = ad.shell(vase, openings=vase.faces().max(Axis.Y), amount=-1) +vase = COMPAT.shell(vase, openings=vase.faces().max(Axis.Y), amount=-1) top_edges = vase.edges(GeomType.CIRCLE).filter_by_position(Axis.Y, 60, 62) -vase = ad.fillet(vase, top_edges, radius=0.25) +vase = fillet(vase, top_edges, radius=0.25) -vase = ad.fillet(vase, vase.edges().sort_by(Axis.Y)[0], radius=0.5) +vase = fillet(vase, vase.edges().sort_by(Axis.Y)[0], radius=0.5) if "show_object" in locals(): show_object(vase, name="vase")