Package org.djutils.draw.surface
Class Surface3d
java.lang.Object
org.djutils.draw.surface.Surface3d
- All Implemented Interfaces:
Iterable<Point3d>,Drawable<Point3d>,Drawable3d
Triangulated surface in 3D space.
Copyright (c) 2021-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieve the bounding box of the object in absolute coordinates.inthashCode()iterator()project()Project the object onto the z=0 plane.intsize()Retrieve the number of points that make up the object.toString()Produce a string describing the Drawable using default conversion for the (double) coordinate values.Produce a String describing the Drawable.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.draw.Drawable
getPointList, toString, toStringMethods inherited from interface org.djutils.draw.Drawable3d
getDimensionsMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Surface3d
Construct a new Surface3d.- Parameters:
points- two dimensional array of points. The first index iterates over the individual triangles; the second index iterates over the points of a single triangle. The range of the second index must be 3. It is expected that all points appear multiple times in the points array, but never within the same sub-array.- Throws:
NullPointerException- whenpointsisnull, or contains anullvalueIllegalArgumentException- when points is empty, or any element inpointsdoes not contain exactly three different points
-
-
Method Details
-
iterator
-
size
public int size()Description copied from interface:DrawableRetrieve the number of points that make up the object. -
getAbsoluteBounds
Description copied from interface:Drawable3dRetrieve the bounding box of the object in absolute coordinates.- Specified by:
getAbsoluteBoundsin interfaceDrawable3d- Returns:
- the bounding box of the object in absolute coordinates
-
project
Description copied from interface:Drawable3dProject the object onto the z=0 plane.- Specified by:
projectin interfaceDrawable3d- Returns:
- the projected object
- Throws:
InvalidProjectionException- when projecting onto thez=0plane results in an invalid object. E.g. a Line3d that consists of points that all have the exact samexandycoordinates cannot be a line after projecting on thez=0plane.
-
toString
Description copied from interface:DrawableProduce a string describing the Drawable using default conversion for the (double) coordinate values. Regrettably, it is not allowed to provide a default implementation here. -
toString
Description copied from interface:DrawableProduce a String describing the Drawable.- Specified by:
toStringin interfaceDrawable<Point3d>- Parameters:
doubleFormat- a format string (something like "%6.3f") which will be used to render every coordinate value)doNotIncludeClassName- iftrue; the output oftoStringis not prefixed by the class name. This is useful for concatenating the textual representation of lots of Drawables (e.g. an array, or a List).- Returns:
- textual representation of the Drawable
-
hashCode
public int hashCode() -
equals
-