From: dmv Date: Wed, 5 Dec 2007 13:36:26 +0000 (+0000) Subject: IPAL 18046 X-Git-Tag: V3_2_9~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=76667604e6cf0ece8d845348dd7924658436bef2;p=modules%2Fgeom.git IPAL 18046 --- diff --git a/src/GEOMImpl/GEOMImpl_PrismDriver.cxx b/src/GEOMImpl/GEOMImpl_PrismDriver.cxx index 1818018b0..31ca722c5 100644 --- a/src/GEOMImpl/GEOMImpl_PrismDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PrismDriver.cxx @@ -76,7 +76,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape aShape; - if (aType == PRISM_BASE_VEC_H) { + if (aType == PRISM_BASE_VEC_H || aType == PRISM_BASE_VEC_H_2WAYS) { Handle(GEOM_Function) aRefBase = aCI.GetBase(); Handle(GEOM_Function) aRefVector = aCI.GetVector(); TopoDS_Shape aShapeBase = aRefBase->GetValue(); @@ -92,38 +92,17 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const } if (aV.Magnitude() > Precision::Confusion()) { aV.Normalize(); + if (aType == PRISM_BASE_VEC_H_2WAYS) { + gp_Trsf aTrsf; + aTrsf.SetTranslation( -aV * aCI.GetH() ); + BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False); + aShapeBase = aTransformation.Shape(); + aCI.SetH( aCI.GetH()*2 ); + } aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape(); } } } - } else if (aType == PRISM_BASE_VEC_H_2WAYS) { - Handle(GEOM_Function) aRefBase = aCI.GetBase(); - Handle(GEOM_Function) aRefVector = aCI.GetVector(); - TopoDS_Shape aShapeBase = aRefBase->GetValue(); - TopoDS_Shape aShapeVec = aRefVector->GetValue(); - if (aShapeVec.ShapeType() == TopAbs_EDGE) { - TopoDS_Edge anE = TopoDS::Edge(aShapeVec); - TopoDS_Vertex V1, V2; - gp_Trsf aTrsf; - gp_Pnt aP1, aP2; - TopExp::Vertices(anE, V1, V2, Standard_True); - if (!V1.IsNull() && !V2.IsNull()) { - gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2)); - if (Abs(aCI.GetH()) < Precision::Confusion()) { - Standard_ConstructionError::Raise("Absolute value of prism height is too small"); - } - if (aV.Magnitude() > Precision::Confusion()) { - gp_Vec aVec; - aV.Normalize(); - aVec.Normalize(); - aVec = aV * (-aCI.GetH()); - aTrsf.SetTranslation(aVec); - BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False); - aShapeBase = aTransformation.Shape(); - aShape = BRepPrimAPI_MakePrism(aShapeBase, (aV * aCI.GetH() * 2), Standard_False).Shape(); - } - } - } } else if (aType == PRISM_BASE_TWO_PNT || aType == PRISM_BASE_TWO_PNT_2WAYS) { Handle(GEOM_Function) aRefBase = aCI.GetBase(); Handle(GEOM_Function) aRefPnt1 = aCI.GetFirstPoint();