001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.geometry.io.euclidean.threed;
018
019import java.util.List;
020
021import org.apache.commons.geometry.euclidean.threed.Vector3D;
022
023/** Interface containing values (vertices and optional normal) used to define a convex,
024 * finite polygon in 3D space. In contrast to the similar
025 * {@link org.apache.commons.geometry.euclidean.threed.ConvexPolygon3D ConvexPolygon3D}
026 * class, no guarantees are made regarding the geometric validity of the data.
027 * For example, instances may contain vertices that do not lie in the same plane
028 * or have normals that are not unit length or point in an unexpected direction.
029 * This is lack of validation is intentional, since a primary purpose of this
030 * interface is to allow access to raw, possibly invalid, geometric data from input
031 * sources.
032 * @see org.apache.commons.geometry.euclidean.threed.ConvexPolygon3D
033 * @see FacetDefinitions
034 */
035public interface FacetDefinition {
036
037    /** Get the facet vertices.
038     * @return facet vertices
039     */
040    List<Vector3D> getVertices();
041
042    /** Get the normal defined for the facet or null if one has not been explicitly
043     * specified. No guarantees are made regarding the properties of the normal
044     * or its relationship to the vertices.
045     * @return the defined normal for the facet or null if one has not been explicitly
046     *      specified
047     */
048    Vector3D getNormal();
049}