mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
Minor fixes to handle boundary values of the angle for the portion of cylinder primitive.
This commit is contained in:
parent
f971466504
commit
474f3f8098
@ -3055,10 +3055,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
|
||||
if flag:
|
||||
theA = theA*math.pi/180.
|
||||
anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
|
||||
RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
|
||||
anObj.SetParameters(Parameters)
|
||||
self._autoPublish(anObj, theName, "cylinder")
|
||||
if theA<=0. or theA>=2*math.pi:
|
||||
raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
|
||||
anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
|
||||
RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
|
||||
anObj.SetParameters(Parameters)
|
||||
self._autoPublish(anObj, theName, "cylinder")
|
||||
return anObj
|
||||
|
||||
## Create a cylinder with given radius and height at
|
||||
@ -3136,6 +3138,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
|
||||
if flag:
|
||||
theA = theA*math.pi/180.
|
||||
if theA<=0. or theA>=2*math.pi:
|
||||
raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
|
||||
anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
|
||||
RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
|
||||
anObj.SetParameters(Parameters)
|
||||
|
@ -411,7 +411,7 @@ bool PrimitiveGUI_CylinderDlg::isValid (QString& msg)
|
||||
{
|
||||
ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) &&
|
||||
GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) &&
|
||||
( GroupDimensions->checkBox->isChecked() || GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) );
|
||||
( !GroupDimensions->checkBox->isChecked() || GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) );
|
||||
if ( GroupDimensions->checkBox->isChecked() &&
|
||||
( GroupDimensions->SpinBox_DZ->value() <= 0. || GroupDimensions->SpinBox_DZ->value() >= 360. ) ) {
|
||||
msg += tr("GEOM_CYLINDER_ANGLE_ERR") + "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user