From 037a722713176fd612875dee8708b484e168c08b Mon Sep 17 00:00:00 2001 From: spo Date: Fri, 30 Oct 2015 11:10:49 +0300 Subject: [PATCH] Add TestMakeBrick1.py. --- src/PythonAPI/CMakeLists.txt | 2 ++ src/PythonAPI/MakeBrick1.py | 12 +++++------- src/PythonAPI/Test/TestMakeBrick1.py | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 src/PythonAPI/Test/TestMakeBrick1.py diff --git a/src/PythonAPI/CMakeLists.txt b/src/PythonAPI/CMakeLists.txt index b6ab797df..8d3e0cab4 100644 --- a/src/PythonAPI/CMakeLists.txt +++ b/src/PythonAPI/CMakeLists.txt @@ -30,4 +30,6 @@ ADD_UNIT_TESTS( TestFeaturesExtrusion.py TestFeaturesRevolution.py + + TestMakeBrick1.py ) diff --git a/src/PythonAPI/MakeBrick1.py b/src/PythonAPI/MakeBrick1.py index ceead3f69..dd064fbd8 100644 --- a/src/PythonAPI/MakeBrick1.py +++ b/src/PythonAPI/MakeBrick1.py @@ -38,28 +38,26 @@ mybase.setPerpendicular( l1.result(), l4.result() ) mywidth = mybase.setLength( l1.result(), 50 ) mylength = mybase.setDistance( l1.startPointData(), l3.result(), 50 ) - # Creating the extrusion mybox = model.addExtrusion( mypart, mybase.selectFace(), 50 ) - # Creating a cylinder on a face of the box -thisface = "Extrusion_1/LateralFace_2" -thisxmin = "Extrusion_1/LateralFace_3|Extrusion_1/LateralFace_2" -thisxmax = "Extrusion_1/LateralFace_2|Extrusion_1/LateralFace_1" +thisface = "Extrusion_1_1/LateralFace_2" +thisxmin = "Extrusion_1_1/LateralFace_3|Extrusion_1_1/LateralFace_2" +thisxmax = "Extrusion_1_1/LateralFace_2|Extrusion_1_1/LateralFace_1" thiszmin = "Sketch_1/Edge5_1" -thiszmax = "Extrusion_1/LateralFace_2|Extrusion_1/TopFace_1" +thiszmax = "Extrusion_1_1/LateralFace_2|Extrusion_1_1/ToFace_1" mystand = model.addSketch( mypart, thisface ) + c1 = mystand.addCircle( 0, 25, 5) mystand.setDistance( c1.centerData(), thisxmin, 10 ) mystand.setDistance( c1.centerData(), thiszmax, 10 ) myboss = model.addExtrusion( mypart, mystand.selectFace(c1.result()), -5 ) - # Subtracting the cylinder to the box model.addSubtraction( mypart, mybox.result(), myboss.result() ) diff --git a/src/PythonAPI/Test/TestMakeBrick1.py b/src/PythonAPI/Test/TestMakeBrick1.py new file mode 100644 index 000000000..237ae03aa --- /dev/null +++ b/src/PythonAPI/Test/TestMakeBrick1.py @@ -0,0 +1,6 @@ +import unittest + +import MakeBrick1 + +if __name__ == "__main__": + unittest.main() -- 2.39.2