org.jcae.mesh.amibe.patch
Class Vertex2D

java.lang.Object
  extended by org.jcae.mesh.amibe.ds.Vertex
      extended by org.jcae.mesh.amibe.patch.Vertex2D
All Implemented Interfaces:
java.io.Serializable

public class Vertex2D
extends Vertex

Vertex of a mesh. When meshing a CAD surface, a vertex has two parameters and a metrics in its tangent plane is computed so that a unit mesh in this metrics comply with user constraints. When the underlying surface is defined by the 3D mesh itself, a vertex has three parameters and the surface is locally interpolated by a quadrics computed from vertex neighbours.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jcae.mesh.amibe.ds.Vertex
label, link, param, ref1d, traits, traitsBuilder
 
Constructor Summary
protected Vertex2D(VertexTraitsBuilder vtb)
           
  Vertex2D(VertexTraitsBuilder vtb, double u, double v)
          Create a Vertex for a 2D mesh.
 
Method Summary
 void centroid(Vertex2D[] v)
          Move to the 2D centroid of a list of vertices.
 void clearMetrics()
          Clear the 2D Riemannian metrics at this point.
 long distance2(Mesh2D mesh, Vertex2D that)
           
 Metric2D getMetrics(Mesh2D mesh)
          Get the 2D Riemannian metrics at this point.
 double[] getNormal(Mesh2D mesh)
          Get the normal to the surface at this location.
 VirtualHalfEdge2D getSurroundingOTriangle(Mesh2D mesh)
          Return a triangle containing this point.
 boolean inCircleTest2(Mesh2D mesh, VirtualHalfEdge2D ot)
           
 boolean inCircleTest3(Mesh2D mesh, VirtualHalfEdge2D ot)
           
 boolean isPseudoIsotropic(Mesh2D mesh)
           
 boolean isSmallerDiagonale(Mesh2D mesh, VirtualHalfEdge2D ot)
           
static Vertex2D middle(Vertex2D pt1, Vertex2D pt2)
          Create a Vertex in the middle of two 2D Vertex.
 void moveTo(double u, double v)
          Set the coordinates of this Vertex (2D).
 long onLeft(Mesh2D mesh, Vertex2D v1, Vertex2D v2)
          Test the position of this vertex with respect to a segment.
 java.lang.String toString()
           
static Vertex2D valueOf(MNode1D pt, CADGeomCurve2D C2d, CADFace F)
          Create a Vertex from a boundary node.
 
Methods inherited from class org.jcae.mesh.amibe.ds.Vertex
angle3D, copy, discreteCurvatureDirections, discreteCurvatures, discreteProject, distance3D, getIncidentAbstractHalfEdge, getLabel, getLink, getLocalQuadric, getMatrix3DLocalFrame, getNeighboursNodes, getRef, getUV, isManifold, isMutable, isReadable, isWritable, moveTo, outer3D, projectQuadric, setLabel, setLink, setLinkFan, setReadable, setRef, setWritable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vertex2D

protected Vertex2D(VertexTraitsBuilder vtb)

Vertex2D

public Vertex2D(VertexTraitsBuilder vtb,
                double u,
                double v)
Create a Vertex for a 2D mesh.

Parameters:
vtb - traits builder
u - first coordinate.
v - second coordinate.
Method Detail

middle

public static Vertex2D middle(Vertex2D pt1,
                              Vertex2D pt2)
Create a Vertex in the middle of two 2D Vertex.

Parameters:
pt1 - first node.
pt2 - second node.

valueOf

public static Vertex2D valueOf(MNode1D pt,
                               CADGeomCurve2D C2d,
                               CADFace F)
Create a Vertex from a boundary node.

Parameters:
pt - node on a boundary edge.
C2d - 2D curve on the face.
F - topological face.

moveTo

public void moveTo(double u,
                   double v)
Set the coordinates of this Vertex (2D).

Parameters:
u - first coordinate of the new position
v - second coordinate of the new position

getNormal

public double[] getNormal(Mesh2D mesh)
Get the normal to the surface at this location.

Returns:
the normal to the surface at this location.

centroid

public void centroid(Vertex2D[] v)
Move to the 2D centroid of a list of vertices.

Parameters:
v - array

getSurroundingOTriangle

public VirtualHalfEdge2D getSurroundingOTriangle(Mesh2D mesh)
Return a triangle containing this point. The returned oriented triangle T is noted (oda), and this algorithm makes sure that there are only three possible situations at exit:
  1. No vertex of T is Mesh.outerVertex, and 'this' is interior to T.
  2. No vertex of T is Mesh.outerVertex, and 'this' is on an edge of T.
  3. Apex is Mesh.outerVertex, and this.onLeft(d,o) < 0.
Origin and destination points are always different from Mesh.outerVertex.

Returns:
a triangle containing this point.
See Also:
VirtualHalfEdge2D.split3(org.jcae.mesh.amibe.patch.Mesh2D, org.jcae.mesh.amibe.patch.Vertex2D, java.util.Set, boolean)

onLeft

public long onLeft(Mesh2D mesh,
                   Vertex2D v1,
                   Vertex2D v2)
Test the position of this vertex with respect to a segment. Integer coordinates are used with 2D Euclidian metric to provide exact computations. This is important because this method is called by getSurroundingOTriangle(org.jcae.mesh.amibe.patch.Mesh2D) to find the triangle enclosing a vertex, or by VirtualHalfEdge2D.forceBoundaryEdge(Mesh2D,Vertex2D) to compute segment intersection.

Parameters:
mesh - underlying Mesh2D instance
v1 - first vertex of the segment
v2 - second vertex of the segment
Returns:
the signed area of the triangle composed of these three vertices. It is positive if the vertex is on the left of this segment, and negative otherwise.

inCircleTest2

public final boolean inCircleTest2(Mesh2D mesh,
                                   VirtualHalfEdge2D ot)

inCircleTest3

public final boolean inCircleTest3(Mesh2D mesh,
                                   VirtualHalfEdge2D ot)

isSmallerDiagonale

public final boolean isSmallerDiagonale(Mesh2D mesh,
                                        VirtualHalfEdge2D ot)

isPseudoIsotropic

public boolean isPseudoIsotropic(Mesh2D mesh)

distance2

public final long distance2(Mesh2D mesh,
                            Vertex2D that)

getMetrics

public Metric2D getMetrics(Mesh2D mesh)
Get the 2D Riemannian metrics at this point. This metrics is computed and then stored into a private instance member. This cached value can be discarded by calling clearMetrics().

Parameters:
mesh - underlying Mesh2D instance
Returns:
the 2D Riemannian metrics at this point.

clearMetrics

public void clearMetrics()
Clear the 2D Riemannian metrics at this point.


toString

public java.lang.String toString()
Overrides:
toString in class Vertex