# Transformation of 3d point without p.transform

9 messages
Open this post in threaded view
|

## Transformation of 3d point without p.transform

 Hello, how can i change directly the x, y, z, (w) value of an existing point_3 without using transform? I want to apply my own transformation on the point. I want to to change the x, y, and z value for a point in a function and then return the same point with the new values. For example: Point test(1.0,2.0,3.0) Point transformation(Point in) { // in.x(5.3) ??? // in.y(2.3) ??? // in.z(6.4) ??? return in; } transformation(test); -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Transformation of 3d point without p.transform

 Administrator [hidden email] wrote: > Hello, > how can i change directly the x, y, z, (w) value of an existing point_3 without > using transform? > I want to apply my own transformation on the point. I want to to change the x, > y, and z value for a point in a function and then return the same point with > the new values. > > For example: > > Point test(1.0,2.0,3.0) > > Point transformation(Point in) > { > > // in.x(5.3) ??? > // in.y(2.3) ??? > // in.z(6.4) ??? > > return in; > } > > transformation(test); This is actually an FAQ : http://www.cgal.org/FAQ.html#modifiable_kernelUnfortunately, it is not possible to do it with CGAL's kernels currently. The only way to modify a point is to construct a new point, and assign it to the old one, like : p = Point_2(p.x(), p.y()+1); . -- Sylvain Pion INRIA Sophia-Antipolis Geometrica Project-Team CGAL, http://cgal.org/ smime.p7s (5K) Download Attachment
Open this post in threaded view
|

## Re: Re: Transformation of 3d point without

 Thank you. That worked. After doing a transformation and writing the point to a file i can't perform a correct delaunay_triangulation_2 with this points, even if i create a new one. I'm using CGAL::Triangulation_euclidean_traits_xy_3. Can some check the result for the following points (x, y, z)? -1.0 -0.4900 3.00  1.0 -0.0300 1.00  1.0 -0.1600 2.00  1.0 -0.4200 4.00  1.1 -1.3000 2.90  1.1 -1.5000 4.80  2.0 -0.0600 2.00  2.0  0.0690 1.00  2.0 -0.1900 3.00  2.0 -0.4500 5.00  2.0 -0.5100 4.00  3.0  0.0390 2.00  3.0 -0.0900 3.00  3.0 -0.2200 4.00  3.0 -0.3500 5.00  3.0 -0.4200 0.95  3.0 -0.6000 7.00  4.0  0.0095 3.00  4.0 -0.1200 4.00  4.0  0.1400 2.00  4.0 -0.2500 5.00  4.0  0.2700 1.00  4.0 -0.5100 7.00  5.0 -0.0200 4.00  5.0  0.1100 3.00  5.0  0.2400 2.00  5.0 -0.3500 5.00  5.0  0.3700 1.10  6.0  0.2100 3.10  6.0  0.3400 2.10 I tried both, CGAL::Gmpq and the inexact_construction_kernel. But nothing works. -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Transformation of 3d point without

 Hi Matthias, I'm sorry I did not read the whole thread, but what do you mean by "correct" delaunay triangulation? I don't have any problems on your point set. At least there is no error and it computes a triangulation which I suppose to be Delaunay. Only a wild guess: might it be possible that you don't get the triangulation you expect due to roundoff errors in the input set? best Manuel [hidden email] wrote: > Thank you. That worked. > After doing a transformation and writing the point to a file i can't perform a > correct delaunay_triangulation_2 with this points, even if i create a new one. > I'm using CGAL::Triangulation_euclidean_traits_xy_3. > Can some check the result for the following points (x, y, z)? > > -1.0 -0.4900 3.00 >  1.0 -0.0300 1.00 >  1.0 -0.1600 2.00 >  1.0 -0.4200 4.00 >  1.1 -1.3000 2.90 >  1.1 -1.5000 4.80 >  2.0 -0.0600 2.00 >  2.0  0.0690 1.00 >  2.0 -0.1900 3.00 >  2.0 -0.4500 5.00 >  2.0 -0.5100 4.00 >  3.0  0.0390 2.00 >  3.0 -0.0900 3.00 >  3.0 -0.2200 4.00 >  3.0 -0.3500 5.00 >  3.0 -0.4200 0.95 >  3.0 -0.6000 7.00 >  4.0  0.0095 3.00 >  4.0 -0.1200 4.00 >  4.0  0.1400 2.00 >  4.0 -0.2500 5.00 >  4.0  0.2700 1.00 >  4.0 -0.5100 7.00 >  5.0 -0.0200 4.00 >  5.0  0.1100 3.00 >  5.0  0.2400 2.00 >  5.0 -0.3500 5.00 >  5.0  0.3700 1.10 >  6.0  0.2100 3.10 >  6.0  0.3400 2.10 > > I tried both, CGAL::Gmpq and the inexact_construction_kernel. But nothing > works. -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Re: Transformation of 3d point without

 It might be a rounding error. That seems to be quite common when using double values. However if i use the dataset independent from the calculation from which it is produced it still introduces errors at the edges when i display the triangulation. That means, i take that dataset completely new in my triangulation process. So for some datasets it works and for some it doesn't. By correct i mean that there are no intersection of edges in the 3d space. I want to do the triangulation in a plane with 3d points. So there should be no intersection? -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Transformation of 3d point without

 Hi Matthias, make sure you look in the right direction. Using the Triangulation_euclidean_traits_xy_3 you projected the triangulation in the xy plane. Followingly you should look along the z-axis to "see" a Delaunay triangulation, which is the case (at least on my machine). Might it be possible that you expected it to be projected on the xz-plane? Your data set sort of suggests that. In this case you see edge intersections, but that's of course a completely correct behavior. hope this helped Manuel [hidden email] wrote: > It might be a rounding error. That seems to be quite common when using double > values. However if i use the dataset independent from the calculation from > which it is produced it still introduces errors at the edges when i display the > triangulation. That means, i take that dataset completely new in my > triangulation process. So for some datasets it works and for some it doesn't. > > By correct i mean that there are no intersection of edges in the 3d space. I > want to do the triangulation in a plane with 3d points. So there should be no > intersection? -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss
Open this post in threaded view
|

## Re: Re: Transformation of 3d point without

 I checked it from each direction and there is an error. I found that if i set all height values to 0.00 it works fine. So in some way the traits may take the height (z) value into the triangulation. Could this be possible or where else could that error be? -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss