
Mon, 04/14/2008 - 06:16
when i try the code to determinate the type of surface i use BRepAdaptor_Surface.
my code:
//Retourner la surface geometrique de la face current(acurrentFace)
TopLoc_Location location;
Handle(Geom_Surface) aGeometricSurface=BRep_Tool::Surface(acurrentFace,location);
BRepAdaptor_Surface asurface(acurrentFace,Standard_True);
Standard_Real U1, U2, V1, V2;
U1=asurface.FirstUParameter();
U2=asurface.LastUParameter();
V1=asurface.FirstVParameter();
V2=asurface.LastVParameter();
gp_Pnt acentreofface;
gp_Vec aVec1, aVec2, anormalofface;
asurface.D1((U1+U2)/2, (V1+V2)/2,acentreofface, aVec1, aVec2);
anormalofface=aVec1^aVec2;
cout cout
//! Retourner le type de la surface : Plane, Cylinder,
//! Cone, Sphere, Torus, BezierSurface,
//! BSplineSurface, SurfaceOfRevolution,
//!SurfaceOfExtrusion, OtherSurface
GeomAbs_SurfaceType gettype=asurface.GetType();
if(gettype=GeomAbs_Plane){
cout
}
if(gettype=GeomAbs_Cylinder){
cout
}
if(gettype=GeomAbs_Cone){
cout
}
if(gettype=GeomAbs_Torus){
cout
}
if(gettype=GeomAbs_Sphere){
cout
}
if(gettype=GeomAbs_BezierSurface){
cout
}
if(gettype=GeomAbs_BSplineSurface){
cout
}
if(gettype=GeomAbs_SurfaceOfRevolution){
cout
}
if(gettype=GeomAbs_SurfaceOfExtrusion){
cout
}
if(gettype=GeomAbs_OffsetSurface){
cout
}
if(gettype=GeomAbs_OtherSurface){
cout }
the type of my surface is plane(i know this) but when i try this code he return all other surface (cylinder, sphere, bspline,........).
question n°2=how i can try the point of contrôl of surface?
i don't know why...........please evry one help me for this .........i needed in my project.......think you all.
Mon, 04/14/2008 - 11:01
Instead of using the assignment operator = such as
if (gettype=GeomAbs_Plane) { ...
use the equality comparator == like so
if (gettype==GeomAbs_Plane) {...
Pete
Mon, 04/14/2008 - 16:55
think you for your reply Pete
the problem it's resolved. but how can i try the point of control of any surface(plane, cylinder, bspline,bezier.....)
think you very much ........