1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.commons.geometry.io.euclidean.threed;
18
19 import java.util.List;
20
21 import org.apache.commons.geometry.euclidean.threed.Vector3D;
22
23 /** Interface containing values (vertices and optional normal) used to define a convex,
24 * finite polygon in 3D space. In contrast to the similar
25 * {@link org.apache.commons.geometry.euclidean.threed.ConvexPolygon3D ConvexPolygon3D}
26 * class, no guarantees are made regarding the geometric validity of the data.
27 * For example, instances may contain vertices that do not lie in the same plane
28 * or have normals that are not unit length or point in an unexpected direction.
29 * This is lack of validation is intentional, since a primary purpose of this
30 * interface is to allow access to raw, possibly invalid, geometric data from input
31 * sources.
32 * @see org.apache.commons.geometry.euclidean.threed.ConvexPolygon3D
33 * @see FacetDefinitions
34 */
35 public interface FacetDefinition {
36
37 /** Get the facet vertices.
38 * @return facet vertices
39 */
40 List<Vector3D> getVertices();
41
42 /** Get the normal defined for the facet or null if one has not been explicitly
43 * specified. No guarantees are made regarding the properties of the normal
44 * or its relationship to the vertices.
45 * @return the defined normal for the facet or null if one has not been explicitly
46 * specified
47 */
48 Vector3D getNormal();
49 }