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

**URL:** <https://discourse.processing.org/t/is-it-possible-to-offset-an-object-e-g-concentric-circles/36586>\
**Category:** Coding Questions\
**Created:** [April 25, 2022, 1:23pm UTC](https://discourse.processing.org/t/is-it-possible-to-offset-an-object-e-g-concentric-circles/36586 "2022-04-25T13:23:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoodJuJu](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/goodjuju/32/14504_2.png) [@GoodJuJu](https://discourse.processing.org/u/GoodJuJu)\
**Post date:** [April 25, 2022, 1:23pm UTC](https://discourse.processing.org/t/is-it-possible-to-offset-an-object-e-g-concentric-circles/36586/1 "2022-04-25T13:23:48Z")

</div>

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…

![Offset](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/d/3daf62f2f81d88fb883195a3cf33d87dde6b502b.png)

---

<div class="post-metadata">

**Author:** ![PhySan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/physan/32/16087_2.png) [@PhySan](https://discourse.processing.org/u/PhySan)\
**Post date:** [April 28, 2022, 10:20pm UTC](https://discourse.processing.org/t/is-it-possible-to-offset-an-object-e-g-concentric-circles/36586/2 "2022-04-28T22:20:45Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [April 29, 2022, 1:18pm UTC](https://discourse.processing.org/t/is-it-possible-to-offset-an-object-e-g-concentric-circles/36586/3 "2022-04-29T13:18:49Z")

</div>

See this post:

> [@Letter boundary offset](https://discourse.processing.org/t/letter-boundary-offset/6976/5):
>
> Use [Processing Geometry Suite](https://discourse.processing.org/t/processing-geometry-suite/29924) to do this easily. Offset Style = Bevel Offset Style = Round Offset Style = Miter Animated Code Exampleplay_button Code... Bonus Applying PGS\_Morphology.fieldWarp() to offset curves.

![miteredInterior.gif](https://github.com/micycle1/PGS/blob/master/resources/contour/miteredInterior.gif?raw=true)
