Ejemplo n.º 1
0
 def transform(self, ocs: OCSTransform, elevation: float) -> None:
     self.control_points = list(
         ocs.transform_2d_vertex(v, elevation) for v in self.control_points
     )
     self.fit_points = list(
         ocs.transform_2d_vertex(v, elevation) for v in self.fit_points
     )
     if self.start_tangent is not None:
         t = Vec3(self.start_tangent).replace(z=elevation)
         self.start_tangent = ocs.transform_direction(t).vec2
     if self.end_tangent is not None:
         t = Vec3(self.end_tangent).replace(z=elevation)
         self.end_tangent = ocs.transform_direction(t).vec2
Ejemplo n.º 2
0
    def transform(self, ocs: OCSTransform, elevation: float) -> None:
        self.center = ocs.transform_2d_vertex(self.center, elevation)
        self.radius = ocs.transform_length(Vec3(self.radius, 0, 0))
        if not math.isclose(
            arc_angle_span_deg(self.start_angle, self.end_angle), 360.0
        ):  # open arc
            # The transformation of the ccw flag is not necessary for the current
            # implementation of OCS transformations. The arc angles have always
            # a counter clockwise orientation around the extrusion vector and
            # this orientation is preserved even for mirroring, which flips the
            # extrusion vector to (0, 0, -1) for entities in the xy-plane.

            self.start_angle = ocs.transform_deg_angle(self.start_angle)
            self.end_angle = ocs.transform_deg_angle(self.end_angle)
        else:  # full circle
            # Transform only start point to preserve the connection point to
            # adjacent edges:
            self.start_angle = ocs.transform_deg_angle(self.start_angle)
            # ArcEdge is represented in counter-clockwise orientation:
            self.end_angle = self.start_angle + 360.0
Ejemplo n.º 3
0
 def transform(self, ocs: OCSTransform, elevation: float) -> None:
     self.start = ocs.transform_2d_vertex(self.start, elevation)
     self.end = ocs.transform_2d_vertex(self.end, elevation)