Subject: CGAL users discussion list
List archive
- From: "Ioannis Mademlis" <>
- To:
- Subject: Re: [cgal-discuss] [CGAL] - Intersection de polyèdres
- Date: Tue, 12 Dec 2006 18:03:30 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=jaBzaE3gfU2U0iIMIgjWBte7Zy8bdZ6/8JwWTY+QpN3zaZUN0wGXQ+DPggqE2txr2Qil/DsqlYgOqeYa7zSOXX1OWIbBpCzuodj+1MxZJbPBsN7W1LgOTeqaxy7dzzVk4DukHNFLIBum0r/P+dRQeCoJZN7suU7iLcD447LJebI=
Could you please write in English?
Thnx
Bonjour,
Je suis novice avec la librairie CGAL et j'utilise pour la 1ere fois cette mailing-list (je ne connais donc pas les uses et coutumes).
En tout cas, j'utiliserais pour cela le Français pour communiquer. Et mon message s'adresse à des développeur CGAL.Je cherche à calculer un polyèdre correspondant l'intersection de 2 polyèdres 3D. Mes polyèdres sont des cones de vues constitués d'un sommet et d'une base constituée de n points (correspondant à n points d'un contour sur un plan. L'objectif final étant de reconstruire un visual hull à partir de contour 2D de la silhouette d'une forme).
Voici mon code :
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/IO/Polyhedron_VRML_2_ostream.h>
#include <iostream>
#include <CGAL/Gmpz.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
typedef CGAL::Homogeneous<CGAL::Gmpz> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Polyhedron::Point_3 Point;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
int main() {
Point p_top(10.0f, 10.0f, 0.0f);
Point p_center(10.0f, 10.0f, -40.0f);
Point p1(20.0f, 5.0f, -40.0f);
Point p2(5.0f, 5.0f, -40.0f);
Point p3(5.0f, 30.0f, -40.0f);
Point p4(15.0f, 30.0f, -40.0f);
Point p5(25.0f, 10.0f, -40.0f);
Polyhedron P;
P.make_tetrahedron(p_top, p_center, p1, p2);
P.make_tetrahedron(p_top, p_center, p2, p3);
P.make_tetrahedron(p_top, p_center, p3, p4);
P.make_tetrahedron(p_top, p_center, p4, p5);
P.make_tetrahedron(p_top, p_center, p5, p1);
Point p2_top(20.0f, 10.0f, -10.0f);
Point p2_center(-20.0f, 10.0f, -30.0f);
Point p21(-20.0f, 5.0f, 0.0f);
Point p22(-20.0f, 5.0f, -25.0f);
Point p23(-20.0f, 30.0f, -25.0f);
Point p24(-20.0f, 30.0f, -5.0f);
Point p25(-20.0f, 10.0f, 5.0f);
Polyhedron P2;
P2.make_tetrahedron(p2_top, p2_center, p21, p22);
P2.make_tetrahedron(p2_top, p2_center, p22, p23);
P2.make_tetrahedron(p2_top, p2_center, p23, p24);
P2.make_tetrahedron(p2_top, p2_center, p24, p25);
P2.make_tetrahedron(p2_top, p2_center, p25, p21);
CGAL::VRML_2_ostream out( std::cout);
out << (Polyhedron)P;
out << (Polyhedron)P2;
return (1);
}J'y crée 2 polyèdre P et P2 (qui possède une zone d'intersection).
Mon problème est comment calculer le polyèdre d'intersection ?
J'ai essayé de le faire en utilisant la classe Nef_Polyedron et ces opération booléenne. Or:
il est impossible de créer un Nef_Polyhedron directement à partir d'un Polyhedron tel que P et P2
ex: Nef_polyhedron N1(P); -> plante CGAL
idem lorsque j'assaie de créer un Nef_Polyhedron en faisant l'union de tetrahedron (sans passer ?
Ex: Nef_polyhedron N1(P_tetra); // Nb de vertices de N1 résultat = 4
Nef_polyhedron N2(P_tetra2);
N1 += N2; // Nb de vertices de N1 résultat = 0 !!
Est-il possible de calculer l'intersection de polyèdre complexe avec CGAL ?
Merci d'avance à toute les personnes qui prendront le temps de répondre à mes questions.
Cédric.
- [CGAL] - Intersection de polyèdres, Cédric LE MAITRE, 12/12/2006
- Re: [cgal-discuss] [CGAL] - Intersection de polyèdres, Peter Hachenberger, 12/12/2006
- Re: [cgal-discuss] Intersection of polyhedron, Cédric LE MAITRE, 12/12/2006
- Re: [cgal-discuss] Intersection of polyhedron, Peter Hachenberger, 12/12/2006
- Re: [cgal-discuss] Intersection of polyhedron, Cédric LE MAITRE, 12/13/2006
- Re: [cgal-discuss] Intersection of polyhedron, Peter Hachenberger, 12/13/2006
- Re: [cgal-discuss] Intersection of polyhedron, Cédric LE MAITRE, 12/13/2006
- Re: [cgal-discuss] Intersection of polyhedron, Peter Hachenberger, 12/12/2006
- Re: [cgal-discuss] Intersection of polyhedron, Cédric LE MAITRE, 12/12/2006
- Re: [cgal-discuss] [CGAL] - Intersection de polyèdres, Ioannis Mademlis, 12/12/2006
- Re: [cgal-discuss] [CGAL] - Intersection de polyèdres, Peter Hachenberger, 12/12/2006
Archive powered by MHonArc 2.6.16.