# Change log
# - added ability to get the global positon of vertices in groups/components (1st instance only)
# - improved formatting of output
# - added vertices only option
A key new feature is the ability to find the global position of vertices that are inside unopened and/or nested Groups/Components. As an example, if you create a cube then Group it, and you have a plugin that tries to get the position of the vertices using .position, the results will be relative to the Group (local space), not the model (global space). This plugin has a feature which can find all parent Groups/Components and stack their Transformations onto the vertex position to get the global position.
===============================================================
As I have struggled up the learning curve on writing SU plugins, I discovered that understanding how SU computes the location of things is quite complex! For instance, you might have a Group of objects, and that Group may be nested in another Group. Each Group has Transformations, and if you open a Group you get "local" positions! Then you have scaling, rotation...
This plugin is really just a tool for developers to explore the position of objects in real time. You right-click (context-click) on an object or objects, and it will run a report to the Ruby Console. It has helped me to learn about the inner workings of SU.
All functionality is accessed through the context menu, and the output goes to the Ruby Console. Currently there are four choices:
- Position Report (position information about selection)
- Position Report Recursive (includes all nested objects in selection)
- Position Report Recursive, No Faces (same as previous but Faces are skipped to reduce duplicate vertices)
- Position Report Detailed Recursive (provides additional details besides position)
***** Begin Position Report Thu Feb 11 22:04:00 Eastern Standard Time 2010 *****
Options: Recursive(true), Faces(true), Detail(false)
#<Sketchup::Group:0xcdf4b10>; ID:146; Name=; contains 19 entities
Group Transformation:
1.0 : 0.0 : 0.0 : 0.0
0.0 : 1.0 : 0.0 : 0.0
0.0 : 0.0 : 1.0 : 0.0
14.1858552430346 : 28.7146355916016 : 0.0 : 1.0
Entities in Group ID:146:
#<Sketchup::Edge:0xcdcdcd8>; ID:138
Vert ID:97 [0].position = (20.435683", 40.376235", 0")
Vert ID:122 [1].position = (20.435683", 40.376235", 3.61414")
#<Sketchup::Edge:0xcdcddb0>; ID:131
Vert ID:93 [0].position = (9.152105", 40.376235", 0")
Vert ID:118 [1].position = (9.152105", 40.376235", 3.61414")
(Note: The formatting doesn't show up well here)
I'm finding that the recursive feature really helps to understand the relative position of objects in groups and components. Try creating a box, group it, then create a second box and create a new group of the first and second boxes, then experiment with opening the top group, then the nested group, and checking positions.
Be careful with using recursive mode on objects with many entities! It will report on EVERY face, edge and their associated vertices.
More features are planned, including formatted reporting and saving to a file.
Let me know what you think.
Glenn