MCPcopy Index your code
hub / github.com/CadQuery/cadquery / offset2D

Method offset2D

cadquery/occ_impl/shapes.py:3121–3144  ·  view source on GitHub ↗

Offsets a planar wire

(
        self, d: float, kind: Literal["arc", "intersection", "tangent"] = "arc"
    )

Source from the content-addressed store, hash-verified

3119 return self.__class__(wire_builder.Wire())
3120
3121 def offset2D(
3122 self, d: float, kind: Literal["arc", "intersection", "tangent"] = "arc"
3123 ) -> list[Wire]:
3124 """Offsets a planar wire"""
3125
3126 kind_dict = {
3127 "arc": GeomAbs_JoinType.GeomAbs_Arc,
3128 "intersection": GeomAbs_JoinType.GeomAbs_Intersection,
3129 "tangent": GeomAbs_JoinType.GeomAbs_Tangent,
3130 }
3131
3132 offset = BRepOffsetAPI_MakeOffset()
3133 offset.Init(kind_dict[kind])
3134 offset.AddWire(self.wrapped)
3135 offset.Perform(d)
3136
3137 obj = downcast(offset.Shape())
3138
3139 if isinstance(obj, TopoDS_Compound):
3140 rv = [self.__class__(el.wrapped) for el in Compound(obj)]
3141 else:
3142 rv = [self.__class__(obj)]
3143
3144 return rv
3145
3146 def fillet2D(self, radius: float, vertices: Iterable[Vertex]) -> Wire:
3147 """

Callers

nothing calls this directly

Calls 2

downcastFunction · 0.85
CompoundClass · 0.85

Tested by

no test coverage detected