Created
July 27, 2024 20:13
-
-
Save antonioshadji/512b0b52c6281e287599594d820d9a1c to your computer and use it in GitHub Desktop.
Generate evenly spaced connection points for rectangular draw.io diagram shapes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Place the resulting output into the style of a draw.io shape. | |
Edit Style -> paste output at end. | |
""" | |
import numpy as np | |
# generate connection points for draw.io shapes | |
hnum=16 # sections along the horizontal | |
vnum=4 # sections along the vertical | |
precision=4 | |
points=[] | |
for x in np.linspace(0,1,hnum+1): | |
for y in np.linspace(0,1,vnum+1): | |
if 0 in {x, y} or 1 in {x, y}: | |
points.append([np.round(x,precision),np.round(y,precision)]) | |
print(f"points={points}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment