Skip to content

Commit

Permalink
Fixing drafting problem only tested with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
gumyr committed Dec 9, 2024
1 parent d1de2a6 commit a34f340
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/build123d/drafting.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from build123d.objects_sketch import BaseSketchObject, Polygon, Text
from build123d.operations_generic import fillet, mirror, sweep
from build123d.operations_sketch import make_face, trace
from build123d.topology import Compound, Edge, Sketch, Vertex, Wire
from build123d.topology import Compound, Curve, Edge, Sketch, Vertex, Wire


class ArrowHead(BaseSketchObject):
Expand Down Expand Up @@ -704,7 +704,10 @@ def __init__(
)
bf_pnt3 = box_frame_curve.edges().sort_by(Axis.X)[0] @ (1 / 3)
bf_pnt4 = box_frame_curve.edges().sort_by(Axis.X)[0] @ (2 / 3)
box_frame_curve += Edge.make_line(bf_pnt3, (bf_pnt2.X, bf_pnt3.Y))
box_frame_curve = Curve() + [
box_frame_curve,
Edge.make_line(bf_pnt3, (bf_pnt2.X, bf_pnt3.Y)),
]
box_frame_curve += Edge.make_line(bf_pnt4, (bf_pnt2.X, bf_pnt4.Y))
bf_pnt5 = box_frame_curve.edges().sort_by(Axis.Y)[-1] @ (1 / 3)
bf_pnt6 = box_frame_curve.edges().sort_by(Axis.Y)[-1] @ (2 / 3)
Expand Down
7 changes: 6 additions & 1 deletion src/build123d/operations_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,9 @@ def trace(
context.pending_edges = ShapeList()

combined_faces = Face.fuse(*new_faces) if len(new_faces) > 1 else new_faces[0]
return Sketch(combined_faces.wrapped)
result = (
Sketch(combined_faces)
if isinstance(combined_faces, list)
else Sketch(combined_faces.wrapped)
)
return result

0 comments on commit a34f340

Please sign in to comment.