import ezdxf def create_dxf(filename="dog_face.dxf"): # Create a new DXF document with R2000+ compatibility doc = ezdxf.new(dxfversion="R2000") # Get the modelspace where drawing entities will be added msp = doc.modelspace() # Draw the outline of the dog's face (a simple oval shape) msp.add_ellipse(center=(0, 0), major_axis=(30, 0), ratio=0.8) # Draw the eyes msp.add_circle(center=(-10, 10), radius=3) # Left eye msp.add_circle(center=(10, 10), radius=3) # Right eye # Draw the nose msp.add_circle(center=(0, 0), radius=2) # Draw the mouth (a simple curve) msp.add_arc(center=(0, -5), radius=5, start_angle=200, end_angle=340) # Draw the ears (two triangles) msp.add_polyline2d(points=[(-20, 20), (-30, 35), (-10, 30), (-20, 20)]) # Left ear msp.add_polyline2d(points=[(20, 20), (30, 35), (10, 30), (20, 20)]) # Right ear # Save the drawing doc.saveas(filename) print("DXF file '" + filename + "' created successfully.") if __name__ == "__main__": create_dxf()