|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.amibe.ds.Vertex
public class 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.
There is a special vertex, Mesh.outerVertex
, which represents a
vertex at infinite. It is used to create exterior triangles.
Each vertex has a pointer to an incident Triangle
,
which allows to find any other incident VirtualHalfEdge
or
Triangle
. For non-manifold vertices, this link points
to a Triangle []
array, which can be used to retrieve
all incident triangles through their adjacency relations.
Field Summary | |
---|---|
protected int |
label
|
protected java.lang.Object |
link
|
protected double[] |
param
2D or 3D coordinates. |
protected int |
ref1d
|
protected Traits |
traits
|
protected VertexTraitsBuilder |
traitsBuilder
|
Constructor Summary | |
---|---|
protected |
Vertex(VertexTraitsBuilder vtb)
Constructor. |
|
Vertex(VertexTraitsBuilder vtb,
double x,
double y,
double z)
Create a Vertex for a 3D mesh. |
Method Summary | |
---|---|
double |
angle3D(Vertex n1,
Vertex n2)
Returns the angle at which a segment is seen. |
void |
copy(Vertex that)
Copy all attributes from another Vertex. |
boolean |
discreteCurvatureDirections(double[] normal,
double[] t1,
double[] t2)
Compute the discrete local frame at this vertex. |
double |
discreteCurvatures(double[] meanNormal)
Returns the discrete Gaussian curvature and the mean normal. |
boolean |
discreteProject(Vertex pt)
Project a point on the approximated surface. |
double |
distance3D(Vertex end)
Returns the distance in 3D space. |
AbstractHalfEdge |
getIncidentAbstractHalfEdge(Triangle t,
AbstractHalfEdge ot)
|
int |
getLabel()
Get node label. |
java.lang.Object |
getLink()
Get a finite element containing this Vertex. |
double[] |
getLocalQuadric(Matrix3D P)
|
Matrix3D |
getMatrix3DLocalFrame()
|
java.util.Collection<Vertex> |
getNeighboursNodes()
Get the list of adjacent vertices. |
int |
getRef()
Gets 1D reference of this node. |
double[] |
getUV()
Gets coordinates of this vertex. |
boolean |
isManifold()
Tells whether this vertex is manifold. |
boolean |
isMutable()
Check whether this vertex can be modified. |
boolean |
isReadable()
|
boolean |
isWritable()
|
void |
moveTo(double x,
double y,
double z)
Sets 3D coordinates of this vertex. |
void |
outer3D(Vertex n1,
Vertex n2,
double[] work1,
double[] work2,
double[] ret)
Returns the outer product of two vectors. |
void |
projectQuadric(double[] origin,
Matrix3D P,
double[] q)
|
void |
setLabel(int l)
Set node label. |
void |
setLink(java.lang.Object o)
Set link to a finite element containing this Vertex. |
void |
setLinkFan(java.util.Collection<Triangle> triangles)
Set link to an array of Triangles. |
void |
setReadable(boolean r)
|
void |
setRef(int l)
Sets 1D reference of this node. |
void |
setWritable(boolean w)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final VertexTraitsBuilder traitsBuilder
protected final Traits traits
protected final double[] param
protected int ref1d
protected java.lang.Object link
protected int label
Constructor Detail |
---|
protected Vertex(VertexTraitsBuilder vtb)
public Vertex(VertexTraitsBuilder vtb, double x, double y, double z)
vtb
- traits builderx
- first coordinate.y
- second coordinate.z
- third coordinate.Method Detail |
---|
public void copy(Vertex that)
that
- the Vertex to be copied.public int getRef()
public void setRef(int l)
l
- 1D reference of this nodepublic double[] getUV()
public void moveTo(double x, double y, double z)
x
- first coordinate of the new positiony
- second coordinate of the new positionz
- third coordinate of the new positionpublic double distance3D(Vertex end)
end
- the node to which distance is computed.
end
.public double angle3D(Vertex n1, Vertex n2)
n1
- first noden2
- second node
public void outer3D(Vertex n1, Vertex n2, double[] work1, double[] work2, double[] ret)
n1
- end point of the first vectorn2
- end point of the second vectorwork1
- double[3] temporary arraywork2
- double[3] temporary arrayret
- array which will store the outer product of the two vectorspublic int getLabel()
public void setLabel(int l)
l
- node label.public java.lang.Object getLink()
Triangle
instance for manifold vertices,
and a Triangle []
array otherwise.public void setLink(java.lang.Object o)
o
- object linked to this Vertex.public AbstractHalfEdge getIncidentAbstractHalfEdge(Triangle t, AbstractHalfEdge ot)
public void setLinkFan(java.util.Collection<Triangle> triangles)
triangles
- initial set of adjacent triangles.public void setReadable(boolean r)
public void setWritable(boolean w)
public boolean isReadable()
public boolean isWritable()
public final boolean isManifold()
true
if vertex is manifold, false
otherwisepublic java.util.Collection<Vertex> getNeighboursNodes()
public boolean isMutable()
true
if this vertex can be modified,
false.
public double discreteCurvatures(double[] meanNormal)
public boolean discreteCurvatureDirections(double[] normal, double[] t1, double[] t2)
public boolean discreteProject(Vertex pt)
F(x,y) = a x^2 + b xy + c y^2 - z
.
To that end, the local frame at the current vertex is
computed. The (x,y)
coordinates of neighbour
vertices are computed in that frame, and we search for the quadric
which fits best for all neighbour vertices (in a least squares
sense). The vertex is then projected onto this quadric.
Note1: Several improvements exist in the litterature, see eg.
this paper
by Anshuman Razdan and MyungSoo Bae for a survey of several
methods.
Note2: According to Pascal J. Frey, the key point is to have
reliable input. We can have good approximation of quadrics
if the normal to the surface is accurate, and normal to the
surface can be approximated accurately if the quadric is
precise. So we should certainly read normals from a file
if they are available.
pt
- point to project on the approximated surface.
true
if projection has been performed
successfully, false
otherwise.public void projectQuadric(double[] origin, Matrix3D P, double[] q)
public Matrix3D getMatrix3DLocalFrame()
public double[] getLocalQuadric(Matrix3D P)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |