View Javadoc
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.euclidean.threed.mesh;
18  
19  import org.apache.commons.geometry.core.Transform;
20  import org.apache.commons.geometry.euclidean.threed.Triangle3D;
21  import org.apache.commons.geometry.euclidean.threed.Vector3D;
22  
23  /** Interface representing a mesh composed entirely of triangular faces.
24   */
25  public interface TriangleMesh extends Mesh<TriangleMesh.Face> {
26  
27      /** {@inheritDoc} */
28      @Override
29      TriangleMesh transform(Transform<Vector3D> transform);
30  
31      /** Interface representing a single triangular face in a mesh.
32       */
33      interface Face extends Mesh.Face {
34  
35          /** Get the first vertex in the face.
36           * @return the first vertex in the face
37           */
38          Vector3D getPoint1();
39  
40          /** Get the second vertex in the face.
41           * @return the second vertex in the face
42           */
43          Vector3D getPoint2();
44  
45          /** Get the third vertex in the face.
46           * @return the third vertex in the face
47           */
48          Vector3D getPoint3();
49  
50          /** {@inheritDoc} */
51          @Override
52          Triangle3D getPolygon();
53      }
54  }