Arcs and Circles for Preview Tool

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.

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

Draw as go using lines.

1 Like

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.

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

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.