__updated__ = "2020-11-12"
-
#=========================================================================
-# test creating normal to face
+# Initialization of the test
#=========================================================================
-def test_Normal_to_face():
+model.begin()
+partSet = model.moduleDocument()
+
+### Create Part
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
- model.begin()
- file_path = os.path.join(os.getenv("DATA_DIR"),"Shapes","Brep","box1.brep")
- partSet = model.moduleDocument()
- Part_1 = model.addPart(partSet)
- Part_1_doc = Part_1.document()
- Import_1 = model.addImport(Part_1_doc,file_path)
- model.do()
- ### Create Normal
- Normal_1 = model.getNormal(Part_1_doc, model.selection("FACE", "box1_1/Shape_6"))
- model.end()
+### Create Box
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+
+#=========================================================================
+# Test 1. Create a normal to a face with only a face
+#=========================================================================
+Normal_1 = model.getNormal(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+model.do()
- assert (len(Normal_1.results()) > 0)
- assert(Normal_1.feature().error() == "")
- anAxisResult = modelAPI_ResultConstruction(Normal_1.feature().firstResult())
- assert (anAxisResult is not None)
+#=========================================================================
+# Test 2. Create a normal to a face with a face and a vertex
+#=========================================================================
+Normal_2 = model.getNormal(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"))
+model.do()
+model.end()
-if __name__ == '__main__':
+assert (len(Normal_1.results()) > 0)
+assert(Normal_1.feature().error() == "")
+anAxisResult = modelAPI_ResultConstruction(Normal_1.feature().firstResult())
+assert (anAxisResult is not None)
- test_Normal_to_face()
+assert (len(Normal_2.results()) > 0)
+assert(Normal_2.feature().error() == "")
+anAxisResult = modelAPI_ResultConstruction(Normal_2.feature().firstResult())
+assert (anAxisResult is not None)
- #=========================================================================
- # End of test
- #=========================================================================
+#=========================================================================
+# End of test
+#=========================================================================
<source path="fillet1d_widget.xml"/>
</feature>
<feature id="Fillet" title="Fillet" tooltip="Perform fillet on face or edge"
- icon="icons/Features/fillet.png" auto_preview="false" helpfile="filletFeature.html">
+ icon="icons/Features/fillet.png" auto_preview="true" helpfile="filletFeature.html">
<source path="fillet_widget.xml"/>
</feature>
<feature id="Chamfer" title="Chamfer" tooltip="Perform chamfer on face or edge"
<source path="chamfer_widget.xml"/>
</feature>
<feature id="FusionFaces" title="Fuse Faces" tooltip="Performs fusion of connected faces"
- icon="icons/Features/fusion_faces.png" auto_preview="true" helpfile="FeaturesPlugin/fusionFacesFeature.html">
+ icon="icons/Features/fusion_faces.png" auto_preview="true" helpfile="fusionFacesFeature.html">
<source path="fusion_faces_widget.xml"/>
</feature>
<feature id="Defeaturing" title="Defeaturing" tooltip="Perform removing faces from solid"
SET(PROJECT_LIBRARIES
Config
GeomAPI
- ${OpenCASCADE_ApplicationFramework_LIBRARIES}
+ Locale
)
SET(CMAKE_SWIG_FLAGS -threads -w325,321,362,383,302,403,451,473)
ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
${PROJECT_SOURCE_DIR}/src/GeomAPI
${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
${PROJECT_SOURCE_DIR}/src/Locale
- ${OpenCASCADE_INCLUDE_DIR}
- ${OpenCASCADE_DataExchange_LIBRARIES}
- ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
- ${OpenCASCADE_ApplicationFramework_LIBRARIES}
)