
Fri, 07/10/2015 - 20:59
Hi!
I've got an issue with BRepPrimAPI_MakeRevol if myPnts(2) = gp_Pnt(0.00000035, 8.0, 0.0); !
Trying with myPnts(2) = gp_Pnt(0.0, 8.0, 0.0); build myShape correctly.
Here is the code :
TColgp_Array1OfPnt myPnts(1, 4);
myPnts(1) = gp_Pnt(0.0, 0.0, 0.0);
myPnts(2) = gp_Pnt(0.00000035, 8.0, 0.0); // here is the problem !?
myPnts(3) = gp_Pnt(-81.0, 8.0, 0.0);
myPnts(4) = gp_Pnt(-81.0, 0.0, 0.0);
BRepBuilderAPI_MakeWire myWire;
for (Standard_Integer i = 1; i
{
BRepBuilderAPI_MakeEdge myEdge(myPnts(i), myPnts(i + 1));
myWire.Add(myEdge);
}
TopoDS_Face myFace = BRepBuilderAPI_MakeFace(myWire.Wire());
gp_Ax1 myAxis(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0));
TopoDS_Shape myShape = BRepPrimAPI_MakeRevol(myFace, myAxis).Shape();
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aDoc;
anApp->NewDocument("MDTV-XCAF", aDoc);
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(aDoc->Main());
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
TDF_Label aLabel = myAssembly->NewShape();
myAssembly->SetShape(aLabel, (TopoDS_Shape)myShape);
auto *myWriter = new STEPCAFControl_Writer();
myWriter->Perform(aDoc, "C://tmp//aaa.stp");
Something is wrong with the tolerances but I can't figure what.
Thanks for any help/suggestion !
S.
Sat, 07/11/2015 - 02:15
Hi again,
I invest some more time on this issue and I realize that it's coming from the STEP interface.
IGES and STL are working fine.
IGESControl_Controller::Init();
IGESControl_Writer ICW("MM");
ICW.AddShape(myShape);
ICW.ComputeModel();
Standard_Boolean OK = ICW.Write("C://tmp//aaa.igs"); // correct
STEPControl_Writer writer;
writer.Transfer(myShape, STEPControl_AsIs);
writer.Write("C://tmp//aaa.stp"); // wrong
StlAPI_Writer stlwriter;
stlwriter.Write(myShape, "C://tmp//aaa.stl"); // correct
Any idea or suggestion? I really need a STEP file.
Bye,
S.