Draw an arc from the current point to endPoint with an arc defined by the sag (sagitta). :param endPoint: end point for the arc :type endPoint: 2-tuple, in workplane coordinates :param sag: the sagitta of the arc :type sag: float, perpendicular distance from
(
self: T, endPoint: VectorLike, sag: float, forConstruction: bool = False,
)
| 2114 | return self.newObject([arc]) |
| 2115 | |
| 2116 | def sagittaArc( |
| 2117 | self: T, endPoint: VectorLike, sag: float, forConstruction: bool = False, |
| 2118 | ) -> T: |
| 2119 | """ |
| 2120 | Draw an arc from the current point to endPoint with an arc defined by the sag (sagitta). |
| 2121 | |
| 2122 | :param endPoint: end point for the arc |
| 2123 | :type endPoint: 2-tuple, in workplane coordinates |
| 2124 | :param sag: the sagitta of the arc |
| 2125 | :type sag: float, perpendicular distance from arc center to arc baseline. |
| 2126 | :return: a workplane with the current point at the end of the arc |
| 2127 | |
| 2128 | The sagitta is the distance from the center of the arc to the arc base. |
| 2129 | Given that a closed contour is drawn clockwise; |
| 2130 | A positive sagitta means convex arc and negative sagitta means concave arc. |
| 2131 | See `<https://en.wikipedia.org/wiki/Sagitta_(geometry)>`_ for more information. |
| 2132 | """ |
| 2133 | |
| 2134 | startPoint = self._findFromPoint(useLocalCoords=True) |
| 2135 | endPoint = Vector(endPoint) |
| 2136 | midPoint = endPoint.add(startPoint).multiply(0.5) |
| 2137 | |
| 2138 | sagVector = endPoint.sub(startPoint).normalized().multiply(abs(sag)) |
| 2139 | if sag > 0: |
| 2140 | sagVector.x, sagVector.y = ( |
| 2141 | -sagVector.y, |
| 2142 | sagVector.x, |
| 2143 | ) # Rotate sagVector +90 deg |
| 2144 | else: |
| 2145 | sagVector.x, sagVector.y = ( |
| 2146 | sagVector.y, |
| 2147 | -sagVector.x, |
| 2148 | ) # Rotate sagVector -90 deg |
| 2149 | |
| 2150 | sagPoint = midPoint.add(sagVector) |
| 2151 | |
| 2152 | return self.threePointArc(sagPoint, endPoint, forConstruction) |
| 2153 | |
| 2154 | def radiusArc( |
| 2155 | self: T, endPoint: VectorLike, radius: float, forConstruction: bool = False, |