Class GeometricOperations
Provides methods to perform geometric operations.
Inheritance
Inherited Members
Namespace: Fusee.Jometri
Assembly: Fusee.Jometri.dll
Syntax
public static class GeometricOperations
Methods
CalculateFaceNormal(IList<Vertex>)
Calculates a face normal from three vertices. The vertices have to be coplanar and part of the face.
Declaration
public static float3 CalculateFaceNormal(IList<Vertex> faceOuterVertices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Vertex> | faceOuterVertices | All vertices of the outer boundary of the face. |
Returns
Type | Description |
---|---|
float3 |
GetHalfEdgesWChangedWinding(Geometry, IEnumerable<HalfEdge>)
Returns the half edges from a source collection of half edges - with opposite direction.
Declaration
public static IEnumerable<HalfEdge> GetHalfEdgesWChangedWinding(this Geometry geometry, IEnumerable<HalfEdge> originHEdges)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | |
System.Collections.Generic.IEnumerable<HalfEdge> | originHEdges |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<HalfEdge> |
GetVerticesMeanPos(List<Vertex>)
Calculates the mean Vertex position of given Vertices.
Declaration
public static float3 GetVerticesMeanPos(List<Vertex> vertices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Vertex> | vertices | List of all Vertices which are part of the new mean position. |
Returns
Type | Description |
---|---|
float3 | Returns the position of the mean of all Vertices as a float3. |
IsAngleGreaterOrEqualPi(Geometry, Face, Vertex, Vertex, Vertex)
Determines if the angle between two vectors, formed by three vertices, is greater or equal 180°. The first vector will be created from v1 and v2, the second from v2 and v3.
Declaration
public static bool IsAngleGreaterOrEqualPi(this Geometry geom, Face face, Vertex v1, Vertex v2, Vertex v3)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry the vertices belong to. |
Face | face | The face the vertices belong to. |
Vertex | v1 | Vertex one |
Vertex | v2 | Vertex two |
Vertex | v3 | Vertex three |
Returns
Type | Description |
---|---|
System.Boolean |
IsAngleGreaterPi(Geometry, Face, Vertex, Vertex, Vertex)
Determines whether the angle between two vectors formed by three vertices is greater than 180 °. The first vector will be created from v1 and v2, the second from v2 and v3.
Declaration
public static bool IsAngleGreaterPi(this Geometry geom, Face face, Vertex v1, Vertex v2, Vertex v3)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry the vertices belong to. |
Face | face | The face the vertices belong to. |
Vertex | v1 | Vertex one |
Vertex | v2 | Vertex two |
Vertex | v3 | Vertex three |
Returns
Type | Description |
---|---|
System.Boolean |
IsCounterClockwise(IList<float3>)
Checks whether a polygon, parallel to the xy plane, has a ccw winding. This method does NOT support polygons parallel to the yz or xz plane! To guarantee a correct output make sure the polygon doesn't degenerate when the z coordinates are ignored.
Declaration
public static bool IsCounterClockwise(this IList<float3> source)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<float3> | source | The polygon, represented as list of float3s. |
Returns
Type | Description |
---|---|
System.Boolean |
IsLineIntersectingLine(float3, float3, float3, float3, out float3)
Checks if two lines intersect.
Declaration
public static bool IsLineIntersectingLine(float3 p1, float3 p2, float3 p3, float3 p4, out float3 intersectionPoint)
Parameters
Type | Name | Description |
---|---|---|
float3 | p1 | First control point of the first line. |
float3 | p2 | Second control point of the first line. |
float3 | p3 | First point of the second line. |
float3 | p4 | Second point of the second line. |
float3 | intersectionPoint | The intersection point, if the lines do not intersect this will be float3 Infinity. |
Returns
Type | Description |
---|---|
System.Boolean |
IsPointInPolygon(Geometry, Face, Vertex)
Tests if a point/vertex lies inside or outside a face - only works for polygons parallel to a plane!
Declaration
public static bool IsPointInPolygon(this Geometry geometry, Face face, Vertex v)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The geometry the polygon (here: face) belongs to. |
Face | face | The faces to be tested. |
Vertex | v | The vertex to be tested. |
Returns
Type | Description |
---|---|
System.Boolean |
IsPointInPolygon(Geometry, Face, float3)
Tests if a point/vertex lies inside or outside a face - Only use this if you know the face AND vertex lie in the same plane and this plane is parallel to xy or xz or yz!
Declaration
public static bool IsPointInPolygon(this Geometry geometry, Face face, float3 v)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The geometry the polygon (here: face) belongs to. |
Face | face | The faces to be tested. It will not be Reduced2D! |
float3 | v | The vertex to be tested. |
Returns
Type | Description |
---|---|
System.Boolean |
IsVertexAdjacentToVertex(Geometry, Int32, Int32, HalfEdge, HalfEdge)
Tests if a vertex is a direct neighbor of an other vertex. Only use this method if you know the incident half edges of the vertex.
Declaration
public static bool IsVertexAdjacentToVertex(this Geometry geometry, int p, int q, HalfEdge vertPStartHe, HalfEdge vertQStartHe)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The geometry the vertex belongs to. |
System.Int32 | p | First vertex |
System.Int32 | q | Second vertex |
HalfEdge | vertPStartHe | p incident half edge. |
HalfEdge | vertQStartHe | q incident half edge. |
Returns
Type | Description |
---|---|
System.Boolean |