Maybe the problem are some edges.
I've tried to make a not closed wire and the BRepPrimAPI_MakePrism constructor create a solid with also the 2 basis face that the explorer found, but the 2 basis don't exist so I can't make triangulation.
My profile is created with some segments that I build with:
TopoDS_Edge currentEdge = BRepBuilderAPI_MakeEdge(startPoint,endPoint);
And with some arcs of circle described with 3 coordinates (center, startPoint and endPoint) and a normal. The draw sense is determined with the right-hand rule.
To create the edge from the arc I made two algorithm, one is more accurate but when I build the prism I haven't the 2 basis, the second is less accurate (the arc traced have a little translation of the center), but the prism is build correctly.
The 1st algorithm (no prism basis):
gp_Pnt c = coplanarPoints(cIndex);
gp_Pnt p1 = coplanarPoints(p1Index);
gp_Pnt p2 = coplanarPoints(p2Index);
gp_Vec normal = sbVec3f2gp_Vec(arcsNormals[i]);
gp_Dir normalDir(normal);
Standard_Real radius = c.Distance(p1);
gce_MakeCirc circ(c, normalDir, radius);
Handle(Geom_TrimmedCurve) arcOfCircle = GC_MakeArcOfCircle (circ, p1, p2, true);
TopoDS_Edge arcEdge = BRepBuilderAPI_MakeEdge(arcOfCircle);
//another strange thing of this algorithm is that if I change the last parameter of GC_MakeArcOfCircle the sense of the traced arc doesn't change.
The 2nd algorithm (prism basis exist):
gp_Pnt c = coplanarPoints(cIndex);
gp_Pnt p1 = coplanarPoints(p1Index);
gp_Pnt p2 = coplanarPoints(p2Index);
gp_Vec p1c(p1.XYZ()-c.XYZ());
gp_Vec tangent = sbVec3f2gp_Vec(prev2dStep->arcsNormals[i]) ^ p1c;
Handle(Geom_TrimmedCurve) arcOfCircle = GC_MakeArcOfCircle(p1,tangent ,p2);
TopoDS_Edge arcEdge = BRepBuilderAPI_MakeEdge(arcOfCircle);
I prefer the first algorithm because it's more accurate, but I can't understand why this edge doesnt'like to makeprism constructor.
Thanks for your attention.
Massimo