Subject: CGAL users discussion list
List archive
- From: Efi Fogel <>
- To:
- Subject: Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel
- Date: Mon, 30 Apr 2018 00:22:10 +0300
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:17EfQR03ODCS8Q5PsmDT+DRfVm0co7zxezQtwd8Zse0fI/ad9pjvdHbS+e9qxAeQG9mDsLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPbQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLniikHOT43/m/Ul8J+kr5UrQm7qBBj2YPZep2ZOOZ8c67bYNgURXBBXsFUVyFZDY28YYoPBPcBM+ZfoInyuV8Opga5CAayCuPvyzFIhnj53aIk1+QsCg7G3Ak6ENIPtHTYtsn6NKAXUe2syqTD0DvNb/RT2Tjn6YjIdAgsofeWUr1rasXRzVcgGxnZgVWXrIzpJzKV1uIXs2ia9eVsT+yvi3QhpgpsoTav3t8hhpfVio8R0FzJ9iV0zJwoKdC8VkJ3e8OoHZlOuyycKoB4WNktQ3tytyY/0rAGuYC0fCwNyJk/wh7Qcf2Hc4yR7hL7WuadPS50hHx4dL+9mRq+60egyur7Vsm71FZFsDBJncXLtnAIzxDT686HReVh/kq5xzqDywTe5vtHLE00j6bXNposzqAqmpYOs0nPADf6mEDsg6+XckUk9PKo6+PiYrj+uJCcOY50ig/5MqQhhMO/Bf81MgcLX2eB+OS80Kfv8lH+QLVPlvE2iLXWsIjGJcQHoa60GxNa0ok55Ba7FjupzdUYnWIbI1JYYxKHlJPkO0rOIfD9FfewmU6gkDZtx/DcP73uGI/BLnbZkOSpQLBm9kQJyBYv1csNoNVPG7QZKbTyXFXwvZrWFFgiIgmsyqHmDtt6kYgRUGbKDq6CO77Jqgy04bckLOCIIYMUoz3gMOMN5vj0jHZ/l0VOU7Ou2M46ZnHwMPNpLkHRNXfig9kGHmoOlgU7Re3uzlaFVGgAND6JQ6sg62RjW8qdBoDZS9X12e3T7GKABpRTI1t+JBWJGHbseZ+DXq5VOi2XK85l1DcDUOr4EtNz5VSVrAb/joFfAK/M4CRB7MDs0dF046vYkhRgrWUpXfTY6HmESiRPpk1NRzIy2/oh80l0y1PGyaYgxvIBSoYV6PROXQM3c5Xbyr4iBg==
You can use 2D Arrangements.
Here is one way to accomplish the task you describe (perhaps not the most efficient one though---see below for an alternative).
Extend the face type of the arrangement DCEL type with a boolean flag that indicates whether the point set associated with the face is in the intersection.
Construct as many arrangements as lines and for each arrangement mark the (unbounded) face associated with the halfplane defined by the line.
Overlay pairs of arrangements until you are left with the final one. Use an overlay traits that has the method that handles overlapping faces defined to set the flag of the resulting face based on the flags of the two faces of the overlapping faces.
Another way, which might be more efficient, but is a bit more complicated follows.
Extend the face with an integer that counts the number of covering halfplanes.
Insert the lines into the arrangement.
Initialize the counters of all faces to -infinity.
Traverse the arrangement start with a random face. Set the counter of the face to zero.
When you cross an edge examine the direction of the halfedge and the direction of the line associated with the halfedge. Based on the directions figure out whether you enter a halfplane or exit one and increase or decrease the counter, respectively.
When you cross an edge examine the direction of the halfedge and the direction of the line associated with the halfedge. Based on the directions figure out whether you enter a halfplane or exit one and increase or decrease the counter, respectively.
If you have overlapping lines you may either pre-process them (sort them according to their slopes), or also extend the halfedge with a flag that counts, say the net number of lines oriented from left to right.
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
On 29 April 2018 at 01:48, houes <> wrote:
Dear Efi,
Hello. I basically want to do the halfplane intersection either in 2D or 3D
(in 2D, I have a set of oriented lines, in 3D, I have a set of oriented
planes).
In 3D, I have used CGAL::halfspace_intersection_3() to do halfplane
intersections of a set of planes(all planes pass through the Origin and I
add a cap plane to get a closed polyhedra).
My problem can be also solved in 2D: I intersect each of my 3D planes with
one fixed plane Z=1, and I get a set of oriented 2D line, each of these line
define a halfplane. And the halfplanes intersection of these lines give the
result I want: a convex polyhedon.
The problem is no matter I do 2D or 3D, the polyhedron or polyhedra resulted
from halfplane intersection is not necessarily closed: unbounded either in
2D or 3D. Thus the CGAL::halfspace_intersection_3() will throw exception: no
intersection found. After some research, I found the Nef_polyhedron is the
solution: it deal with polyhegon that can be open. Therefore, I want to
convert my lines/planes to Nef_polyhegron::Line or Nef_polyhegron::Plane to
do the intersection, which is equivalently the halfplane intersectin.
The problem I found with Nef_polyhegron is that there is no documentation
that tell me how to use Real number type instead of integer. All my data is
stored in Epick and use double coordinates. Therefore, if would be great if
you can provide me with some clue on this so I can utilize Nef_polyhedron
either in 2D or 3D using the data from Epick.
The solution provided by Adrien Lefieux works for me, but I have problem
converting data from Epick to Nef_polyhedron::Point or Nef_polyhedron::Line,
do you have a solution?
Thank you very much.
houes
--
Sent from: http://cgal-discuss.949826.n4.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
- [cgal-discuss] Nef_polyhedron_2 with Epick kernel, houes, 04/28/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, Adrien Lefieux, 04/28/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, Efi Fogel, 04/28/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, houes, 04/29/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, Efi Fogel, 04/29/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, houes, 04/30/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, Efi Fogel, 04/29/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, houes, 04/29/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, houes, 04/29/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, Efi Fogel, 04/28/2018
- Re: [cgal-discuss] Nef_polyhedron_2 with Epick kernel, Adrien Lefieux, 04/28/2018
Archive powered by MHonArc 2.6.18.