Arcs and Circles for Preview Tool


#1

I’m quite familiar with the draw method for creating tools with the API. I am wondering though if there is a way to draw preview geometry that is curved: arcs and circles?

On the same note it would useful if I could draw a temporary dimension, I’m sure someone has had a similar requirement to this.


#2

The SketchUp Team example Bezier Tool shows how.
You may wish to use GL_LINE_LOOP for circles.

Draw as go using lines.


#3

I suppose I could just approximate the curve with about 6 line segments, but I didn’t know if there was a ready made circle/arc function within the draw method. It is just for a preview so the exact geometry displayed is not overly critical.


#4

There is no built in arc/circle function but thomthom has an interesting approach to calculating the needed points in tt_solid_inspector2. Look in geometry.rb

https://bitbucket.org/thomthom/solid-inspector/src