Skip to content

How to reuse existing edge in combination with new geometry? #1688

Answered by lorenzncode
wfraser asked this question in Q&A
Discussion options

You must be logged in to vote

Here are a few ideas. You were close with (1).

  1. Solution with Workplane, toPending. Try selecting the wire not the edges:
# this matches the desired shape
myShape2 = (
    box.faces(">Z")
    .wires()
    .sort(lambda wire: wire.Length() * -1)
    .first()
    .toPending()
    .circle(4)
    .extrude(0.5, combine=False)
)
  1. With Sketch. You can reuse the sketch for the original box and later for myShape.
import cadquery as cq

sk1 = cq.Sketch().rect(10, 10)
sk2 = sk1.copy().rarray(3, 3, 2, 2).circle(0.5, mode="s")

box1 = cq.Workplane().placeSketch(sk2).extrude(1)

# for comparison with myShape
desiredShape = box1.faces(">Z").rect(10, 10).circle(4).extrude(0.5, combine=False)

myShape =

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wfraser
Comment options

@lorenzncode
Comment options

Answer selected by wfraser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants