Package com.solibri.geometry.mesh
Interface TriangleMesh
- All Superinterfaces:
- Iterable<Triangle3d>
Represents a mesh made of triangles. 
TriangleMesh is also an Iterable of triangles. Since this is an
 iterable, using iterating over it from multi threads at the same time is not safe, since the iterations conflict with
 each other. For multi-threaded access, be sure to call toTriangleCollection() or toPointCollection() and
 use those collections.- Since:
- 9.10.2
- 
Method SummaryModifier and TypeMethodDescriptionstatic TriangleMeshReturns a new instance of an emptyTriangleMesh.difference(TriangleMesh other) Returns the difference of this triangle mesh and the given triangle mesh.booleanReturns true if theTriangleMeshis closed and the given point is inside thisTriangleMesh.filter(Predicate<Triangle3d> filter) Returns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshthat satisfy the givenPredicate.flipped()Returns a version of thisTriangleMeshwhere all the triangles have flipped normals, with the effect of exchanging the external faces with the internal faces if the mesh is closed.static TriangleMeshfromPolygons(Collection<? extends Polygon3d> polygons) Returns a new instance of aTriangleMeshgiven the polygons that form it.static TriangleMeshfromTriangles(Collection<? extends Triangle3d> triangles) Returns a new instance of aTriangleMeshgiven the triangles it contains.doublegetArea()Returns the total area of the triangles in thisTriangleMesh.Returns the axis aligned bounding box of theTriangleMesh.Returns an iterable of all the vertices of all the triangles in theTriangleMesh.doubleReturns the total volume enclosed by thisTriangleMesh.intersection(TriangleMesh other) Returns the intersection of this triangle mesh and the given triangle mesh.booleanintersects(TriangleMesh other) Returns true if thisTriangleMeshintersects the givenTriangleMesh.booleanReturns true if the closedTriangleMeshis inside-out, meaning that the normals of the surface triangles point inwards instead of outwards.mergedWith(TriangleMesh other) Returns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshand anotherTriangleMesh.Returns the shortest 2D path from the projection of thisTriangleMeshto the projection of a point in the XY-plane, if such path exists.Returns the shortest 2D path from the projection of thisTriangleMeshto the projection of anotherTriangleMeshin the XY-plane, if such path exists.shortestHorizontalPathTo(Vector3d point) Returns the shortest horizontal path from thisTriangleMeshto a point, if such path exists.Returns the shortest horizontal path from thisTriangleMeshto another, if such path exists.shortestPathTo(Vector3d point) Returns the shortest path from thisTriangleMeshto a given point, if such path exists.shortestPathTo(TriangleMesh other) Returns the shortest path from thisTriangleMeshto another, if such path exists.shortestVerticalPathTo(Vector3d point) Returns the shortest vertical path from thisTriangleMeshto a point, if such path exists.Returns the shortest vertical path from thisTriangleMeshto another, if such path exists.Returns a new collection containing all the vertices of all the triangles in thisTriangleMesh.Returns a new collection containing the triangles in thisTriangleMesh.Returns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshtransformed by the given transformation matrix.transform(Function<Triangle3d, Triangle3d> mapping) Returns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshtransformed according to the given mapping function.union(TriangleMesh other) Returns the union of this triangle mesh and the given triangle mesh.withPolygon(Polygon3d polygon) Returns a newTriangleMeshcomposed of thisTriangleMeshand an additional polygon.withPolygons(Collection<? extends Polygon3d> polygons) Returns a newTriangleMeshcomposed of thisTriangleMeshand additional polygons.withTriangle(Triangle3d triangle) Returns a newTriangleMeshcomposed of thisTriangleMeshand an additional triangle.withTriangles(Collection<? extends Triangle3d> triangles) Returns a newTriangleMeshcomposed of thisTriangleMeshand additional triangles.Methods inherited from interface java.lang.IterableforEach, iterator, spliterator
- 
Method Details- 
createEmptyReturns a new instance of an emptyTriangleMesh.- Returns:
- the empty TriangleMesh
- Since:
- 9.10.2
 
- 
fromTrianglesReturns a new instance of aTriangleMeshgiven the triangles it contains.- Parameters:
- triangles- the triangles of the new mesh
- Returns:
- the TriangleMesh
- Since:
- 9.10.2
 
- 
fromPolygonsReturns a new instance of aTriangleMeshgiven the polygons that form it. The polygons will be triangulated.- Parameters:
- polygons- the polygons forming the mesh that will be triangulated
- Returns:
- the TriangleMesh
- Since:
- 9.10.2
 
- 
toTriangleCollectionCollection<Triangle3d> toTriangleCollection()Returns a new collection containing the triangles in thisTriangleMesh. If an iterable to the mesh's triangles is enough, use directlyTriangleMeshas anIterable.- Returns:
- a new collection containing the triangles in this TriangleMesh
- Since:
- 9.10.2
 
- 
toPointCollectionCollection<Vector3d> toPointCollection()Returns a new collection containing all the vertices of all the triangles in thisTriangleMesh. If an iterable to the mesh's points is enough, use the fastergetPoints().- Returns:
- a new collection containing all the vertices of all the triangles in this TriangleMesh.
- Since:
- 9.10.2
 
- 
withTriangleReturns a newTriangleMeshcomposed of thisTriangleMeshand an additional triangle.- Parameters:
- triangle- the triangle to add to the- TriangleMesh
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
withPolygonReturns a newTriangleMeshcomposed of thisTriangleMeshand an additional polygon.- Parameters:
- polygon- the polygon to add to the- TriangleMesh
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
withTrianglesReturns a newTriangleMeshcomposed of thisTriangleMeshand additional triangles.- Parameters:
- triangles- the triangles to add to the- TriangleMesh
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
withPolygonsReturns a newTriangleMeshcomposed of thisTriangleMeshand additional polygons.- Parameters:
- polygons- the polygons to add to the- TriangleMesh
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
mergedWithReturns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshand anotherTriangleMesh.- Parameters:
- other- the triangles to add to the- TriangleMesh
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
filterReturns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshthat satisfy the givenPredicate.- Parameters:
- filter- the given- Predicate
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
transformReturns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshtransformed according to the given mapping function.- Parameters:
- mapping- the given mapping function, describing how a- Triangle3dis transformed
- Returns:
- the new TriangleMesh
- Since:
- 9.10.2
 
- 
transformReturns a newTriangleMeshcomposed of all the triangles of thisTriangleMeshtransformed by the given transformation matrix.- Parameters:
- transformation- the given transformation matrix, describing how this- TriangleMeshis transformed
- Returns:
- the new TriangleMesh
- Since:
- 9.12.1
 
- 
getBoundingBoxReturns the axis aligned bounding box of theTriangleMesh.- Returns:
- the bounding box if it exists
- Since:
- 9.10.2
 
- 
getPointsReturns an iterable of all the vertices of all the triangles in theTriangleMesh.- Returns:
- an iterable of all the vertices in this TriangleMesh
- Since:
- 9.10.2
 
- 
intersectsReturns true if thisTriangleMeshintersects the givenTriangleMesh.- Parameters:
- other- the other- TriangleMesh
- Returns:
- true if this TriangleMeshand the givenTriangleMeshintersects, false otherwise
- Since:
- 9.10.2
 
- 
intersectionReturns the intersection of this triangle mesh and the given triangle mesh.- Parameters:
- other- the other mesh
- Returns:
- the intersection
- Since:
- 9.12.3
 
- 
unionReturns the union of this triangle mesh and the given triangle mesh.- Parameters:
- other- the other mesh
- Returns:
- the union
- Since:
- 9.12.3
 
- 
differenceReturns the difference of this triangle mesh and the given triangle mesh.- Parameters:
- other- the other mesh
- Returns:
- the difference
- Since:
- 9.12.3
 
- 
enclosesReturns true if theTriangleMeshis closed and the given point is inside thisTriangleMesh.- Parameters:
- point- the given point
- Returns:
- true if the point is inside the TriangleMesh
- Since:
- 9.10.2
 
- 
isInsideOutboolean isInsideOut()Returns true if the closedTriangleMeshis inside-out, meaning that the normals of the surface triangles point inwards instead of outwards. An inside-out mesh is produced when its triangles are oriented clockwise when looking from the outside, instead of being oriented counter-clockwise. When a clockwise mesh is joined to a counter-clockwise mesh, their volume is subtracted instead of added, and some of the mesh algorithms may return unintuitive or incorrect results. The result of this method is meaningful only for closed meshes that have self-consistent triangle orientation.- Returns:
- true if the TriangleMeshsurface is oriented inside-out
- Since:
- 9.10.2
 
- 
flippedTriangleMesh flipped()Returns a version of thisTriangleMeshwhere all the triangles have flipped normals, with the effect of exchanging the external faces with the internal faces if the mesh is closed. This method can be used to retrieve a corrected version of an inside-out mesh resulting from a transformation that did not preserve the orientation of the triangles in the mesh.- Returns:
- the flipped version of this TriangleMesh
- Since:
- 9.10.2
 
- 
getAreadouble getArea()Returns the total area of the triangles in thisTriangleMesh.- Returns:
- the total area of the triangles in this TriangleMesh
- Since:
- 9.10.2
 
- 
getVolumedouble getVolume()Returns the total volume enclosed by thisTriangleMesh. This method will produce a meaningful result only if theTriangleMeshis closed and does not contain intersecting solids.- Returns:
- the total volume enclosed by this TriangleMesh
- Since:
- 9.10.2
 
- 
shortestPathToReturns the shortest path from thisTriangleMeshto a given point, if such path exists.- Parameters:
- point- the point as- Vector3d
- Returns:
- the shortest path connecting this TriangleMeshto the given point, if it exists
- Since:
- 9.10.2
 
- 
shortestPathToReturns the shortest path from thisTriangleMeshto another, if such path exists.- Parameters:
- other- the other- TriangleMesh
- Returns:
- the shortest path connecting this TriangleMeshto the other, if it exists
- Since:
- 9.10.2
 
- 
shortestVerticalPathToReturns the shortest vertical path from thisTriangleMeshto a point, if such path exists.- Parameters:
- point- the point as- Vector3d
- Returns:
- the shortest vertical path connecting this TriangleMeshto the point, if it exists
- Since:
- 9.10.2
 
- 
shortestVerticalPathToReturns the shortest vertical path from thisTriangleMeshto another, if such path exists.- Parameters:
- other- the other- TriangleMesh
- Returns:
- the shortest vertical path connecting this TriangleMeshto the other, if it exists
- Since:
- 9.10.2
 
- 
shortestHorizontalPathToReturns the shortest horizontal path from thisTriangleMeshto a point, if such path exists.- Parameters:
- point- the point as- Vector3d
- Returns:
- the shortest horizontal path connecting this TriangleMeshto the point, if it exists
- Since:
- 9.10.2
 
- 
shortestHorizontalPathToReturns the shortest horizontal path from thisTriangleMeshto another, if such path exists.- Parameters:
- other- the other- TriangleMesh
- Returns:
- the shortest horizontal path connecting this TriangleMeshto the other, if it exists
- Since:
- 9.10.2
 
- 
shortest2dPathInXYPlaneProjectionToReturns the shortest 2D path from the projection of thisTriangleMeshto the projection of a point in the XY-plane, if such path exists.- Parameters:
- point- the point as- Vector3d
- Returns:
- the shortest 2D path between the projection of the TriangleMeshand the point, if it exists
- Since:
- 9.10.2
 
- 
shortest2dPathInXYPlaneProjectionToReturns the shortest 2D path from the projection of thisTriangleMeshto the projection of anotherTriangleMeshin the XY-plane, if such path exists.- Parameters:
- other- the other- TriangleMesh
- Returns:
- the shortest 2D path between the projections of the two TriangleMeshes, if it exists
- Since:
- 9.10.2
 
 
-