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

Method tangentArcPoint

cadquery/cq.py:2190–2223  ·  view source on GitHub ↗

Draw an arc as a tangent from the end of the current edge to endpoint. :param endpoint: point for the arc to end at :type endpoint: 2-tuple, 3-tuple or Vector :param relative: True if endpoint is specified relative to the current point, False if endpoint is in workp

(
        self: T,
        endpoint: VectorLike,
        forConstruction: bool = False,
        relative: bool = True,
    )

Source from the content-addressed store, hash-verified

2188 return self.sagittaArc(endPoint, -sag, forConstruction)
2189
2190 def tangentArcPoint(
2191 self: T,
2192 endpoint: VectorLike,
2193 forConstruction: bool = False,
2194 relative: bool = True,
2195 ) -> T:
2196 """
2197 Draw an arc as a tangent from the end of the current edge to endpoint.
2198
2199 :param endpoint: point for the arc to end at
2200 :type endpoint: 2-tuple, 3-tuple or Vector
2201 :param relative: True if endpoint is specified relative to the current point, False if endpoint is in workplane coordinates
2202 :return: a Workplane object with an arc on the stack
2203
2204 Requires the the current first object on the stack is an Edge, as would
2205 be the case after a lineTo operation or similar.
2206 """
2207
2208 if not isinstance(endpoint, Vector):
2209 endpoint = Vector(endpoint)
2210 if relative:
2211 endpoint = endpoint + self._findFromPoint(useLocalCoords=True)
2212 endpoint = self.plane.toWorldCoords(endpoint)
2213
2214 previousEdge = self._findFromEdge()
2215
2216 arc = Edge.makeTangentArc(
2217 previousEdge.endPoint(), previousEdge.tangentAt(1), endpoint
2218 )
2219
2220 if not forConstruction:
2221 self._addPendingEdge(arc)
2222
2223 return self.newObject([arc])
2224
2225 def mirrorY(self: T) -> T:
2226 """

Callers 1

testTangentArcToPointMethod · 0.80

Calls 9

_findFromPointMethod · 0.95
_findFromEdgeMethod · 0.95
_addPendingEdgeMethod · 0.95
newObjectMethod · 0.95
VectorClass · 0.85
toWorldCoordsMethod · 0.80
makeTangentArcMethod · 0.80
endPointMethod · 0.80
tangentAtMethod · 0.45

Tested by 1

testTangentArcToPointMethod · 0.64