mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-19 04:10:38 +05:00
IPAL21270 Repair > Change Orientation for 1D. It seems as Invert object has same orientation as initial one.
This commit is contained in:
parent
a99792b9bd
commit
d85c68a11f
@ -4,7 +4,7 @@
|
||||
|
||||
\n To <b>Change Orientation</b> in the <b>Main Menu</b> select <b>Repair - > Change Orientation</b>.
|
||||
\n This operation reverses the normals of selected faces or the normal
|
||||
of faces composing composing the selected opened shell.
|
||||
of faces composing the selected opened shell. Or, reverses the edge or wire orientation (direction).
|
||||
|
||||
\n <b>TUI Command:</b> <em>geompy.ChangeOrientation(shape)</em>
|
||||
\n <b>Arguments:</b> Name + one or several objects (face(s)), opened shell(s).
|
||||
|
@ -217,14 +217,23 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
|
||||
double fp,lp;
|
||||
gp_Vec aDirVec;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(anEdgeE,fp,lp);
|
||||
C->D1(lp, aP2, aDirVec);
|
||||
if ( anEdgeE.Orientation() == TopAbs_FORWARD )
|
||||
C->D1(lp, aP2, aDirVec);
|
||||
else {
|
||||
C->D1(fp, aP1, aDirVec);
|
||||
aP2 = aP1;
|
||||
}
|
||||
|
||||
GeomAdaptor_Curve aAdC;
|
||||
aAdC.Load(C, fp, lp);
|
||||
Standard_Real aDist = GCPnts_AbscissaPoint::Length(aAdC, fp, lp);
|
||||
|
||||
if (aDist > gp::Resolution()) {
|
||||
gp_Dir aDir (aDirVec);
|
||||
gp_Dir aDir;
|
||||
if ( anEdgeE.Orientation() == TopAbs_FORWARD )
|
||||
aDir = aDirVec;
|
||||
else
|
||||
aDir = -aDirVec;
|
||||
Prs3d_Arrow::Draw(aPrs, aP2, aDir, PI/180.*5., aDist/10.);
|
||||
}
|
||||
}
|
||||
|
@ -174,14 +174,24 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
|
||||
double fp,lp;
|
||||
gp_Vec aDirVec;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(theEdge,fp,lp);
|
||||
C->D1(lp, aP2, aDirVec);
|
||||
if ( theEdge.Orientation() == TopAbs_FORWARD ) {
|
||||
C->D1(lp, aP2, aDirVec);
|
||||
} else {
|
||||
C->D1(fp, aP1, aDirVec);
|
||||
aP2 = aP1;
|
||||
}
|
||||
|
||||
GeomAdaptor_Curve aAdC;
|
||||
aAdC.Load(C, fp, lp);
|
||||
Standard_Real aDist = GCPnts_AbscissaPoint::Length(aAdC, fp, lp);
|
||||
if (aDist < gp::Resolution()) return;
|
||||
|
||||
gp_Dir aDirection (aDirVec);
|
||||
gp_Dir aDirection;
|
||||
|
||||
if ( theEdge.Orientation() == TopAbs_FORWARD )
|
||||
aDirection = aDirVec;
|
||||
else
|
||||
aDirection = -aDirVec;
|
||||
|
||||
Standard_Real anAngle = PI/180.*5.;
|
||||
Standard_Real aLength = aDist/10.;
|
||||
|
@ -73,11 +73,14 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
|
||||
}
|
||||
myResultShape.Reverse();
|
||||
}
|
||||
else if (myInitShape.ShapeType() == TopAbs_WIRE) {
|
||||
myResultShape = myInitShape.Reversed();
|
||||
}
|
||||
else if (myInitShape.ShapeType() == TopAbs_EDGE) {
|
||||
myResultShape = myInitShape.Reversed();
|
||||
else if ( myInitShape.ShapeType() == TopAbs_WIRE || myInitShape.ShapeType() == TopAbs_EDGE) {
|
||||
myResultShape = myInitShape.EmptyCopied();
|
||||
TopoDS_Iterator itr(myInitShape);
|
||||
while (itr.More()) {
|
||||
B.Add(myResultShape,itr.Value());
|
||||
itr.Next();
|
||||
}
|
||||
myResultShape.Reverse();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user