1 package org.djutils.draw; 2 3 import org.djutils.draw.bounds.Bounds3d; 4 import org.djutils.draw.point.Point3d; 5 6 /** 7 * Drawable3d is the Interface that all drawable objects that use 3D coordinates must implement. 8 * <p> 9 * Copyright (c) 2020-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 10 * BSD-style license. See <a href="https://djutils.org/docs/current/djutils/licenses.html">DJUTILS License</a>. 11 * </p> 12 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a> 13 * @author <a href="https://github.com/peter-knoppers">Peter Knoppers</a> 14 * @author <a href="https://github.com/wjschakel">Wouter Schakel</a> 15 */ 16 public interface Drawable3d extends Drawable<Point3d> 17 { 18 /** 19 * Retrieve the bounding box of the object. 20 * @return the bounding box of the object 21 */ 22 Bounds3d getBounds(); 23 24 @Override 25 default int getDimensions() 26 { 27 return 3; 28 } 29 30 /** 31 * Project the object onto the z=0 plane. 32 * @return the projected object 33 * @throws DrawRuntimeException when projecting onto the <code>z=0</code> plane results in an invalid object. E.g. a Line3d 34 * that consists of points that all have the exact same <code>x</code> and <code>y</code> coordinates cannot be 35 * a line after projecting on the <code>z=0</code> plane. 36 */ 37 Drawable2d project(); 38 39 }