Dear  Jan Möbius ,
Thank you very much for answering our questions.
We understood the second topic.

For the first topic, thank you for asking our suggestion to define/compute it.

In curvature.cc,
Please change:
for(; voh_it; ++voh_it, ++n_voh_it)
  {
    typename MeshT::Point p1 = _mesh.point(_mesh.to_vertex_handle(   voh_it));
    typename MeshT::Point p2 = _mesh.point(_mesh.to_vertex_handle( n_voh_it));

    gauss_curv -= acos(OpenMesh::sane_aarg( ((p1-p0).normalize() | (p2-p0).normalize()) ));
  }

to:

bool isBoundaryVertex_ = _triMesh->is_boundary(_vh);

for(; voh_it; ++voh_it, ++n_voh_it)
  {

if(( isBoundaryVertex_ ) && !(n_voh_it))
break;

    typename MeshT::Point p1 = _mesh.point(_mesh.to_vertex_handle(   voh_it));
    typename MeshT::Point p2 = _mesh.point(_mesh.to_vertex_handle( n_voh_it));

    gauss_curv -= acos(OpenMesh::sane_aarg( ((p1-p0).normalize() | (p2-p0).normalize()) ));
  }

In this way, we can avoid calculating the unnecessary facet  for boundary vertices.

With Regards,
Xianyong


2012/10/31 <openflipper-request@lists.rwth-aachen.de>
Send Openflipper mailing list submissions to
        openflipper@lists.rwth-aachen.de

To subscribe or unsubscribe via the World Wide Web, visit
        http://mailman.rwth-aachen.de/mailman/listinfo/openflipper
or, via email, send a message with subject or body 'help' to
        openflipper-request@lists.rwth-aachen.de

You can reach the person managing the list at
        openflipper-owner@lists.rwth-aachen.de

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Openflipper digest..."


Today's Topics:

   1. Re: Bug in computing Gaussian curvature in openfliiper
      (Jan Möbius)
   2. Re: How to get face area and how to iterate vertices of a
      face in counterclockwise (Jan Möbius)


----------------------------------------------------------------------

Message: 1
Date: Wed, 31 Oct 2012 08:16:23 +0100
From: Jan Möbius <moebius@cs.rwth-aachen.de>
To: openflipper@lists.rwth-aachen.de
Subject: Re: [Openflipper] Bug in computing Gaussian curvature in
        openfliiper
Message-ID: <5090D047.9090704@cs.rwth-aachen.de>
Content-Type: text/plain; charset=UTF-8

Hi,

i think the gaussian curvature is not well defined on the boundary. The
current computation computes it, as if the one ring is complete, which
is just an approximation of course.

How would you suggest to define/compute it?

Best,
Jan Möbius

On 25.10.2012 04:39, ??? wrote:
> Dear openfliiper,
> Concerning the problem we sent last night.
> We put two examples here. From the output,
> we can see that for boundary vertex, the current way returns an
> unnecessary face(shown in bold font).
>
> Besides, could you please help us how to iterate all incident vertices
> in a face in counterclockwise.
>
>
>>>>>>>> example one: 553 is a boundary vertex
>
> -------------------------- retrieve by incident half edges
> (553,517);(553,482)
> (553,482);(553,516)
> (553,516);(553,464)
> (553,464);(553,603)
> *(553,603);(553,517)*
>
> --------------------------retrieve by incident faces
> (553,517);(553,482)
> (553,482);(553,516)
> (553,516);(553,464)
> (553,603);(553,464)
>
>
>>>>>>>> example two: 509 is an interior vertex
>
> -------------------------- retrieve by incident half edges
> (509,507);(509,534)
> (509,534);(509,549)
> (509,549);(509,535)
> (509,535);(509,510)
> (509,510);(509,492)
> (509,492);(509,491)
> (509,491);(509,507)
>
> --------------------------retrieve by incident faces
> (509,507);(509,491)
> (509,534);(509,507)
> (509,549);(509,534)
> (509,535);(509,549)
> (509,535);(509,510)
> (509,492);(509,510)
> (509,492);(509,491)
>
> Best Regards,
> Xianyong Liu.
>
>
> 2012/10/24 ??? <xyliu80@gmail.com <mailto:xyliu80@gmail.com>>
>
>     Dear openfliiper,
>
>     We think, In Curvature.cc, the calculation for Gaussian curvature is
>     wrong.
>
>     The fact is that the number of incident angles(facets) overs a
>     boundary vertex is one less than then number of incident vertices
>     (edges) over it.
>
>     Below is the existing calculation.
>     It should judge whether the vertex is a boundary one or not!
>
>     --------------- Curvature.cc --------------
>     for(; voh_it; ++voh_it, ++n_voh_it)
>       {
>         typename MeshT::Point p1 = _mesh.point(_mesh.to_vertex_handle(
>     voh_it));
>         typename MeshT::Point p2 = _mesh.point(_mesh.to_vertex_handle(
>     n_voh_it));
>
>         gauss_curv -= acos(OpenMesh::sane_aarg( ((p1-p0).normalize() |
>     (p2-p0).normalize()) ));
>       }
>
>     Best Regards,
>     Xianyong Liu.
>
>
>
>
> _______________________________________________
> Openflipper mailing list
> Openflipper@lists.rwth-aachen.de
> http://mailman.rwth-aachen.de/mailman/listinfo/openflipper


--
Dipl.Inform. Jan Möbius
Department of Computer Science VIII
Aachen University of Technology (RWTH)
Ahornstrasse 55, 52074 Aachen, Germany

Phone   ++49 (0)241 80-21817
Fax     ++49 (0)241 80-22899
mailto:moebius@cs.rwth-aachen.de
http://www.rwth-graphics.de


------------------------------

Message: 2
Date: Wed, 31 Oct 2012 08:46:38 +0100
From: Jan Möbius <moebius@cs.rwth-aachen.de>
To: openflipper@lists.rwth-aachen.de
Subject: Re: [Openflipper] How to get face area and how to iterate
        vertices of a face in counterclockwise
Message-ID: <5090D75E.9070701@cs.rwth-aachen.de>
Content-Type: text/plain; charset=UTF-8

Hi,

On 25.10.2012 18:01, ??? wrote:
> Dear Openflipper,
>
> We have two questions. Hopefully we can get answers from you.
>
> 1). We can not use the following formula to get the right face area .
>  0.5* (((p1-p0) * (p2-p0)).norm());
> For instance, the right value should be 0.145643363, but we got 0.0874207.
>
> x     y       z
> 0.2649        0.1398  4.8136
> 0.7567        0.0491  4.8185
> 0.6181        -0.0791         4.2549
>
> i     j       k
> 0.4918        -0.0907         0.0049
> 0.3532        -0.2189         -0.5587
>
> 0.0517467     0.27649934      -0.07562
> 0.002677721   0.076451885     0.005718        0.084848
>                       0.145643
>

The area is defined via the cross product, but you use the scalar
product. Changing your function to
0.5* (((p1-p0) % (p2-p0)).norm());
will fix it.


> 2). How to iterate vertices of a face in counterclockwise?

There is no fixed function for this, but you can simply walk around your
vertex on your own:

Take one outgoing halfedge ohe;

To go counterclockwise to the next halfedge do:
he = mesh.prev_halfedge_handle(he);
he = opposite_halfedge_handle(he);

To get the vertices, Just use
mesh.to_vertex_handle(he);

Best,
Jan Möbius


--
Dipl.Inform. Jan Möbius
Department of Computer Science VIII
Aachen University of Technology (RWTH)
Ahornstrasse 55, 52074 Aachen, Germany

Phone   ++49 (0)241 80-21817
Fax     ++49 (0)241 80-22899
mailto:moebius@cs.rwth-aachen.de
http://www.rwth-graphics.de


------------------------------

_______________________________________________
Openflipper mailing list
Openflipper@lists.rwth-aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/openflipper


End of Openflipper Digest, Vol 32, Issue 10
*******************************************