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

Method offset

cadquery/sketch.py:573–588  ·  view source on GitHub ↗

Offset selected wires or edges.

(self: T, d: Real, mode: Modes = "a", tag: Optional[str] = None)

Source from the content-addressed store, hash-verified

571 return self
572
573 def offset(self: T, d: Real, mode: Modes = "a", tag: Optional[str] = None) -> T:
574 """
575 Offset selected wires or edges.
576 """
577
578 if self._selection:
579 rv = (el.offset2D(d) for el in self._selection if isinstance(el, Wire))
580
581 for el in chain.from_iterable(rv):
582 self.face(
583 el, mode=mode, tag=tag, ignore_selection=bool(self._selection)
584 )
585 else:
586 raise ValueError("Selection is needed to offset")
587
588 return self
589
590 def _matchFacesToVertices(self) -> Dict[Face, List[Vertex]]:
591

Callers 4

test_modesFunction · 0.80
test_modifiersFunction · 0.80
test_missing_selectionFunction · 0.80
testSketchMethod · 0.80

Calls 2

faceMethod · 0.95
offset2DMethod · 0.45

Tested by 4

test_modesFunction · 0.64
test_modifiersFunction · 0.64
test_missing_selectionFunction · 0.64
testSketchMethod · 0.64