Hi Thom,
Here is example and results (I'm obviously doing something wrong, but not sure where the problem is).
In model I have 2 groups:
group1 - consisting of 2 subgroups, where one subgroup contains face we analyze in example
group2 - consisting of some object.
Here is the code, to get the face I go through hierarchy - but every time it is the same face
face = Sketchup.active_model.entities[1].entities[1].entities[14]
p1 = face.outer_loop.vertices[0].position
t1 =Sketchup.active_model.edit_transform
p1_trans_inv = p1.transform(t1.inverse())
puts "P1 coordinates [#{p1.to_a.join(',')}]"
puts "Edit_transform [#{t1.to_a.join(',')}]"
puts "Edit_transform_inverse [#{t1.inverse.to_a.join(',')}]"
puts "P1_transform_inverse [#{p1_trans_inv.to_a.join(',')}]"
Absolute P1 coordinates in SU coordinate system are:[-393.700787401575,196.850393700787,0.0]
I call this small script for various cases of opened groups inside model and here are results:
*opened group where face is
P1 coordinates [-393.700787401575,196.850393700787,0.0]
Edit_transform [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,-548.031496062992,196.850393700787,0.0,1.0]
Edit_transform_inverse [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,548.031496062992,-196.850393700787,-0.0,1.0]
P1_transform_inverse [154.330708661417,0.0,0.0]
*closed group with face, opened parent group
P1 coordinates [154.330708661417,0.0,0.0]
Edit_transform [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,-548.031496062992,196.850393700787,0.0,1.0]
Edit_transform_inverse [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,548.031496062992,-196.850393700787,-0.0,1.0]
P1_transform_inverse [702.362204724409,-196.850393700787,0.0]
*closed group with face, opened parent group, opened other group in the parent
P1 coordinates [154.330708661417,0.0,0.0]
Edit_transform [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,-367.646959030915,310.128373863173,80.3149606299213,1.0]
Edit_transform_inverse [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,367.646959030915,-310.128373863173,-80.3149606299213,1.0]
P1_transform_inverse [521.977667692332,-310.128373863173,-80.3149606299213]
*closed group, closed parent group, opened some other group
P1 coordinates [154.330708661417,0.0,0.0]
Edit_transform [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,-464.698354923942,49.8468801242114,-1.13686837721616e-013,1.0]
Edit_transform_inverse [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,464.698354923942,-49.8468801242114,1.13686837721616e-013,1.0]
P1_transform_inverse [619.029063585359,-49.8468801242114,1.13686837721616e-013]
*closed all groups
P1 coordinates [154.330708661417,0.0,0.0]
Edit_transform [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]
Edit_transform_inverse [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]
P1_transform_inverse [154.330708661417,0.0,0.0]
As you can see using inverse edit_transform gives each time different results for 'P1_transform_inverse', depending which group is opened - and my goal is to get in each case the same results (since these should be absolute coordinates)
Also notice- that when group with face is opened- we get absolute coordinates (and not relative to the group origin), while in all other cases we get relative coordinates for p1.
So as in previous mail my question is how to get correct absolute coordinates for all other cases (when group with face is closed, and some or no other groups are opened)?
Thanks for patience,
Marija