echefede
echefede

Reputation: 536

Draw a circle with a circle void inside with paperjs

Draw a steel pipe section in paperjs. It's only a circle with a void circle inside. Just like this:

Typical steel pipe section

So far I have tried joins, intersections, subtractions, adds, but I am not able to achieve that simple task.

Upvotes: 1

Views: 69

Answers (1)

echefede
echefede

Reputation: 536

.subtract() is the correct method. Found it in paperjs.org examples

const outer = new paper.Path.Circle(position, diameter/2)
const inner = new paper.Path.Circle(position, diameter/2-thickness)
pipe_section = outer.subtract(inner)

Upvotes: 2

Related Questions