aBooleanFt = aPart.addFeature("Boolean")
aBooleanFt.selectionList("main_objects").append(modelAPI_ResultCompSolid(extrudedObjects[0]).subResult(1), None)
aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], None)
+aBooleanType = 0
+aBooleanFt.integer("bool_type").setValue(aBooleanType)
+aBooleanFt.execute()
+aSession.finishOperation()
+
+assert (len(aBooleanFt.results()) > 0)
+aBooleanResult = modelAPI_ResultBody(aBooleanFt.firstResult())
+assert (aBooleanResult is not None)
+aSession.undo()
+
+#=========================================================================
+# Fuse
+#=========================================================================
+aSession.startOperation()
+aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt.selectionList("main_objects").append(modelAPI_ResultCompSolid(extrudedObjects[0]).subResult(1), None)
+aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], None)
aBooleanType = 1
aBooleanFt.integer("bool_type").setValue(aBooleanType)
aBooleanFt.execute()
assert (len(aPartitionFt.results()) > 0)
aPartitionResult = modelAPI_ResultBody(aPartitionFt.firstResult())
assert (aPartitionResult is not None)
+aSession.undo()
+
+#=========================================================================
+# Create a partition
+#=========================================================================
+aSession.startOperation()
+aPartitionFt = aPart.addFeature("Partition")
+assert (aPartitionFt.getKind() == "Partition")
+aPartitionFt.selectionList("main_objects").append(anExtrusionResult, anExtrusionResult.shape())
+aPartitionFt.selectionList("tool_objects").append(aPlaneResult, None)
+aPartitionFt.boolean("partition_combine").setValue(False)
+aPartitionFt.execute()
+aSession.finishOperation()
+
+#=========================================================================
+# Test results
+#=========================================================================
+aFactory = ModelAPI_Session.get().validators()
+assert (aFactory.validate(aPartitionFt))
+assert (len(aPartitionFt.results()) > 0)
+aPartitionResult = modelAPI_ResultBody(aPartitionFt.firstResult())
+assert (aPartitionResult is not None)
# Check revol results
assert (len(aRevolFt.results()) > 0)
aRevolResult = modelAPI_ResultBody(aRevolFt.firstResult())
-assert (aRevolResult is not None)
\ No newline at end of file
+assert (aRevolResult is not None)
+aSession.undo()
+
+#=========================================================================
+# Test revol between bounding plane
+#=========================================================================
+aSession.startOperation()
+aRevolFt = aPart.addFeature("Revolution")
+assert (aRevolFt.getKind() == "Revolution")
+# selection type FACE=4
+aRevolFt.selectionList("base").append(
+ aCircleSketchResult, aCircleSketchFaces[0])
+aRevolFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
+aRevolFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
+aRevolFt.real("from_angle").setValue(0) #TODO: remove
+aRevolFt.real("to_angle").setValue(0) #TODO: remove
+aRevolFt.selection("to_object").setValue(aToResult, None)
+aRevolFt.real("to_offset").setValue(0)
+aRevolFt.selection("from_object").setValue(None, None)
+aRevolFt.real("from_offset").setValue(0)
+aRevolFt.execute()
+aSession.finishOperation()
+
+# Check revol results
+assert (len(aRevolFt.results()) > 0)
+aRevolResult = modelAPI_ResultBody(aRevolFt.firstResult())
+assert (aRevolResult is not None)