6 package eu.mihosoft.vrl.v3d;
8 import java.util.ArrayList;
9 import java.util.Arrays;
10 import java.util.List;
11 import java.util.function.Function;
12 import java.util.stream.Collectors;
26 private final List<Vector3d>
points =
new ArrayList<>();
29 private final List<List<Integer>>
faces =
new ArrayList<>();
39 this.points.addAll(
points);
40 this.faces.addAll(
faces);
51 this.points.addAll(Arrays.asList(
points));
53 for (Integer[] list :
faces) {
54 this.faces.add(Arrays.asList(list));
65 Function<Integer, Vector3d> indexToPoint = (Integer i) -> {
66 return points.get(i).clone();
69 Function<List<Integer>,
Polygon> faceListToPolygon
70 = (List<Integer> faceList) -> {
75 return faces.stream().map(faceListToPolygon).
76 collect(Collectors.toList());
static Polygon fromPoints(List< Vector3d > points, PropertyStorage shared)
Polyhedron(Vector3d[] points, Integer[][] faces)
PropertyStorage getProperties()
List< Polygon > toPolygons()
final List< List< Integer > > faces
final PropertyStorage properties
final List< Vector3d > points
Polyhedron(List< Vector3d > points, List< List< Integer >> faces)