Is it possible to 'offset' an object, e.g concentric circles?

In AutoCAD, there is a command to ‘offset’ an object. You select the object (line, circle, rectangle, arc etc.), specify either a positive or a negative value and the object will be ‘offset’ according to the entered value.

If a circle was specified as the source object and a value of +5 was entered, a concentric circle +5 larger would be created.

Is there a way to do the same in Processing? i.e. place a circle and then offset the circle by a set amount?

The image below shows the idea of what I am trying to achieve.

Just to add, I know I can create concentric circles using a for loop, this is specific to selecting an object and ‘offsetting’ it.

Many thanks…


Hi @GoodJuJu,

Are you trying to offset or scale? the example shown is scaling relative to the object’s center…

What you are asking is not as simple as thought:

  1. You need to select the object (which can be any polygon)
  2. you need to input a command, parse it and act accordingly
  3. you need to create a new object which copies the properties of the selected one and then offset or scale it

It is possible but if you have some code it would be helpful to start with :slight_smile:

See this post: