There is a face here, and part of it is dug inside. How can I get the coordinate points of these two rectangles separately and let these points output clockwise?If you can help me solve this problem, I would be grateful.
In addition, if there are multiple internal digging, I want to get their coordinates separately. Is this principle the same as one?
Can you explain a bit more what you are trying to achieve? You want to know the “coordinates” of the rectangles. Does that mean the x,y,z distance from your origin point? If so the Text tool can give you a quick look at the coordinates, the x,y,z are displayed by default in this tool. Or are you looking for the dimensions of the two boxes you modeled? In which case the dimension tool or just good modeling practice to begin with can tell you this.
How would dimensions output clockwise? A list of the x,y,z location of each corner? Starting where? What do you really need to know about this shape?
I want to know the coordinates of each point of this graph, and output these points according to the internal and external.
In ruby the code will be something like this. Select a face before pasting the code into the ruby console
model = Sketchup.active_model
obj = model.selection[0]
if obj.class == Sketchup::Face
inner_loops = obj.loops - [obj.outer_loop]
p 'outer loop'
p obj.outer_loop
obj.outer_loop.vertices.each{|pt| p pt.position}
p 'inner loops'
inner_loops.each{|l|
p l
l.vertices.each{|pt| p pt.position}
}
end
nil
Your method does get coordinates, but I want to use the RUBY language to achieve coordinate output.
sir,I can really know these points with your method, but I want him to output as an array. How can I modify it, thank you again.