Package org.djutils.draw.surface
Class Surface3d
java.lang.Object
org.djutils.draw.surface.Surface3d
- All Implemented Interfaces:
Serializable
,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
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieve the bounding box of the object.int
hashCode()
iterator()
project()
Project the object onto the z=0 plane.int
size()
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, wait
Methods inherited from interface org.djutils.draw.Drawable
getPointList, toString, toString
Methods inherited from interface org.djutils.draw.Drawable3d
getDimensions
Methods 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
- whenpoints
isnull
, or contains anull
valueIllegalArgumentException
- when points is empty, or any element inpoints
does not contain exactly three different points
-
-
Method Details
-
iterator
-
size
public int size()Description copied from interface:Drawable
Retrieve the number of points that make up the object. -
getBounds
Description copied from interface:Drawable3d
Retrieve the bounding box of the object.- Specified by:
getBounds
in interfaceDrawable3d
- Returns:
- the bounding box of the object
-
project
Description copied from interface:Drawable3d
Project the object onto the z=0 plane.- Specified by:
project
in interfaceDrawable3d
- Returns:
- the projected object
- Throws:
DrawRuntimeException
- when projecting onto thez=0
plane results in an invalid object. E.g. a Line3d that consists of points that all have the exact samex
andy
coordinates cannot be a line after projecting on thez=0
plane.
-
toString
Description copied from interface:Drawable
Produce 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:Drawable
Produce a String describing the Drawable.- Specified by:
toString
in interfaceDrawable<Point3d>
- Parameters:
doubleFormat
- a format string (something like "%6.3f") which will be used to render every coordinate value)doNotIncludeClassName
- iftrue
; the output oftoString
is 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
-