Change the origin to the center of object in Google SketchUp(Free version)
Question
As shown in the following, I am trying to move the origin to the center of the bounding box of this 3D object by using its Axes tool. At a result, it seems very hard to find that center because there is not auto-snap to help me move the axes. I am using the free version of Google SketchUp 8 and I do find some handy source code like plug-in to do this for me in Pro version which I don't have.
Could anyone tell know how to perform this to set the origin to the center?
Solution
(What plugin did you find that did this only in Pro?)
I happen to have a plugin that does this: http://sketchucation.com/forums/viewtopic.php?t=30508
If you want to do this yourself by code, then the gist of it is:
- Get the point for the new origin of the axes.
instance.bounds.center
- Get the vector from the new origin to the old origin.
- In the definition of the group or component, transform all the content using the vector.
- For each instance belonging to the definition, apply the inverse transformation.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow