How do I keep the two objects from penetrating each other in Blender? I created the object by first creating the edges to the curved face with the script below followed by adding a face and then extruding it. I made sure to change the Source property under Collision to Base but still the objects penetrate each other. How do I prevent this? Any help would be much appreciated. It has been too long that I have been struggling with this :(

import bpy
import math
from math import sin, cos, radians, sqrt

# variables
n_verts = 24
profile_radius = 1
section_angle = 240.0 / (n_verts-1) 
z_float = 0.0
Verts = []
Edges = []
Faces = []

# code for bottom face
for i in range(n_verts):
    x_float = cos(-math.pi/6+math.radians(section_angle*i))
    y_float = 1 + sin(-math.pi/6+math.radians(section_angle*i))
    Verts.append((x_float, y_float, z_float))
    
for i in range(1, n_verts):
    x_float = -math.sqrt(3)/2 + cos(math.pi/2+math.radians(section_angle*i))
    y_float = -1/2 + sin(math.pi/2+math.radians(section_angle*i))
    Verts.append((x_float, y_float, z_float))

for i in range(1, n_verts-1):
    x_float = math.sqrt(3)/2 + cos(-5*math.pi/6+math.radians(section_angle*i))
    y_float = -1/2 + sin(-5*math.pi/6+math.radians(section_angle*i))
    Verts.append((x_float, y_float, z_float))

# connect all the edges
for i in range(3*n_verts-3):
    if i == 3*n_verts-4:
        Edges.append([i, 0])
        break
    Edges.append([i, i+1])

profile_mesh = bpy.data.meshes.new(&quot;Base_Profile_Data&quot;)
profile_mesh.from_pydata(Verts, Edges, Faces)
profile_mesh.update()

profile_object = bpy.data.objects.new(&quot;Base_Profile&quot;, profile_mesh)
profile_object.data = profile_mesh

scene = bpy.context.scene
scene.collection.objects.link(profile_object)
profile_object.select_set(True)
The problem is that the surface Normals are facing inwards and this is breaking the collision.
To resolve this, select each object and go into Edit mode (Tab), select all (A) and select Mesh/Normals/Recalculate Outside. This should re-calculate the normals so that they are consistent with a solid object. Once you have done this for both objects, re-run the simulation and the collision should now be working correctly.
Bad normals

Good normals