MCPcopy
hub / github.com/CadQuery/cadquery / wire

Method wire

cadquery/cq.py:2345–2377  ·  view source on GitHub ↗

Returns a CQ object with all pending edges connected into a wire. All edges on the stack that can be combined will be combined into a single wire object, and other objects will remain on the stack unmodified. If there are no pending edges, this method will just retu

(self: T, forConstruction: bool = False)

Source from the content-addressed store, hash-verified

2343 return r
2344
2345 def wire(self: T, forConstruction: bool = False) -> T:
2346 """
2347 Returns a CQ object with all pending edges connected into a wire.
2348
2349 All edges on the stack that can be combined will be combined into a single wire object,
2350 and other objects will remain on the stack unmodified. If there are no pending edges,
2351 this method will just return self.
2352
2353 :param forConstruction: whether the wire should be used to make a solid, or if it is just
2354 for reference
2355
2356 This method is primarily of use to plugin developers making utilities for 2D construction.
2357 This method should be called when a user operation implies that 2D construction is
2358 finished, and we are ready to begin working in 3d.
2359
2360 SEE '2D construction concepts' for a more detailed explanation of how CadQuery handles
2361 edges, wires, etc.
2362
2363 Any non edges will still remain.
2364 """
2365
2366 # do not consolidate if there are no free edges
2367 if len(self.ctx.pendingEdges) == 0:
2368 return self
2369
2370 edges = self.ctx.popPendingEdges()
2371 w = Wire.assembleEdges(edges)
2372 if not forConstruction:
2373 self._addPendingWire(w)
2374
2375 others = [e for e in self.objects if not isinstance(e, Edge)]
2376
2377 return self.newObject(others + [w])
2378
2379 def each(
2380 self: T,

Callers 13

mirrorYMethod · 0.95
mirrorXMethod · 0.95
closeMethod · 0.95
sweepMethod · 0.45
test_single_ent_selectorFunction · 0.45
testBasicLinesMethod · 0.45
test2DDrawingMethod · 0.45
testTangentArcToPointMethod · 0.45
testPositionAtMethod · 0.45
test2DfilletMethod · 0.45
test2DchamferMethod · 0.45
test_close_3D_pointsMethod · 0.45

Calls 4

_addPendingWireMethod · 0.95
newObjectMethod · 0.95
popPendingEdgesMethod · 0.80
assembleEdgesMethod · 0.80

Tested by 9

test_single_ent_selectorFunction · 0.36
testBasicLinesMethod · 0.36
test2DDrawingMethod · 0.36
testTangentArcToPointMethod · 0.36
testPositionAtMethod · 0.36
test2DfilletMethod · 0.36
test2DchamferMethod · 0.36
test_close_3D_pointsMethod · 0.36
test_prism_taperFunction · 0.36