Esempio n. 1
0
def test_to_from_polygon():
    """Test the from_polygon method."""
    pts_1 = (Point2D(0, 0), Point2D(2, 0), Point2D(2, 2), Point2D(0, 2))
    pline2d = Polyline2D(pts_1, interpolated=True)

    pline = Polyline3D.from_polyline2d(pline2d)
    assert isinstance(pline, Polyline3D)
    assert len(pline) == 4
    assert pline.interpolated

    new_pline2d = pline.to_polyline2d()
    assert isinstance(new_pline2d, Polyline2D)
    assert len(new_pline2d) == 4
    assert new_pline2d.interpolated
Esempio n. 2
0
 def chart_border3d(self):
     """Get a Polyline3D for the border of the plot."""
     plane = Plane(o=Point3D(0, 0, self._base_point.z))
     return Polyline3D.from_polyline2d(self.chart_border2d, plane)