mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-28 11:40:33 +05:00
0023357: EDF 13600 - Problem of partition
This commit is contained in:
parent
cb20b7f5dd
commit
a5ebfce8d1
@ -1236,62 +1236,10 @@ TCollection_AsciiString GEOMImpl_Block6Explorer::MakeFace (const TopoDS_Wire&
|
|||||||
// we will try to build a non-planar face.
|
// we will try to build a non-planar face.
|
||||||
|
|
||||||
TCollection_AsciiString aWarning;
|
TCollection_AsciiString aWarning;
|
||||||
|
BRepBuilderAPI_MakeFace MK (theWire, isPlanarWanted);
|
||||||
// Workaround for Mantis issue 0020956
|
if (MK.IsDone()) {
|
||||||
|
theResult = MK.Shape();
|
||||||
// Count the number of points in the wire.
|
return aWarning;
|
||||||
// Collect the first three points.
|
|
||||||
gp_Pnt p1, p2, p3;
|
|
||||||
bool is3Pnts (false);
|
|
||||||
bool p1set(false), p2set(false), p3set(false);
|
|
||||||
BRepTools_WireExplorer wexpl (theWire);
|
|
||||||
for (; wexpl.More(); wexpl.Next()) {
|
|
||||||
if (!p1set) {
|
|
||||||
p1set = true;
|
|
||||||
p1 = BRep_Tool::Pnt(wexpl.CurrentVertex());
|
|
||||||
}
|
|
||||||
else if (!p2set) {
|
|
||||||
p2set = true;
|
|
||||||
p2 = BRep_Tool::Pnt(wexpl.CurrentVertex());
|
|
||||||
}
|
|
||||||
else if (!p3set) {
|
|
||||||
p3set = true;
|
|
||||||
is3Pnts = true;
|
|
||||||
p3 = BRep_Tool::Pnt(wexpl.CurrentVertex());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
is3Pnts = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construct a plane for the case of three points in the wire.
|
|
||||||
gp_Pln plane;
|
|
||||||
if (is3Pnts) {
|
|
||||||
gce_MakePln mkPln (p1, p2, p3);
|
|
||||||
if (mkPln.IsDone()) {
|
|
||||||
plane = mkPln.Value();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
is3Pnts = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construct a face based on the plane (in case of three points in the wire) or
|
|
||||||
// allow MakeFace to build the plane itself (in case of the number of points is greater than 3).
|
|
||||||
if (is3Pnts) {
|
|
||||||
BRepBuilderAPI_MakeFace MK (plane, theWire, isPlanarWanted);
|
|
||||||
if (MK.IsDone()) {
|
|
||||||
theResult = MK.Shape();
|
|
||||||
return aWarning;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BRepBuilderAPI_MakeFace MK (theWire, isPlanarWanted);
|
|
||||||
if (MK.IsDone()) {
|
|
||||||
theResult = MK.Shape();
|
|
||||||
return aWarning;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to update wire tolerances to build a planar face
|
// try to update wire tolerances to build a planar face
|
||||||
|
Loading…
Reference in New Issue
Block a user