Topology to Geometry

Hi,
This is my third day with opencascade.Please excuse me if I am asking something wrong.
My objective is to create a Topological body first.
ie: a face consisting of a few edges.
I want to assign Geometry to these entities later.
I read various docs : modalg.pdf,modat.pdf,tutorial.pdf.But could not find the solution to this.
Thanks,
Nitin.

Pawel's picture

You may try this:

//make sur you assign the coordinates x1, x2, ...z3

BRepBuilderAPI_MakePolygon MP;
gp_Pnt P(x1,y1,z1);
MP.Add(P);
gp_Pnt P1(x2,y2,z2);
MP.Add(P1);
gp_Pnt P2(x3,y3,z3);
MP.Add(P2);

MP.Close();
TopoDS_Wire W = MP.Wire();

TopoDS_Face aFace = BRepBuilderAPI_MakeFace(W);

Good luck
Pawel

Pawel's picture

Maybe you may try this:

//make sure you have assigned variables x1, x2, ...z3
BRepBuilderAPI_MakePolygon MP;
gp_Pnt P(x1,y1,z1);
MP.Add(P);
gp_Pnt P1(x2,y2,z2);
MP.Add(P1);
gp_Pnt P2(x3,y3,z3);
MP.Add(P2);
MP.Close();

TopoDS_Wire W = MP.Wire();
TopoDS_Face aFace = BRepBuilderAPI_MakeFace(W);

Good luck
Pawel

Ntin's picture

Thanks...That works fine