Exemple #1
0
def center_of_3points_arc(point1: 'Vertex', point2: 'Vertex', point3: 'Vertex') -> Vector:
    """
    Calc center point of 3 point arc. ConstructionCircle is defined by 3 points on the circle: point1, point2 and point3.
    """
    ray1 = ConstructionRay(point1, point2)
    ray2 = ConstructionRay(point1, point3)
    midpoint1 = lerp(point1, point2)
    midpoint2 = lerp(point1, point3)
    center_ray1 = ray1.orthogonal(midpoint1)
    center_ray2 = ray2.orthogonal(midpoint2)
    return center_ray1.intersect(center_ray2)
Exemple #2
0
 def _get_text_insert_point(self, section: int) -> Vector:
     """ get the dimension value text insert point """
     point1, point2 = self._get_section_points(section)
     dist = self.prop('height') / 2. + self.prop('textabove')
     return lerp(point1, point2) + (self.normal_vector * dist)