How to receive correct coordinates of all vertexes in selection, including all the nested groups and components.
Multiplication of transformations far not always gives correct result, especially if for any nested group(component) of an axis do not coincide with an axis of group(component) in which it is enclosed.
I was trying so:
...
@lines = []
extract_lines(group.entities, (Geom;;Transformation.new))
...
def extract_lines(ents, tr)
ents.each do |e|
if e.typename == "Edge"
line = [e.vertices[0].position, e.vertices[1].position]
line[0] = tr * line[0]
line[1] = tr * line[1]
@lines << line
elsif e.typename == "Group"
extract_lines(e.entities, (e.transformation * tr))
elsif e.typename == "ComponentInstance"
extract_lines(e.definition.entities, (e.transformation * tr))
end
end
end
But here the relative positioning of groups concerning a model is not considered.
There are ideas as it to make?