MareroQ wrote:
Thank You Ofnuts for the quick reply.
Ofn-path-to-shape.py - this 838 lines of code.
It's too hard - for a beginner to learn about creating shapes paths in Python.
The heart is the only example of using a bow to create assorted figures (through symmetry, rotation and flip - the problem is the arc).
You didn't really search, did you? Of course this code constructs a full circle with an arbitrary orientation of its four control points
def pointAtRhoThetaFromOrigin(origin,rho,theta):
xo,yo=origin
x=xo+rho*math.cos(theta)
y=yo+rho*math.sin(theta)
return (x,y)
def circleTriplet(center,rho,theta):
'''
One anchor and its two handles to create a circle approximation
(four needed for a full circle)
'''
anchor=pointAtRhoThetaFromOrigin(center,rho,theta)
bwdHandle=pointAtRhoThetaFromOrigin(anchor,rho*kappa,theta-math.pi/2)
fwdHandle=pointAtRhoThetaFromOrigin(anchor,rho*kappa,theta+math.pi/2)
return [bwdHandle,anchor,fwdHandle]
def circleFromRadius(p1,p2):
rho=distance(p1,p2)
theta=angle(p1,p2)
points=[]
for i in range(4):
triplet=circleTriplet(p1,rho,theta+(i*math.pi/2))
points.extend(triplet)
return points,True
Besides, neither you nor Disnasset are beginners. This is more high school math than code, and the last time I did math seriously was about 35 yeas ago. You just have to believe in yourself and dive.
PS: Current O-P-2-S is 861 lines, so you must have an old version.