Example #1
0
# ==============================================================================

if __name__ == '__main__':

    from math import radians

    from compas.geometry import Point
    from compas.geometry import Vector
    from compas.geometry import Line
    from compas.geometry import Rotation
    from compas_plotters import GeometryPlotter

    plotter = GeometryPlotter()

    a = Point(3.0, 2.0)
    b = Point(3.0, 5.0)

    line = Line(a, b)

    R = Rotation.from_axis_and_angle(Vector(0.0, 0.0, 1.0), radians(10), point=line.end)

    plotter.add(line, draw_points=True, draw_segment=True)

    plotter.draw(pause=1.0)

    for i in range(9):
        line.transform(R)
        plotter.redraw(pause=0.01)

    plotter.show()
Example #2
0
        self._mpl_ellipse.set_edgecolor(self.edgecolor)
        self._mpl_ellipse.set_facecolor(self.facecolor)


# ==============================================================================
# Main
# ==============================================================================

if __name__ == '__main__':

    from compas.geometry import Ellipse
    from compas.geometry import Point
    from compas.geometry import Plane
    from compas.geometry import Vector
    from compas_plotters import GeometryPlotter

    plotter = GeometryPlotter()

    plane = Plane(Point(0, 0, 0), Vector(0, 0, 1))

    a = Ellipse(plane, 5.0, 3.0)
    b = Ellipse(plane, 2.0, 1.0)
    c = Ellipse(plane, 3.0, 1.0)

    plotter.add(a, edgecolor='#ff0000', fill=False)
    plotter.add(b, edgecolor='#00ff00', fill=False)
    plotter.add(c, edgecolor='#0000ff', fill=False)

    plotter.draw()
    plotter.show()