Create arch view chair in sketchup using ruby

Hi All,

I have created a chair in sketchup using ruby script and now i want create arch view chair in sketchup using ruby script, Herewith, I have attached my screen shot which i have create previously.


Created One

I want to create like this chair using ruby script, just i have attached image for what i want to do in sketchup using ruby script


Expected

Please, help me to create arch view chair

Thanks,
Siva S

There are two approaches:

  • Draw and modify entities as you would draw with the cursor in SketchUp. The problem is that repeatedly creating entities and deleting (with all of SketchUp’s automatic merging and splitting) has bad performance. Also such operations can have side effects that create new entities to which you have no references (unpredictable!).
    You could draw an arc, then add a face and pass the arc and the chair’s top edge as parameter.

  • Calculate the vertex positions (“virtual geometry”) and generate the entities exactly as you need them in one step. You would generate an array with four points of the backrest and use trigonometry (sinus etc.) or Geom::Transformation.rotation to compute the points of the arc. Finally you add a face with the array of points as parameter.