Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
251 views
in Technique[技术] by (71.8m points)

Python Turtle or any other library for 2D drawing

I am using python3.7 and its math and turtle module I have to draw a 2D sketch with arcs. For example

  1. Draw a main circle with radius 1.5m
  2. Draw another arc with radius of 1.7m and 2.8m from 5 degree to 75 degrees and join their end point
  3. Now draw another circle at 5 degrees and at 2m from main circle with a radius of 0.4m.
  4. Draw radial lines at interval of 10 degrees and write their respective angle at those radial lines.

Main circle can have radius as large as 10m. And all these values i can calculate with simple math lib of python. But to draw i thought i can use turtle module. But it draw in pixel with very limited values. Is there any way to scale these values to pixel in turtle module, or any other graphic library for this work. Expected output is something like this.enter image description here

question from:https://stackoverflow.com/questions/65855776/python-turtle-or-any-other-library-for-2d-drawing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The Pillow library (PIL fork) can do it https://pillow.readthedocs.io/en/stable/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...