
Mon, 01/20/2014 - 22:51
Forums:
This is what I have so far:
BRepBuilderAPI_MakePolygon builder;
builder.Add(...);
builder.Build();
TopoDS_Wire W = builder.Wire();
if ( W.Closed() )
{
TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
}
I find F is invalid when W have self-intersection. How to fix it?
Thx!
Tue, 01/21/2014 - 13:51
Use CheckSelfIntersection() function in ShapeAnalysis_Wire class.
Tue, 01/21/2014 - 17:04
Thx to rely.
Yes, I found ShapeAnalysis_Wire class and I detect the intersection, but it can not be fixed:
BRepBuilderAPI_MakePolygon ply;
ply.Add();
TopoDS_Wire wire = ply.Wire();
TopoDS_Face face = BRepBuilderAPI_MakeFace(wire);
Standard_Real precision = 1e-04;
ShapeAnalysis_Wire saw (wire, face, precision);
ShapeFix_Wire sfw (wire, face, precision);
if (saw.CheckOrder())
{
sfw.FixReorder();
}
if (saw.CheckSelfIntersection())
{
if (sfw.FixSelfIntersection()) // This function always return false
{
face = sfw.Face();
}
}
So, How can I get the right face?
Wed, 01/22/2014 - 13:42
Did you try to use sfw.Perform()? Maybe FixSelfIntersection requires other fixes first to succeed.
Regards,
Alex