SketchUp / sketchup-shapes

Shapes adds new tools for drawing more shapes and primitives in SketchUp.
http://extensions.sketchup.com/content/shapes
MIT License
26 stars 13 forks source link

Consistency question - why are Dome and Sphere resolutions defined as 'segments per 90 degrees'? #16

Open johnwmcc opened 10 years ago

johnwmcc commented 10 years ago

Why did the original plugin choose 'segments per 90 degrees' for Dome (and now Sphere)? I've just kept it, without thinking much about it, and adapted the same structure of code to make a Sphere. But I'm now wondering.

One reason might be to have a group that's quicker to generate - the same quarter dome mesh revolved four times for Dome, or eight times for Sphere, rather than separately generated - but I'm not sure this is true unless the initial quarter-dome mesh were made into a component, not a group.

Would it be more consistent with other shapes based on a circle, and more flexible, to change the code so you can have any number of segments per 360 degrees?

I'm not inclined to delay release for this reason, but might come back to it later.

thomthom commented 10 years ago

I'm not clear where this is. Got a line number or screenshot?

thomthom commented 10 years ago

Changing it so you define things based on 360 degrees is fine by me, as long as it doesn't break existing models.

johnwmcc commented 10 years ago

The code is near the beginning of the Dome and Sphere classes in shapes.rb.

I'll see what's involved in changing it. My first inclination was to change the parameter to be segments per 360 degrees, then divide by four before using essentially the same code to generate the dome and sphere shapes.

But this would cause problems if the segments per 360 degrees isn't an exact multiple of four.

Will think again, but have to go out shortly. I'll get back to this later today or tomorrow. Maybe leave it 'as is' - there was probably a good reason for it in the first place.