std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
double theScaleFactor)
{
+ if (!theCenterPoint) {
+ myError = "Scale builder :: center point is not valid.";
+ return;
+ }
if (fabs(theScaleFactor) < Precision::Confusion()) {
myError = "Scale builder :: the scale factor is null.";
return;
double theScaleFactorY,
double theScaleFactorZ)
{
+ if (!theCenterPoint) {
+ myError = "Scale builder :: center point is not valid.";
+ return;
+ }
if (fabs(theScaleFactorX) < Precision::Confusion()) {
myError = "Scale builder :: the scale factor in X is null.";
return;
double theScaleFactorY,
double theScaleFactorZ)
{
+ if (!theSourceShape) {
+ myError = "Scale builder :: source shape is not valid.";
+ return;
+ }
+
const gp_Pnt& aCenterPoint = theCenterPoint->impl<gp_Pnt>();
// Perform the rotation matrix
try:
MultiRotation_4 = shaperpy.makeMultiRotation(None, ax1, 45., 5)
except myExcept as ec:
- assert(ec.what() == "Rotation builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
try:
MultiRotation_5 = shaperpy.makeMultiRotation(Box_4, None, 45., 5)
try:
MultiRotation_8 = shaperpy.makeMultiRotation(None, ax1, 5)
except myExcept as ec:
- assert(ec.what() == "Rotation builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
try:
MultiRotation_9 = shaperpy.makeMultiRotation(Box_7, None, 5)
try:
Rotation_8 = shaperpy.makeRotation(None, ax1, 180)
except myExcept as ec:
- assert(ec.what() == "Rotation builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
Rotation_9 = shaperpy.makeRotation(Box_8, pntOrigin, pnt1, pnt2)
Rotation_10 = shaperpy.makeRotation(Box_9, pnt3, pnt1, pnt2)
try:
Rotation_17 = shaperpy.makeRotation(None, pntOrigin, pnt3, pnt2)
except myExcept as ec:
- assert(ec.what() == "Rotation builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
try:
Rotation_18 = shaperpy.makeRotation(shape(), ax1, 450)
except myExcept as ec:
- assert(ec.what() == "Rotation builder :: source shape does not contain any actual shape.")
+ assert(ec.what() == "Transformation :: source shape does not contain any actual shape.")
try :
Scale_20 = shaperpy.makeScale(shape(), pntOrigin, 2.)
except myExcept as ec :
- assert(ec.what() == "Scale builder :: source shape does not contain any actual shape.")
+ assert(ec.what() == "Transformation :: source shape does not contain any actual shape.")
try :
Scale_21 = shaperpy.makeScale(shape(), pntOrigin, 2., 3., 1.)
try :
Symmetry_7 = shaperpy.makeSymmetry(None, pnt1)
except myExcept as ec :
- assert(ec.what() == "Symmetry builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
try :
Symmetry_8 = shaperpy.makeSymmetry(None, axZ)
except myExcept as ec :
- assert(ec.what() == "Symmetry builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
try :
Symmetry_9 = shaperpy.makeSymmetry(None, planeXOY)
except myExcept as ec :
- assert(ec.what() == "Symmetry builder :: source shape is not valid.")
+ assert(ec.what() == "Transformation :: incorrect input data.")
try :
Symmetry_10 = shaperpy.makeSymmetry(shape(), pnt1)
except myExcept as ec :
- assert(ec.what() == "Symmetry builder :: source shape does not contain any actual shape.")
+ assert(ec.what() == "Transformation :: source shape does not contain any actual shape.")
model.testNbResults(Scale_6, 0)
-assert(Scale_6.feature().error() == 'Scale builder :: the scale factor is null.')
+assert(Scale_6.feature().error() == 'Error: Scale algorithm failed. Scale builder :: the scale factor is null.')
model.testNbResults(Scale_8, 0)
assert(Scale_8.feature().error() == 'Attribute "center_point" is not initialized.')
model.testNbResults(Scale_14, 0)
-assert(Scale_14.feature().error() == 'Scale builder :: the scale factor in X is null.')
+assert(Scale_14.feature().error() == 'Error: Scale algorithm failed. Scale builder :: the scale factor in X is null.')
model.testNbResults(Scale_15, 0)
-assert(Scale_15.feature().error() == 'Scale builder :: the scale factor in Y is null.')
+assert(Scale_15.feature().error() == 'Error: Scale algorithm failed. Scale builder :: the scale factor in Y is null.')
model.testNbResults(Scale_16, 0)
-assert(Scale_16.feature().error() == 'Scale builder :: the scale factor in Z is null.')
+assert(Scale_16.feature().error() == 'Error: Scale algorithm failed. Scale builder :: the scale factor in Z is null.')
model.testNbResults(Scale_18, 0)
assert(Scale_18.feature().error() == 'Attribute "center_point" is not initialized.')