|
import streamlit as st |
|
import matplotlib.pyplot as plt |
|
import numpy as np |
|
|
|
def main(): |
|
st.title("Goetic Seals Generator") |
|
st.markdown( |
|
""" |
|
|
|
**Author:** cha0smagick the Techno wizard |
|
**Created for the blog:** [El Rincon Paranormal](https://elrinconparanormal.blogspot.com) |
|
**Project's main page:** [Technowizard Cha0smagick's Goetic seals Generator](https://elrinconparanormal.blogspot.com/2023/12/Free%20Online%20Goetic%20Seals%20Generator%20By%20Technomage%20Cha0smagick.html) |
|
|
|
""" |
|
) |
|
radius_outer = 1.0 |
|
radius_inner = 0.6 |
|
circle_center = (0.0, 0.0) |
|
|
|
theta = np.linspace(0, 2 * np.pi, 100) |
|
x_outer = circle_center[0] + radius_outer * np.cos(theta) |
|
y_outer = circle_center[1] + radius_outer * np.sin(theta) |
|
x_inner = circle_center[0] + radius_inner * np.cos(theta) |
|
y_inner = circle_center[1] + radius_inner * np.sin(theta) |
|
|
|
name = st.text_input("Entrer a Name, Desire or wish:") |
|
|
|
conversion_type = st.selectbox("Choose a Goetic language:", ["Hebreo", "Árabe"]) |
|
|
|
conversion_dict = {} |
|
|
|
if conversion_type == "Hebreo": |
|
conversion_dict = { |
|
'A': ('א', 1), |
|
'B': ('ב', 2), |
|
'C': ('ג', 3), |
|
'D': ('ד', 4), |
|
'E': ('ה', 5), |
|
'F': ('ו', 6), |
|
'G': ('ז', 7), |
|
'H': ('ח', 8), |
|
'I': ('ט', 9), |
|
'J': ('י', 10), |
|
'K': ('כ', 20), |
|
'L': ('ל', 30), |
|
'M': ('מ', 40), |
|
'N': ('נ', 50), |
|
'O': ('ס', 60), |
|
'P': ('ע', 70), |
|
'Q': ('פ', 80), |
|
'R': ('צ', 90), |
|
'S': ('ק', 100), |
|
'T': ('ר', 200), |
|
'U': ('ש', 300), |
|
'V': ('ת', 400), |
|
'W': ('ך', 500), |
|
'X': ('ם', 600), |
|
'Y': ('ן', 700), |
|
'Z': ('ף', 800), |
|
} |
|
else: |
|
conversion_dict = { |
|
'A': ('أ', 1), |
|
'B': ('ب', 2), |
|
'C': ('ج', 3), |
|
'D': ('د', 4), |
|
'E': ('ه', 5), |
|
'F': ('و', 6), |
|
'G': ('ز', 7), |
|
'H': ('ح', 8), |
|
'I': ('ط', 9), |
|
'J': ('ي', 10), |
|
'K': ('ك', 20), |
|
'L': ('ل', 30), |
|
'M': ('م', 40), |
|
'N': ('ن', 50), |
|
'O': ('س', 60), |
|
'P': ('ع', 70), |
|
'Q': ('ف', 80), |
|
'R': ('ص', 90), |
|
'S': ('ق', 100), |
|
'T': ('ر', 200), |
|
'U': ('ش', 300), |
|
'V': ('ت', 400), |
|
'W': ('خ', 500), |
|
'X': ('م', 600), |
|
'Y': ('ن', 700), |
|
'Z': ('ظ', 800), |
|
} |
|
|
|
converted_name = "" |
|
numerical_values = [] |
|
|
|
if name: |
|
for char in name: |
|
char_upper = char.upper() |
|
if char_upper in conversion_dict: |
|
converted_char, value = conversion_dict[char_upper] |
|
numerical_values.append(value) |
|
converted_name += converted_char |
|
else: |
|
numerical_values.append(0) |
|
converted_name += char |
|
|
|
st.write("Goetic Name:", converted_name) |
|
|
|
fig, ax = plt.subplots(figsize=(6, 6)) |
|
ax.fill_between(theta, radius_inner, radius_outer, color='white') |
|
|
|
angle = np.linspace(0, 2 * np.pi, len(converted_name), endpoint=False) |
|
for char, ang in zip(converted_name, angle): |
|
x = circle_center[0] + (radius_inner + (radius_outer - radius_inner) / 2) * np.cos(ang) |
|
y = circle_center[1] + (radius_inner + (radius_outer - radius_inner) / 2) * np.sin(ang) |
|
ax.text(x, y, char, fontsize=34, ha='center', va='center', rotation=ang * 180 / np.pi + 90) |
|
|
|
ax.plot(x_outer, y_outer, color='black') |
|
ax.plot(x_inner, y_inner, color='black') |
|
|
|
figure_points = [] |
|
num_sides = len(numerical_values) |
|
|
|
if num_sides != 0: |
|
angle_step = 2 * np.pi / num_sides |
|
random_angles = np.random.rand(num_sides) * 2 * np.pi |
|
polygon_angles = [] |
|
|
|
for i, angle in enumerate(random_angles): |
|
value = numerical_values[i % len(numerical_values)] |
|
max_radius = radius_inner * value / 100 |
|
if max_radius > radius_inner: |
|
max_radius = radius_inner |
|
x = circle_center[0] + max_radius * np.cos(angle) |
|
y = circle_center[1] + max_radius * np.sin(angle) |
|
figure_points.append((x, y)) |
|
ax.plot([x, circle_center[0]], [y, circle_center[1]], color='white') |
|
polygon_angles.append(angle) |
|
|
|
for i in range(num_sides): |
|
x1, y1 = figure_points[i] |
|
for j in range(i + 1, num_sides): |
|
x2, y2 = figure_points[j] |
|
ax.plot([x1, x2], [y1, y2], color='white') |
|
|
|
polygon_points = [] |
|
for angle in polygon_angles: |
|
x = circle_center[0] + radius_inner * np.cos(angle) |
|
y = circle_center[1] + radius_inner * np.sin(angle) |
|
polygon_points.append((x, y)) |
|
|
|
for i in range(num_sides): |
|
x1, y1 = polygon_points[i] |
|
x2, y2 = polygon_points[(i + 1) % num_sides] |
|
ax.plot([x1, x2], [y1, y2], color='black') |
|
|
|
ax.set_xlim(-1.2, 1.2) |
|
ax.set_ylim(-1.2, 1.2) |
|
ax.axis('off') |
|
|
|
plt.savefig('sello.jpg', format='jpg') |
|
st.image('sello.jpg') |
|
|
|
if __name__ == '__main__': |
|
main() |
|
|