mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-13 18:20:35 +05:00
0022353: EDF GEOM: Projection on a edge or a wire
This commit is contained in:
parent
c68d12d8ad
commit
2adadf979b
@ -344,14 +344,36 @@ Standard_Integer GEOMImpl_ProjectionDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
|
|
||||||
// Store the valid solution.
|
// Store the valid solution.
|
||||||
hasValidSolution = Standard_True;
|
hasValidSolution = Standard_True;
|
||||||
|
|
||||||
|
// Normalize parameter.
|
||||||
|
TopoDS_Edge aSupportEdge = TopoDS::Edge(aSupportShape);
|
||||||
|
Standard_Real aF, aL;
|
||||||
|
|
||||||
|
BRep_Tool::Range(aSupportEdge, aF, aL);
|
||||||
|
|
||||||
|
if (Abs(aL - aF) <= aTolConf) {
|
||||||
|
Standard_ConstructionError::Raise
|
||||||
|
("Projection aborted : degenerated projection edge");
|
||||||
|
}
|
||||||
|
|
||||||
|
aParam = (aParam - aF)/(aL - aF);
|
||||||
aProj.SetU(aParam);
|
aProj.SetU(aParam);
|
||||||
|
|
||||||
// Compute edge index.
|
// Compute edge index.
|
||||||
TopTools_IndexedMapOfShape anIndices;
|
TopExp_Explorer anExp(aShape, TopAbs_EDGE);
|
||||||
TopExp::MapShapes(aShape, anIndices);
|
int anIndex = 0;
|
||||||
const int anIndex = anIndices.FindIndex(aSupportShape);
|
|
||||||
|
|
||||||
aProj.SetIndex(anIndex);
|
for (; anExp.More(); anExp.Next(), anIndex++) {
|
||||||
|
if (aSupportShape.IsSame(anExp.Current())) {
|
||||||
|
aProj.SetIndex(anIndex);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!anExp.More()) {
|
||||||
|
Standard_ConstructionError::Raise
|
||||||
|
("Projection aborted : Can't define edge index");
|
||||||
|
}
|
||||||
|
|
||||||
// Construct a projection vertex.
|
// Construct a projection vertex.
|
||||||
const gp_Pnt &aPntProj = aDistShSh.PointOnShape2(i);
|
const gp_Pnt &aPntProj = aDistShSh.PointOnShape2(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user