bl_info = {
        "name": "BisectAxis28",
        "author": "Olivier Borne",
        "version": 1,
        "blender": (2, 80, 0),
        "location": "View3D > Tool Shelf",
        "description": "In Edit Mode, Bisect on X, Y Z axis",
        "category": "Mesh"}
        
import bpy

# Bisect Axis
#
# Keep + Z axix
class Coupebas(bpy.types.Operator):
    bl_idname = "object.coupebas"
    bl_label = "Keep + Z"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 0, 1), clear_inner=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}
        
bpy.utils.register_class(Coupebas)

# Fill + Z
class Remplibas(bpy.types.Operator):
    bl_idname = "object.remplibas"
    bl_label = "Fill"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 0, 1), clear_inner=True, use_fill=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}
        
bpy.utils.register_class(Remplibas)

# Keep - z axis
class Coupehaut(bpy.types.Operator):
    bl_idname = "object.coupehaut"
    bl_label = "Keep - Z"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 0, 1), clear_outer=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}
 
bpy.utils.register_class(Coupehaut)
               
# Fill - Z
class Remplihaut(bpy.types.Operator):
    bl_idname = "object.remplihaut"
    bl_label = "Fill"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 0, 1), clear_outer=True, use_fill=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Remplihaut)        
        
# Keep + Y axis
class Coupeface(bpy.types.Operator):
    bl_idname = "object.coupeface"
    bl_label = "Keep + Y"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 1, 0), clear_inner=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}
        
bpy.utils.register_class(Coupeface)
        
# Fill + Y
class Rempliface(bpy.types.Operator):
    bl_idname = "object.rempliface"
    bl_label = "Fill"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 1, 0), clear_inner=True, use_fill=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Rempliface)  
        
# Keep - Y axis
class Coupelointain(bpy.types.Operator):
    bl_idname = "object.coupelointain"
    bl_label = "Keep - Y"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 1, 0), clear_outer=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Coupelointain)
        
# Fill - Y
class Remplilointain(bpy.types.Operator):
    bl_idname = "object.remplilointain"
    bl_label = "Fill"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(0, 1, 0), clear_outer=True, use_fill=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Remplilointain) 
        
# Keep + X axis
class Coupegauche(bpy.types.Operator):
    bl_idname = "object.coupegauche"
    bl_label = "Keep + X"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(1, 0, 0), clear_inner=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Coupegauche)         
        
# Fill + X
class Rempligauche(bpy.types.Operator):
    bl_idname = "object.rempligauche"
    bl_label = "Fill"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(1, 0, 0), clear_inner=True, use_fill=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Rempligauche)
        
# Keep - X axis
class Coupedroite(bpy.types.Operator):
    bl_idname = "object.coupedroite"
    bl_label = "Keep - X"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(1, 0, 0), clear_outer=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Coupedroite)

# Fill - X 
class Remplidroite(bpy.types.Operator):
    bl_idname = "object.remplidroite"
    bl_label = "Fill"

    def execute(self, context):
        bpy.ops.mesh.bisect(plane_co=(0, 0, 0),  plane_no=(1, 0, 0), clear_outer=True, use_fill=True, xstart=12, xend=315, ystart=270, yend=271)
        return {'FINISHED'}

bpy.utils.register_class(Remplidroite)       
                
       
       
class BisectAxis(bpy.types.Panel):
    bl_category = "Tools"
    bl_context = "mesh_edit"
    bl_label = "Bisect Axis"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category  =  'Bisect_Axis'
    
    def draw(self, context):
        layout = self.layout
        col = layout.column(align=True)
        row = col.row(align=True)
        row.operator("object.coupebas")
        row.operator("object.remplibas")
        row = col.row(align=True)
        row.operator("object.coupehaut")
        row.operator("object.remplihaut")
        row = col.row(align=True)
        row.operator("object.coupeface")
        row.operator("object.rempliface")
        row = col.row(align=True)
        row.operator("object.coupelointain")
        row.operator("object.remplilointain")
        row = col.row(align=True)
        row.operator("object.coupegauche")
        row.operator("object.rempligauche")
        row = col.row(align=True)
        row.operator("object.coupedroite")
        row.operator("object.remplidroite")
        
        

def register():
    bpy.utils.register_class(BisectAxis)
    
    
def unregister():
    bpy.utils.unregister_class(BisectAxis)

if __name__ == "__main__":
    register()        
        
       
        
               
        
        
        
        
              
        
        
        



        










