cha0smagick's picture
Update app.py
3169ce4 verified
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()