public class Area2d extends AbstractCollection<Coords2d>
| Constructor and Description |
|---|
Area2d(List<Coords2d> coords)
Instantiate a new object with the given list of coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
PointRelation |
calculatePointRelation(Coords2d p)
Calculates the relation of the given point and this area.
|
List<Coords2d> |
findCrossing(LineSegment2d segment,
boolean includeEndPoints)
Checks if the given line segment has crossing with this geometric form.
|
Coords2d |
get(int index)
Gives access to the points of this area.
|
boolean |
isDistinct(Area2d other)
Checks if the two list of coordinates are distinct.
|
Iterator<Coords2d> |
iterator() |
Area2d |
move(Coords2d move)
Moves this list of coordinates with the given coordinate.
|
Area2d |
reverse()
Creates a new object where the order of the points are reversed.
|
Area2d |
rotate(Angle angle)
Rotates this list of coordinates with the given degree.
|
int |
size()
Returns with the number of points this area consists.
|
Area2d |
subList(Coords2d first,
Coords2d last)
Returns with a list of coordinates which contains the coordinates from first to last inclusive.
|
Area2d |
subList(int start,
int end)
Returns with a list of coordinates which contains the coordinates indexed from start to end inclusive.
|
String |
toString() |
Area2d |
union(Area2d other)
Creates a new object which covers the union of this and the given area.
|
List<Coords3d> |
withZ(double z)
Extends this list of 2D coordinates to a 3D list of coordinates.
|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic Area2d move(Coords2d move)
move - the coordinate move withpublic Area2d rotate(Angle angle)
angle - the angle in degree to rotate withpublic List<Coords3d> withZ(double z)
z - the Z value to be used for the transformationpublic Iterator<Coords2d> iterator()
iterator in interface Iterable<Coords2d>iterator in interface Collection<Coords2d>iterator in class AbstractCollection<Coords2d>public Area2d union(Area2d other)
other - the other area to be usedpublic List<Coords2d> findCrossing(LineSegment2d segment, boolean includeEndPoints)
segment - the line segmentincludeEndPoints - if the cross point is one of the two given end points this method
will return null if this parameter is falsepublic boolean isDistinct(Area2d other)
other - the other list of coordinatespublic PointRelation calculatePointRelation(Coords2d p)
p - the point to be checkedpublic Area2d reverse()
public Coords2d get(int index)
index - the index of the point we want to get.public int size()
size in interface Collection<Coords2d>size in class AbstractCollection<Coords2d>public Area2d subList(int start, int end)
start - the first index to includeend - the last index to includepublic Area2d subList(Coords2d first, Coords2d last)
first - the first item to includelast - the last item to includepublic String toString()
toString in class AbstractCollection<Coords2d>Copyright © 2014–2020, Printing in 3D. All rights reserved.