Transformation of 3d point without p.transform

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Transformation of 3d point without p.transform

Mazman
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
Reply | Threaded
Open this post in threaded view
|

Re: Transformation of 3d point without p.transform

Sylvain Pion
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_kernel

Unfortunately, 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Transformation of 3d point without

Mazman
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
Reply | Threaded
Open this post in threaded view
|

Re: Transformation of 3d point without

Manuel Caroli
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Transformation of 3d point without

Mazman
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
Reply | Threaded
Open this post in threaded view
|

Re: Transformation of 3d point without

Manuel Caroli
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Transformation of 3d point without

Mazman
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
Reply | Threaded
Open this post in threaded view
|

Re: Transformation of 3d point without

Manuel Caroli
[hidden email] wrote:
> 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?
The Triangulation_euclidean_traits_xy_3.h does not take the z-value into
account.

I'm sorry, as I wrote before I'm not able to reproduce your problem.
Please find attached the triangulation that I computed from your data
set. I don't see any problem with it.

Maybe I still don't understand your problem but as far as what I see
from the data set you should probably rather use
Triangulation_euclidean_traits_xz_3.h

If your problem still persists, please try to isolate it and describe it
in a more precise way. See also http://www.cgal.org/bug_report.html.

best

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

OFF
150 50 0
1 -0.42 4
2 -0.19 3
1 -0.16 2
1 -0.03 1
-1 -0.49 3
1 -0.16 2
1 -0.16 2
2 -0.06 2
1 -0.03 1
1 -0.42 4
1.1 -1.3 2.9
2 -0.51 4
-1 -0.49 3
1 -0.42 4
1 -0.16 2
-1 -0.49 3
1.1 -1.3 2.9
1 -0.42 4
2 0.069 1
4 0.27 1
1 -0.03 1
-1 -0.49 3
1.1 -1.5 4.8
1.1 -1.3 2.9
1.1 -1.5 4.8
2 -0.51 4
1.1 -1.3 2.9
2 -0.19 3
3 -0.09 3
2 -0.06 2
2 -0.06 2
2 0.069 1
1 -0.03 1
2 -0.06 2
3 0.039 2
2 0.069 1
1 -0.16 2
2 -0.19 3
2 -0.06 2
2 -0.45 5
3 -0.35 5
2 -0.19 3
1 -0.42 4
2 -0.45 5
2 -0.19 3
3 0.039 2
4 0.0095 3
4 0.14 2
1 -0.42 4
2 -0.51 4
2 -0.45 5
3 -0.09 3
4 0.0095 3
3 0.039 2
2 -0.51 4
3 -0.42 0.95
2 -0.45 5
2 -0.51 4
1.1 -1.5 4.8
3 -0.6 7
2 -0.06 2
3 -0.09 3
3 0.039 2
3 -0.22 4
4 -0.12 4
3 -0.09 3
2 -0.19 3
3 -0.22 4
3 -0.09 3
3 -0.35 5
4 -0.25 5
3 -0.22 4
2 -0.19 3
3 -0.35 5
3 -0.22 4
3 -0.42 0.95
4 -0.51 7
3 -0.35 5
2 -0.45 5
3 -0.42 0.95
3 -0.35 5
2 -0.51 4
3 -0.6 7
3 -0.42 0.95
3 -0.6 7
4 -0.51 7
3 -0.42 0.95
4 -0.12 4
5 -0.02 4
4 0.0095 3
3 -0.09 3
4 -0.12 4
4 0.0095 3
4 -0.25 5
5 -0.35 5
4 -0.12 4
3 0.039 2
4 0.14 2
4 0.27 1
4 0.0095 3
5 -0.02 4
5 0.11 3
3 -0.22 4
4 -0.25 5
4 -0.12 4
3 -0.6 7
1.1 -1.5 4.8
4 -0.51 7
3 0.039 2
4 0.27 1
2 0.069 1
4 0.14 2
4 0.0095 3
5 0.11 3
3 -0.35 5
4 -0.51 7
4 -0.25 5
4 -0.51 7
5 -0.35 5
4 -0.25 5
4 0.14 2
5 0.11 3
5 0.24 2
5 -0.02 4
5 -0.35 5
6 0.21 3.1
4 0.14 2
5 0.24 2
4 0.27 1
5 0.11 3
5 -0.02 4
6 0.21 3.1
4 -0.12 4
5 -0.35 5
5 -0.02 4
4 -0.51 7
1.1 -1.5 4.8
5 -0.35 5
5 0.24 2
5 0.37 1.1
4 0.27 1
5 0.24 2
6 0.21 3.1
6 0.34 2.1
5 0.24 2
5 0.11 3
6 0.21 3.1
5 0.24 2
6 0.34 2.1
5 0.37 1.1
3 0 1 2
3 3 4 5
3 6 7 8
3 9 10 11
3 12 13 14
3 15 16 17
3 18 19 20
3 21 22 23
3 24 25 26
3 27 28 29
3 30 31 32
3 33 34 35
3 36 37 38
3 39 40 41
3 42 43 44
3 45 46 47
3 48 49 50
3 51 52 53
3 54 55 56
3 57 58 59
3 60 61 62
3 63 64 65
3 66 67 68
3 69 70 71
3 72 73 74
3 75 76 77
3 78 79 80
3 81 82 83
3 84 85 86
3 87 88 89
3 90 91 92
3 93 94 95
3 96 97 98
3 99 100 101
3 102 103 104
3 105 106 107
3 108 109 110
3 111 112 113
3 114 115 116
3 117 118 119
3 120 121 122
3 123 124 125
3 126 127 128
3 129 130 131
3 132 133 134
3 135 136 137
3 138 139 140
3 141 142 143
3 144 145 146
3 147 148 149
Reply | Threaded
Open this post in threaded view
|

Re: Transformation of 3d point without

Laurent Rineau (GeometryFactory)
In reply to this post by Mazman
On Friday 27 February 2009 14:46:18 [hidden email] wrote:
> 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?

At the point, it seems clear to me that there are a lot of misunderstanding in
the discussion.

Matthias, you should set us a small but compilable code that shows the faulty
behavious, and tell us what you except. Maybe you should the best practice to
report a bug:
  http://www.cgal.org/report_bugs.html
Following that maximize your chance to get useful help from the mailing list.

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/

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