mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-06-04 00:37:49 +05:00
IPAL 18046
This commit is contained in:
parent
b0180f476c
commit
76667604e6
@ -76,7 +76,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
|
|||||||
|
|
||||||
TopoDS_Shape aShape;
|
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) aRefBase = aCI.GetBase();
|
||||||
Handle(GEOM_Function) aRefVector = aCI.GetVector();
|
Handle(GEOM_Function) aRefVector = aCI.GetVector();
|
||||||
TopoDS_Shape aShapeBase = aRefBase->GetValue();
|
TopoDS_Shape aShapeBase = aRefBase->GetValue();
|
||||||
@ -92,35 +92,14 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
|
|||||||
}
|
}
|
||||||
if (aV.Magnitude() > Precision::Confusion()) {
|
if (aV.Magnitude() > Precision::Confusion()) {
|
||||||
aV.Normalize();
|
aV.Normalize();
|
||||||
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
|
if (aType == PRISM_BASE_VEC_H_2WAYS) {
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} 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_Trsf aTrsf;
|
||||||
gp_Pnt aP1, aP2;
|
aTrsf.SetTranslation( -aV * aCI.GetH() );
|
||||||
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);
|
BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
|
||||||
aShapeBase = aTransformation.Shape();
|
aShapeBase = aTransformation.Shape();
|
||||||
aShape = BRepPrimAPI_MakePrism(aShapeBase, (aV * aCI.GetH() * 2), Standard_False).Shape();
|
aCI.SetH( aCI.GetH()*2 );
|
||||||
|
}
|
||||||
|
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user