mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-25 17:42:04 +05:00
0021147: EDF GEOM: Difference between compound of line and compound of edges
This commit is contained in:
parent
d846e31631
commit
8f2d0b5697
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||||
#include <BRepAlgoAPI_Section.hxx>
|
#include <BRepAlgoAPI_Section.hxx>
|
||||||
#include <TopAbs.hxx>
|
#include <TopAbs.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
@ -89,12 +90,14 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const
|
|||||||
if (aShape1.IsSame(aShape2)) {
|
if (aShape1.IsSame(aShape2)) {
|
||||||
Standard_ConstructionError::Raise("The end points must be different");
|
Standard_ConstructionError::Raise("The end points must be different");
|
||||||
}
|
}
|
||||||
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
TopoDS_Vertex V1 = TopoDS::Vertex(aShape1);
|
||||||
gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
TopoDS_Vertex V2 = TopoDS::Vertex(aShape2);
|
||||||
|
gp_Pnt P1 = BRep_Tool::Pnt(V1);
|
||||||
|
gp_Pnt P2 = BRep_Tool::Pnt(V2);
|
||||||
if (P1.Distance(P2) < Precision::Confusion()) {
|
if (P1.Distance(P2) < Precision::Confusion()) {
|
||||||
Standard_ConstructionError::Raise("The end points are too close");
|
Standard_ConstructionError::Raise("The end points are too close");
|
||||||
}
|
}
|
||||||
aShape = BRepBuilderAPI_MakeEdge(P1, P2).Shape();
|
aShape = BRepBuilderAPI_MakeEdge(V1, V2).Shape();
|
||||||
|
|
||||||
} else if (aType == LINE_TWO_FACES) {
|
} else if (aType == LINE_TWO_FACES) {
|
||||||
Handle(GEOM_Function) aRefFace1 = aPI.GetFace1();
|
Handle(GEOM_Function) aRefFace1 = aPI.GetFace1();
|
||||||
@ -144,7 +147,8 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const
|
|||||||
if (aShape1.IsSame(aShape2)) {
|
if (aShape1.IsSame(aShape2)) {
|
||||||
Standard_ConstructionError::Raise("The end points must be different");
|
Standard_ConstructionError::Raise("The end points must be different");
|
||||||
}
|
}
|
||||||
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
TopoDS_Vertex Vstart = TopoDS::Vertex(aShape1);
|
||||||
|
gp_Pnt P1 = BRep_Tool::Pnt(Vstart);
|
||||||
|
|
||||||
TopoDS_Edge anE = TopoDS::Edge(aShape2);
|
TopoDS_Edge anE = TopoDS::Edge(aShape2);
|
||||||
TopoDS_Vertex V1, V2;
|
TopoDS_Vertex V1, V2;
|
||||||
@ -157,9 +161,14 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const
|
|||||||
if (PV1.Distance(PV2) < Precision::Confusion()) {
|
if (PV1.Distance(PV2) < Precision::Confusion()) {
|
||||||
Standard_ConstructionError::Raise("Vector with null magnitude");
|
Standard_ConstructionError::Raise("Vector with null magnitude");
|
||||||
}
|
}
|
||||||
|
TopoDS_Vertex Vend;
|
||||||
gp_Pnt P2 (P1.XYZ() + PV2.XYZ() - PV1.XYZ());
|
if ( V1.IsSame( Vstart ) )
|
||||||
aShape = BRepBuilderAPI_MakeEdge(P1, P2).Shape();
|
Vend = V2;
|
||||||
|
else if ( V2.IsSame( Vstart ) )
|
||||||
|
Vend = V1;
|
||||||
|
else
|
||||||
|
Vend = BRepBuilderAPI_MakeVertex( gp_Pnt(P1.XYZ() + PV2.XYZ() - PV1.XYZ()) );
|
||||||
|
aShape = BRepBuilderAPI_MakeEdge(Vstart, Vend).Shape();
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user