Drawing#

Provides functionality for drawing objects in the flight scene, the map view, the editor and the tracking station.

Example#

The following example draws a line from the center of mass of the active vessel, along the direction it points. The server removes a client’s drawings when the client disconnects, so the example waits 10 seconds before it exits:

import krpc.client.Connection;
import krpc.client.services.Drawing;
import krpc.client.services.SpaceCenter;
import krpc.client.services.SpaceCenter.Vessel;
import org.javatuples.Triplet;


public class DrawingExample {
    public static void main(String[] args) throws InterruptedException {
        Connection connection = Connection.newInstance("Drawing Example");
        Vessel vessel =
            SpaceCenter.newInstance(connection).getActiveVessel();
        Drawing.newInstance(connection).addDirectionFromCom(
            new Triplet<Double, Double, Double>(0.0, 1.0, 0.0),
            vessel.getReferenceFrame(), 10, true);
        Thread.sleep(10000);
        connection.close();
    }
}