Skip to Content.
Sympa Menu

cgal-discuss - AW: [cgal-discuss] Global Arrangement Transformation

Subject: CGAL users discussion list

List archive

AW: [cgal-discuss] Global Arrangement Transformation


Chronological Thread 
  • From: "Christian Asche" <>
  • To: <>
  • Subject: AW: [cgal-discuss] Global Arrangement Transformation
  • Date: Wed, 8 Aug 2012 13:53:11 +0200

Thank you for your answer,

 

Let me show you my code snippet with two alternatives.

Assume a arrangement mesh with four vertices at point coordinates (0,0), (0,1), (1,0) and (1,1).

T is a scaling transformation matrix, which scales the the mesh with the factor 1000 in x- and y-direction.

 

// Datatype definitions

typedef CGAL::Aff_transformation_2<Kernel> AffTransform2d; 

typedef Traits2d::Point_2 PointI;

 

// Snippet

assert (arr->is_valid());  // works

for (TMesh::Vertex_iterator vIt = this->vertices_begin(); vIt != this->vertices_end(); vIt++)

{

// first version

       Vertex_handle vh = arr->modify_vertex(vIt, vIt->point());

       PointI pNew(T.transform(vh->point()));

       vh->point() = vh->point().transform(T);

 

       // second version

       vIt->point() = vIt->point().transform(T);

}

assert (arr->is_valid());  // does not work

 

I can use both the first and the second version, but the final assertion fails with the following message:

                                                                                                                   

CGAL warning: check violation!

_expression_ : is_halfedge_valid

File       : C:\Users\asche\Programmierung\cpp\CGAL_build\include\CGAL/Arra

nt_2/Arrangement_on_surface_2_impl.h

Line       : 4911

Explanation: Invalid halfedge.

Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.h

Assertion failed: this->is_valid(), file src\geometry\tmesh.cpp, line 330

 

The hard way to solve this in my project is writing the mesh into a proprietary file and reading it back into a „fresh“ mesh. But this takes time…

 

Thanks again

 

C.Asche

 

Von: [mailto:] Im Auftrag von Efi Fogel
Gesendet: Mittwoch, 8. August 2012 10:21
An:
Betreff: Re: [cgal-discuss] Global Arrangement Transformation

 

You can change the coordinates of points as long as you don't change the topology of the arrangement.
Scaling does not change the topology. You need to scale all points by traversing them one at a time.
Naturally, an intermediate state might be invalid.

On Wed, Aug 8, 2012 at 11:13 AM, casche <> wrote:

Hello,

is there any way to apply a global transformation to an arrangment (i.e.
scaling or translation)?

I tried to modify the point-references of the arrangements vertices (Point2&
point()), and it works somehow, but finally invalidates (?) the mesh. I
guess, this reference should not be used for modification of the underlying
point coordinates.

At least, I need a scaling of the point coordinates. Any idea?

Thank you



--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Global-Arrangement-Transformation-tp4655678.html
Sent from the cgal-discuss mailing list archive at Nabble.com.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




--

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/

 




Archive powered by MHonArc 2.6.18.

Top of Page