program for drawing simple but precise shapes automatically?

I need to create a bunch of simple shapes for a game. The shapes themselves are very simple, but I need them to be precise. For example, I want to tell the program “draw a white circle and divide it into five equally long sections” or “draw multiple circles inside each other, with each circle getting smaller with a factor of 0.8”. So I’m basically looking to create these shapes programmatically, instead of drawing them all manually by myself.

So two questions:

  1. Is there a word for creating drawings in such a way?
  2. What kind of software could I use to accomplish this?

Answer

Well, there are many ways to skin the cat(fish). What you describe goes right down the alley of GeoGebra. However i’m not exactly sure this is your usecase.

If it was me then I would write this in PostScript or EPS, since its by far easiest to write out for me. You can use Illustrator, Imagemagic, GhostScript or even the printer to render the results.

Script 1: Draw a circle split into 5

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 200 200
%%Title: CircleSplit
%%Creator: joojaa
%%CreationDate:  2017-14-2
%%EndComments

100 100 translate

0 1 5{ 
  360 5 div rotate
  newpath 
  0 0 moveto 
  0 0 90 0 360 5 div arc 
  closepath 
  stroke
} for

%%EOF

enter image description here

Image 1: Result of script 1

Script 1: Draw a circle scaled consequently by 0.8

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 200 200
%%Title: CircleScale
%%Creator: joojaa
%%CreationDate:  2017-14-2
%%EndComments

100 100 translate

0 1 4{ 
  newpath 
  0 0 90 0 360  arc 
  closepath 
  stroke
  0.8 0.8 scale
} for

%%EOF

enter image description here

Image 2: Result of script 2

But perhaps you want top actually test Logo.

Attribution
Source : Link , Question Author : noClue , Answer Author : joojaa

Leave a Comment